Search completed in 1.04 seconds.
Introduction to using XPath in JavaScript - XPath
this document describes the interface for using x
path in javascript internally, in extensions, and from websites. mozilla implements a fair amount of the dom 3 x
path, which means that x
path expressions can be run against both html and xml documents. the main interface to using x
path is the evaluate function of the document object. document.evaluate this method evaluates x
path expressions against an xml based document (including html documents), and returns a x
pathresult object, which can be a single node or a set of nodes. the existing documentation for this method is located at document.evaluate, but it is rather sparse for our needs at the moment; a more comprehensive examination will be given below. ...
...ment object. document.evaluate this method evaluates x
path expressions against an xml based document (including html documents), and returns a x
pathresult object, which can be a single node or a set of nodes. the existing documentation for this method is located at document.evaluate, but it is rather sparse for our needs at the moment; a more comprehensive examination will be given below. var x
pathresult = document.evaluate( x
pathexpression, contextnode, namespaceresolver, resulttype, result ); parameters the evaluate function takes a total of five parameters: x
pathexpression: a string containing the x
path expression to be evaluated. contextnode: a node in the document against which the x
pathexpression should be evaluated, including any and all of its child nodes. the document node i...
...valuate function takes a total of five parameters: x
pathexpression: a string containing the x
path expression to be evaluated. contextnode: a node in the document against which the x
pathexpression should be evaluated, including any and all of its child nodes. the document node is the most commonly used. namespaceresolver: a function that will be passed any namespace prefixes contained within x
pathexpression which returns a string representing the namespace uri associated with that prefix. this enables conversion between the prefixes used in the x
path expressions and the possibly different prefixes used in the document. the function can be either: created by using the creatensresolver method of a x
pathevaluator object. you should use this virtually all of the time. null, which can ...
...And 45 more matches
XPath snippets - XPath
this article provides some x
path code snippets—simple examples of how to a few simple utility functions based on standard interfaces from the dom level 3 x
path specification that expose x
path functionality to javascript code. the snippets are functions you can use in the real world in your own code. node-specific evaluator function the following custom utility function can be used to evaluate x
path expressions on given xml nodes. the first argument is a dom node or document object, while the second is a string defining an x
path expression. ...
...nality to javascript code. the snippets are functions you can use in the real world in your own code. node-specific evaluator function the following custom utility function can be used to evaluate x
path expressions on given xml nodes. the first argument is a dom node or document object, while the second is a string defining an x
path expression. ...
...re functions you can use in the real world in your own code. node-specific evaluator function the following custom utility function can be used to evaluate x
path expressions on given xml nodes. the first argument is a dom node or document object, while the second is a string defining an x
path expression. example: defining a custom node-specific evaluatex
path() utility function // evaluate an x
path expression aexpression against a given dom node // or document object (anode), returning the results as an array // thanks wanderingstan at morethanwarm dot mail dot com for the // initial work. ...
...And 22 more matches
Path2D.addPath() - Web APIs
the
path2d.add
path() method of the canvas 2d api adds one
path2d object to another
path2d object. syntax void
path.add
path(
path [, transform]); parameters
path a
path2d
path to add. transform optional a dommatrix to be used as the transformation matrix for the
path that is added. (technically a dommatrixinit object). examples adding a
path to an existing
path this example adds one
path to another. html <canvas id="canvas"></canvas> javascript first, we create two separate
path2d objects, each of which contains a rectangle made using the rect() method. we then create a matrix using document.createelementns() and createsvgmatrix(). we then add the second
path to the first using add
path(), also applying the matrix to move the second
path to the right. finally, we draw the first...
...o another. html <canvas id="canvas"></canvas> javascript first, we create two separate
path2d objects, each of which contains a rectangle made using the rect() method. we then create a matrix using document.createelementns() and createsvgmatrix(). we then add the second
path to the first using add
path(), also applying the matrix to move the second
path to the right. finally, we draw the first
path (which now contains both rectangles) using fill(). ...
...() method. we then create a matrix using document.createelementns() and createsvgmatrix(). we then add the second
path to the first using add
path(), also applying the matrix to move the second
path to the right. finally, we draw the first
path (which now contains both rectangles) using fill(). ...
...And 5 more matches
Comparison of CSS Selectors and XPath - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes this article seeks to document the difference between css selectors and x
path for web developers to be able to better choose the right tool for the right job. ...
... xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes this article seeks to document the difference between css selectors and x
path for web developers to be able to better choose the right tool for the right job. ...
SVGPathElement.pathLength - Web APIs
the svg
pathelement.
pathlength property reflects the
pathlength attribute and returns the total length of the
path, in user units. note: in svg 2 this property was moved to the svggeometryelement interface, from which the svg
pathelement inherits it. syntax var
pathlength = someelement.
pathlength; specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'svg
pathelement.
pathlength' in that specification. recommendation initial definition ...
clip-path - CSS: Cascading Style Sheets
the clip-
path css property creates a clipping region that sets what part of an element should be shown. parts that are inside the region are shown, while those outside are hidden. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ing region that sets what part of an element should be shown. parts that are inside the region are shown, while those outside are hidden. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...should be shown. parts that are inside the region are shown, while those outside are hidden. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 39 more matches
offset-path - CSS: Cascading Style Sheets
the offset-
path css property specifies a motion
path for an element to follow and defines the element's positioning within the parent container or svg coordinate system. ...
... the offset-
path css property specifies a motion
path for an element to follow and defines the element's positioning within the parent container or svg coordinate system. ...
... the offset-
path css property specifies a motion
path for an element to follow and defines the element's positioning within the parent container or svg coordinate system. ...
...And 24 more matches
Paths - SVG: Scalable Vector Graphics
« previousnext » the <
path> element is the most powerful element in the svg library of basic shapes. it can be used to create lines, curves, arcs, and more.
paths create complex shapes by combining multiple straight lines or curved lines. complex shapes composed only of straight lines can be created as <polyline>s. while <polyline>s and <
path>s can create similar-looking shapes, <polyline>s require a lot of small straight lines to simulate curves, and don't scale well to larger sizes. a good understanding of
paths is important when drawing svgs. while creating complex
paths using an xml editor or text editor is not recommended, understanding how they work will allow to identify and repair display issues in svgs. ...
...(see more in basic shapes.) the d attribute contains a series of commands and parameters used by those commands. each of the commands is instantiated (for example, creating a class, naming and locating it) by a specific letter. for instance, let's move to the x and y coordinates (10, 10). the "move to" command is called with the letter m. ...
...that, the parser begins reading for the next command. all of the commands also come in two variants. an uppercase letter specifies absolute coordinates on the page, and a lowercase letter specifies relative coordinates (e.g., move 10px up and 7px to the left from the last point). coordinates in the d parameter are always unitless and hence in the user coordinate system. ...
...And 24 more matches
nsIDOMXPathEvaluator
dom/interfaces/x
path/nsidomx
pathevaluator.idlscriptable this interface is used to evaluate x
path expressions against a dom node. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/dom/x
path-evaluator;1. ...
... dom/interfaces/x
path/nsidomx
pathevaluator.idlscriptable this interface is used to evaluate x
path expressions against a dom node. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/dom/x
path-evaluator;1. ...
... dom/interfaces/x
path/nsidomx
pathevaluator.idlscriptable this interface is used to evaluate x
path expressions against a dom node. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/dom/x
path-evaluator;1. ...
...And 18 more matches
SVGPathSeg - Web APIs
svg
path segment interface this is a base interface that corresponds to a single command within a
path data specification. ...
... svg
path segment interface this is a base interface that corresponds to a single command within a
path data specification. ...
...
path segment interface this is a base interface that corresponds to a single command within a
path data specification. ...
...And 15 more matches
SVGPathSegList - Web APIs
svg
path segment list interface this interface defines a list of svg
pathseg objects. ...
... svg
path segment list interface this interface defines a list of svg
pathseg objects. ...
... svg
path segment list interface this interface defines a list of svg
pathseg objects. ...
...And 13 more matches
Index - XPath
found 57 pages: # page tags and summary 1 x
path css selectors, dom, jxon, landing,
path, xml, x
path, xslt x
path stands for xml
path language. it uses a non-xml syntax to provide a flexible way of addressing (pointing to) different parts of an xml document. it can also be used to test addressed nodes within a document to determine whether they match a pattern or not. 2 axes transforming_xml_with_xslt, x
path, x
path_reference, xslt, xslt_reference for further information on using x
path expressions, please see the for further reading section at the end of transforming xml with xslt document. also see the 'axes' section in the x
path spec. ...
...nodes within a document to determine whether they match a pattern or not. 2 axes transforming_xml_with_xslt, x
path, x
path_reference, xslt, xslt_reference for further information on using x
path expressions, please see the for further reading section at the end of transforming xml with xslt document. also see the 'axes' section in the x
path spec. 3 ancestor axe, x
path no summary! ...
...rn or not. 2 axes transforming_xml_with_xslt, x
path, x
path_reference, xslt, xslt_reference for further information on using x
path expressions, please see the for further reading section at the end of transforming xml with xslt document. also see the 'axes' section in the x
path spec. 3 ancestor axe, x
path no summary! ...
...And 13 more matches
SVGPathElement - Web APIs
the svg
pathelement interface corresponds to the <
path> element. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="...
..." fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="171" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggeometryelement</text></a><polyline points="81,89 71,84 71,94 81,89" stroke="#d4dde4" fill="none"/><line x1="71" y1="89" x2="41" y2="89" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svg
pathelement" target="_top"><rect x="-99" y="65" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-29" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svg
pathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: in svg 2 the getp...
...="-99" y="65" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-29" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svg
pathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: in svg 2 the get
pathsegatlength() and createsvg
pathseg* methods were removed and the
pathlength property and the gettotallength() and getpointatlength() methods were moved to svggeometryelement. properties this interface also inherits properties from its parent, svggeometryelement. svg
pathelement.
pathlength an svganimatednumber corresponding to the
pathlength attribute of the given <
path> element. note: in svg 2 this property was move...
...And 11 more matches
XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes x
path stands for xml
path language. it uses a non-xml syntax to provide a flexible way of addressing (pointing to) different parts of an xml document. it can also be used to test addressed nodes within a document to determine whether they match a pattern or not. x
path is mainly used in xslt, but can also be used as a much more powerful way of navigating through the dom of any xml-like language document using x
pathexpression, such as html and svg, instead of relying on the document.getelementbyid() or parentnode.queryselectorall() methods, the node.childnodes properties, and other dom core features. ...
...ent to determine whether they match a pattern or not. x
path is mainly used in xslt, but can also be used as a much more powerful way of navigating through the dom of any xml-like language document using x
pathexpression, such as html and svg, instead of relying on the document.getelementbyid() or parentnode.queryselectorall() methods, the node.childnodes properties, and other dom core features. x
path uses a
path notation (as in urls) for navigating through the hierarchical structure of an xml document. it uses a non-xml syntax so that it can be used in uris and xml attribute values. note: support for x
path varies widely; it's supported reasonably well in firefox (although there are no plans to improve support further), while other browsers implement it to a lesser extent, if at all. if you ...
... navigating through the hierarchical structure of an xml document. it uses a non-xml syntax so that it can be used in uris and xml attribute values. note: support for x
path varies widely; it's supported reasonably well in firefox (although there are no plans to improve support further), while other browsers implement it to a lesser extent, if at all. if you need a polyfill, you may consider js-x
path or wicked-good-x
path. documentation introduction to using x
path in javascript describes a non-xslt use of x
path. x
path:axes list and definition of the axes defined in the x
path specification. axes are used to describe the relationships between nodes. x
path:functions list and description of the core x
path functions and xslt-specific additions to x
path. transforming xml with xslt xslt...
...And 11 more matches
clip-path - SVG: Scalable Vector Graphics
the clip-
path presentation attribute defines or associates a clipping
path with the element it is related to. note: as a presentation attribute clip-
path can be used as a css property. ...
... the clip-
path presentation attribute defines or associates a clipping
path with the element it is related to. note: as a presentation attribute clip-
path can be used as a css property. ...
...ath presentation attribute defines or associates a clipping
path with the element it is related to. note: as a presentation attribute clip-
path can be used as a css property. ...
...And 9 more matches
clipPathUnits - SVG: Scalable Vector Graphics
the clip
pathunits attribute indicates which coordinate system to use for the contents of the <clip
path> element. ...
... the clip
pathunits attribute indicates which coordinate system to use for the contents of the <clip
path> element. ...
... the clip
pathunits attribute indicates which coordinate system to use for the contents of the <clip
path> element. ...
...And 9 more matches
pathLength - SVG: Scalable Vector Graphics
the
pathlength attribute lets authors specify a total length for the
path, in user units. this value is then used to calibrate the browser's distance calculations with those of the author, by scaling all distance computations using the ratio
pathlength/(computed value of
path length). this can affect the actual rendered lengths of
paths; including text
paths, animation
paths, and various stroke operations. basically, all computations that require the length of the
path. stroke-dasharray, for example, will assume the start of the
path being 0 and the end point the value defined in the
pathlength attribute. ...
... this can affect the actual rendered lengths of
paths; including text
paths, animation
paths, and various stroke operations. basically, all computations that require the length of the
path. stroke-dasharray, for example, will assume the start of the
path being 0 and the end point the value defined in the
pathlength attribute. seven elements are using this attribute: <circle>, <ellipse>, <line>, <
path>, <polygon>, <polyline>, and <rect> html,body,svg { height:100% } <svg viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <style>
path { fill: none; stroke: black; stroke-width: 2; stroke-dasharray: 10; } </style> <!-- no
pathlength, the real length of the
path is used. ...
...ing this attribute: <circle>, <ellipse>, <line>, <
path>, <polygon>, <polyline>, and <rect> html,body,svg { height:100% } <svg viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <style>
path { fill: none; stroke: black; stroke-width: 2; stroke-dasharray: 10; } </style> <!-- no
pathlength, the real length of the
path is used. ...
...And 9 more matches
nsIDOMXPathResult
read only. ...
...read only. ...
...read only. ...
...And 7 more matches
URL.pathname - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 7 more matches
URL.pathname - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 7 more matches
SVGAnimatedPathData - Web APIs
svg animated
path data interface the svganimated
pathdata interface supports elements which have a 'd' attribute which holds svg
path data, and supports the ability to animate that attribute. ...
...erface the svganimated
pathdata interface supports elements which have a 'd' attribute which holds svg
path data, and supports the ability to animate that attribute. ...
...
pathdata interface supports elements which have a 'd' attribute which holds svg
path data, and supports the ability to animate that attribute. interface overview also implement none methods none properties svg
pathseglist animatednormalized
pathseglist svg
pathseglist animated
pathseglist svg
pathseglist normalized
pathseglist svg
pathseglist
pathseglist normative document svg 1.1 (2nd edition) properties this interface also inherits properties from its parent, svg
pathelement. ...
...And 6 more matches
Edit Shape Paths in CSS - Firefox Developer Tools
the shape
path editor is a tool that helps you see and edit shapes created using clip-
path and also the css shape-outside property and <basic-shape> values. this guide walks you through all of the available options. activate / deactivate the shape
path editor the shape
path editor is accessed via the css rules panel, which can be opened as described in the guide to opening the inspector. once you have selected your element, you should see the shape icon alongside any valid value, e.g. one for shape-outside. clicking the icon will cause the editor to highlight the shape. to deactivate the shape
path editor click on the icon again, or select another element or a different editor. ...
...anel, which can be opened as described in the guide to opening the inspector. once you have selected your element, you should see the shape icon alongside any valid value, e.g. one for shape-outside. clicking the icon will cause the editor to highlight the shape. to deactivate the shape
path editor click on the icon again, or select another element or a different editor. note that the shape
path editor does not persist between page reloads — if you reload your page you will need to select the element again. understanding the lines drawn by the editor once you have selected a shape on your page, the shape
path editor will draw lines to help you understand the
path that is being created. a solid line shows the outline of the shape that is wrapping the text. this is your shape. if th...
...the shape which extends past the margin box reference; this is the area that will be clipped by the margin box. to understand the margin box, and other boxes used by css shapes see our guide to shapes from box values. editing basic shapes the options given to you by the tool will differ depending on the type of basic shape that you are editing. options can be accessed by activating the shape
path editor with a regular click on the icon, and you can use the context menu (ctrl/cmd + click) to access additional functionality. circle() if the value of shape-outside is circle(), you are creating a circle basic shape. clicking on the shapes icon next to the value of circle() will highlight the shape, and also give you the option to resize the circle or move its center. if you move or resize t...
...And 5 more matches
CanvasRenderingContext2D.isPointInPath() - Web APIs
the canvasrenderingcontext2d.ispointin
path() method of the canvas 2d api reports whether or not the specified point is contained in the current
path. syntax ctx.ispointin
path(x, y [, fillrule]); ctx.ispointin
path(
path, x, y [, fillrule]); parameters x the x-axis coordinate of the point to check, unaffected by the current transformation of the context. y the y-axis coordinate of the point to check, unaffected by the current transformation of the context. fillrule the algorithm by which to determine if a point is inside or outside the
path. possible values: "nonzero": the non-zero winding rule. default rule. "evenodd": the even-odd winding rule.
path a
path2d
path to check against. if unspecified, the current
path is used. return value boolean a boolean, which is ...
...lrule the algorithm by which to determine if a point is inside or outside the
path. possible values: "nonzero": the non-zero winding rule. default rule. "evenodd": the even-odd winding rule.
path a
path2d
path to check against. if unspecified, the current
path is used. return value boolean a boolean, which is true if the specified point is contained in the current or specified
path, otherwise false. examples checking a point in the current
path this example uses the ispointin
path() method to check if a point is within the current
path. ...
... a
path2d
path to check against. if unspecified, the current
path is used. return value boolean a boolean, which is true if the specified point is contained in the current or specified
path, otherwise false. examples checking a point in the current
path this example uses the ispointin
path() method to check if a point is within the current
path. ...
...And 4 more matches
Location: pathname - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 4 more matches
Path2D - Web APIs
the
path2d interface of the canvas 2d api is used to declare a
path that can then be used on a canvasrenderingcontext2d object. the
path methods of the canvasrenderingcontext2d interface are also present on this interface, which gives you the convenience of being able to retain and replay your
path whenever desired. constructors
path2d()
path2d constructor. creates a new
path2d object. methods
path2d.add
path() adds a
path to the current
path.
path2d.close
path() causes the point of the pen to move back to the start of the current sub-
path. it tries to draw a straight line from the current point to the start. if the shape has already been closed or has only one point, this function does nothing. ...
...it requires three points. the first two points are control points and the third one is the end point. ...
... a new
path2d object. methods
path2d.add
path() adds a
path to the current
path.
path2d.close
path() causes the point of the pen to move back to the start of the current sub-
path. it tries to draw a straight line from the current point to the start. if the shape has already been closed or has only one point, this function does nothing.
path2d.moveto() moves the starting point of a new sub-
path to the (x, y) coordinates.
path2d.lineto() connects the last point in the sub
path to the (x, y) coordinates with a straight line.
path2d.beziercurveto() adds a cubic bézier curve to the
path. it requires three points. the first two points are control points and the third one is the end point. ...
...And 4 more matches
SVGTextPathElement - Web APIs
the svgtext
pathelement interface corresponds to the <text
path> element. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
..."#fff" stroke="#d4dde4" stroke-width="2px" /><text x="156" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextcontentelement</text></a><polyline points="51,89 41,84 41,94 51,89" stroke="#d4dde4" fill="none"/><line x1="41" y1="89" x2="11" y2="89" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svgtext
pathelement" target="_top"><rect x="-169" y="65" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-79" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtext
pathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants method t...
...height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-79" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtext
pathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants method types name value description text
path_methodtype_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. text
path_methodtype_align 1 corresponds to the value align. text
path_methodtype_stretch 2 corresponds to the value stretch. spacing types name value description ...
...And 4 more matches
XPathExpression.evaluate() - Web APIs
the evaluate() method of the x
pathexpression interface executes an x
path expression on the given node or document and returns an x
pathresult. syntax x
pathresult node.evaluate(contextnode, type, result); parameters contextnode a node representing the context to use for evaluating the expression. type optional specifies the type of result to be returned by evaluating the expression. this must be one of the x
pathresult.constants. result optional allows to specify a result object which may be reused and returned by this method. if this is specified as null or the implementation does not reuse the specified result, a new result object will be returned. return value an x
pathresult object representing the result of evaluating the x
path expression. exceptions invalid_expression_err ...
... to specify a result object which may be reused and returned by this method. if this is specified as null or the implementation does not reuse the specified result, a new result object will be returned. return value an x
pathresult object representing the result of evaluating the x
path expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the x
pathevaluator, an x
pathexception of type invalid_expression_err is raised. type_err in case result cannot be converted to the specified type, an x
pathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified x
pathnsresolver, a domexception of type namespace_error is raised. wrong_document_err if the provided contex...
...err is raised. type_err in case result cannot be converted to the specified type, an x
pathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified x
pathnsresolver, a domexception of type namespace_error is raised. wrong_document_err if the provided context node is from a document that is not supported by the x
pathevaluator, a domexception of type wrong_document_err is raised. not_supported_err if the provided context node is not a type permitted as an x
path context node or the request type is not permitted by the x
pathevaluator, a domexception of type not_supported_err is raised. ...
...And 4 more matches
XPathResult.resultType - Web APIs
the read-only resulttype property of the x
pathresult interface represents the type of the result, as defined by the type constants. note: this feature is available in web workers. syntax var resulttype = result.resulttype; return value an integer value representing the type of the result, as defined by the type constants. constants result type defined constant value description any_type 0 a result set containing whatever type naturally results from evaluation of the expression. note that if the result is a node-set then unordered_node_iterator_type is always the resulting type. number_type 1 a result containing a single number. this is useful for example, in an x
path expression using the count() function. string_type 2 a ...
... unordered_node_iterator_type 4 a result node-set containing all the nodes matching the expression. ...
...e_type 8 a result node-set containing any single node that matches the expression. the node is not necessarily the first node in the document that matches the expression. first_ordered_node_type 9 a result node-set containing the first node in the document that matches the expression. example the following example shows the use of the resulttype property. ...
...And 4 more matches
<textPath> - SVG: Scalable Vector Graphics
to render text along the shape of a <
path>, enclose the text in a <text
path> element that has an href attribute with a reference to the <
path> element. html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- to hide the
path, it is usually wrapped in a <defs> element --> <!-- <defs> --> <
path id="my
path" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <!-- </defs> --> <text> <text
path href="#my
path"> quick brown fox jumps over the lazy dog. </text
path> </text> </svg> attributes href the url to the
path or basic shape on which to render the text. if the
path attribute is set, href has no effect. value type: <url> ; default value: none; animatable:...
... value type: left|right ; default value: left; animatable: yes spacing how space between glyphs should be handled. ...
... <url> ; default value: none; animatable: yes lengthadjust where length adjustment should be applied to the text: the space between glyphs, or both the space and the glyphs themselves. value type: spacing|spacingandglyphs; default value: spacing; animatable: yes method which method to render individual glyphs along the
path. value type: align|stretch ; default value: align; animatable: yes
path the
path on which the text should be rendered. value type: <
path_data> ; default value: none; animatable: yes side which side of the
path the text should be rendered. value type: left|right ; default value: left; animatable: yes spacing how space between glyphs should be handled. value type: auto|exact ; default value: exact; animatable: yes startoffset how far the beginning of the text...
...And 4 more matches
nsIDOMXPathExpression
dom/interfaces/x
path/nsidomx
pathexpression.idlscriptable represents a compiled x
path query returned from nsidomx
pathevaluator.createexpression or document.createexpression inherits from: nsisupports last changed in gecko 1.7 method overview nsisupports evaluate(in nsidomnode contextnode, in unsigned short type, in nsisupports result) methods evaluate() evaluate the x
path expression. nsisupports evaluate( in nsidomnode contextnode, in unsigned short type, in nsisupports result ); parameters contextnode a dom node to evaluate the x
path expression against. to evaluate against a whole document, use the document.documentelement method to get the node to evaluate against. ...
...
path expression. nsisupports evaluate( in nsidomnode contextnode, in unsigned short type, in nsisupports result ); parameters contextnode a dom node to evaluate the x
path expression against. to evaluate against a whole document, use the document.documentelement method to get the node to evaluate against. type a number that corresponds to one of the type constants of nsidomx
pathresult. result an existing nsidomx
pathresult to use for the result. using null will create a new nsidomx
pathresult. return value an x
path result. ...
...sion against. to evaluate against a whole document, use the document.documentelement method to get the node to evaluate against. type a number that corresponds to one of the type constants of nsidomx
pathresult. result an existing nsidomx
pathresult to use for the result. using null will create a new nsidomx
pathresult. ...
...And 3 more matches
File.webkitRelativePath - Web APIs
example in this example, a directory picker is presented which lets the user choose one or more directories. when the change event occurs, a list of all files contained within the selected directory hierarchies is generated and displayed. ...
... example in this example, a directory picker is presented which lets the user choose one or more directories. when the change event occurs, a list of all files contained within the selected directory hierarchies is generated and displayed. ...
... example in this example, a directory picker is presented which lets the user choose one or more directories. when the change event occurs, a list of all files contained within the selected directory hierarchies is generated and displayed. ...
...And 3 more matches
SVGClipPathElement - Web APIs
the svgclip
pathelement interface provides access to the properties of <clip
path> elements, as well as methods to manipulate them. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 ...
...o,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgelement</text></a><polyline points="481,25 491,20 491,30 481,25" stroke="#d4dde4" fill="none"/><line x1="491" y1="25" x2="499" y2="25" stroke="#d4dde4"/><line x1="499" y1="25" x2="499" y2="90" stroke="#d4dde4"/><line x1="499" y1="90" x2="482" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svgclip
pathelement" target="_top"><rect x="301" y="65" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgclip
pathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this int...
...takes one of the constants defined in svgunittypes. ...
...And 3 more matches
XPathEvaluator.createExpression() - Web APIs
this method compiles an x
pathexpression which can then be used for (repeated) evaluations of the x
path expression. syntax x
pathexpression x
pathevaluator.createexpression(expression, resolver); parameters expression a domstring representing representing the x
path expression to be created. resolver optional permits translation of all prefixes, including the xml namespace prefix, within the x
path expression into appropriate namespace uris. return value a x
pathexpression representing the compiled form of the x
path expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the x
pathevaluator, an x
pathexception of type invalid_expression_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved b...
...to appropriate namespace uris. return value a x
pathexpression representing the compiled form of the x
path expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the x
pathevaluator, an x
pathexception of type invalid_expression_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified x
pathnsresolver, a domexception of type namespace_error is raised. example the following example shows the use of the evaluate() method. ...
...n_err if the expression is not legal according to the rules of the x
pathevaluator, an x
pathexception of type invalid_expression_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified x
pathnsresolver, a domexception of type namespace_error is raised. example the following example shows the use of the evaluate() method. ...
...And 3 more matches
XPathEvaluator.evaluate() - Web APIs
the evaluate() method of the x
pathevaluator interface executes an x
path expression on the given node or document and returns an x
pathresult. syntax x
pathresult x
pathevaluator.evaluate(expression, contextnode, resolver, type, result); parameters expression a domstring representing the x
path expression to be parsed and evaluated. contextnode a node representing the context to use for evaluating the expression. resolver optional permits translation of all prefixes, including the xml namespace prefix, within the x
path expression into appropriate namespace uris. type optional specifies the type of result to be returned by evaluating the expression. this must be one of the x
pathresult.constants. result optional allows to specify a result object which may be reused and returned by th...
...namespace uris. type optional specifies the type of result to be returned by evaluating the expression. this must be one of the x
pathresult.constants. result optional allows to specify a result object which may be reused and returned by this method. if this is specified as null or the implementation does not reuse the specified result, a new result object will be returned. return value an x
pathresult object representing the result of evaluating the x
path expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the x
pathevaluator, an x
pathexception of type invalid_expression_err is raised. type_err in case result cannot be converted to the specified type, an x
pathexception of type type_err is raised. namespace_err if the expression con...
...sion. exceptions invalid_expression_err if the expression is not legal according to the rules of the x
pathevaluator, an x
pathexception of type invalid_expression_err is raised. type_err in case result cannot be converted to the specified type, an x
pathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified x
pathnsresolver, a domexception of type namespace_error is raised. wrong_document_err if the provided context node is from a document that is not supported by the x
pathevaluator, a domexception of type wrong_document_err is raised. ...
...And 3 more matches
XPathResult.invalidIteratorState - Web APIs
the read-only invaliditeratorstate property of the x
pathresult interface signifies that the iterator has become invalid. it is true if x
pathresult.resulttype is unordered_node_iterator_type or ordered_node_iterator_type and the document has been modified since this result was returned. note: this feature is available in web workers. syntax var iteratorstate = result.invaliditeratorstate; return value a boolean value indicating whether the iterator has become invalid. example the following example shows the use of the invaliditeratorstate property. ...
..._iterator_type or ordered_node_iterator_type and the document has been modified since this result was returned. note: this feature is available in web workers. syntax var iteratorstate = result.invaliditeratorstate; return value a boolean value indicating whether the iterator has become invalid. example the following example shows the use of the invaliditeratorstate property. ...
... since this result was returned. note: this feature is available in web workers. syntax var iteratorstate = result.invaliditeratorstate; return value a boolean value indicating whether the iterator has become invalid. example the following example shows the use of the invaliditeratorstate property. ...
...And 3 more matches
XPathResult.iterateNext() - Web APIs
the iteratenext() method of the x
pathresult interface iterates over a node set result and returns the next node from it or null if there are no more nodes. syntax var node = result.iteratenext(); return value the next node within the node set of the x
pathresult. exceptions type_err in case x
pathresult.resulttype is not unordered_node_iterator_type or ordered_node_iterator_type, an x
pathexception of type type_err is thrown. invalid_state_err if the document is mutated since the result was returned, an x
pathexception of type invalid_state_err is thrown. example the following example shows the use of the iteratenext() method. ...
...
pathresult. exceptions type_err in case x
pathresult.resulttype is not unordered_node_iterator_type or ordered_node_iterator_type, an x
pathexception of type type_err is thrown. invalid_state_err if the document is mutated since the result was returned, an x
pathexception of type invalid_state_err is thrown. example the following example shows the use of the iteratenext() method. ...
...pe or ordered_node_iterator_type, an x
pathexception of type type_err is thrown. invalid_state_err if the document is mutated since the result was returned, an x
pathexception of type invalid_state_err is thrown. example the following example shows the use of the iteratenext() method. ...
...And 3 more matches
XPathResult.snapshotItem() - Web APIs
the snapshotitem() method of the x
pathresult interface returns an item of the snapshot collection or null in case the index is not within the range of nodes. unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated. syntax var node = result.snapshotitem(i); return value the node at the given index within the node set of the x
pathresult. exceptions type_err in case x
pathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the snapshotitem() method. ...
... it is mutated. syntax var node = result.snapshotitem(i); return value the node at the given index within the node set of the x
pathresult. exceptions type_err in case x
pathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the snapshotitem() method. ...
...ndex within the node set of the x
pathresult. exceptions type_err in case x
pathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the snapshotitem() method. ...
...And 3 more matches
XPathResult - Web APIs
the x
pathresult interface represents the results generated by evaluating an x
path expression within the context of a given node. since x
path expressions can result in a variety of result types, this interface makes it possible to determine and handle the type and value of the result. properties x
pathresult.booleanvalueread only a boolean representing the value of the result if resulttype is boolean_type. x
pathresult.invaliditeratorstateread only signifies that the iterator has become invalid. it is true if resulttype is unordered_node_iterator_type or ordered_node_iterator_type and the document has been modified since this result was returned. x
pathresult.numbervalueread only a number representing the value of the result if resulttype is number_type. ...
... result if resulttype is boolean_type. x
pathresult.invaliditeratorstateread only signifies that the iterator has become invalid. it is true if resulttype is unordered_node_iterator_type or ordered_node_iterator_type and the document has been modified since this result was returned. x
pathresult.numbervalueread only a number representing the value of the result if resulttype is number_type. x
pathresult.resulttyperead only a number code representing the type of the result, as defined by the type constants. x
pathresult.singlenodevalueread only a node representing the value of the single node result, which may be null. x
pathresult.snapshotlengthread only the number of nodes in the result snapshot. ...
... a number representing the value of the result if resulttype is number_type. x
pathresult.resulttyperead only a number code representing the type of the result, as defined by the type constants. x
pathresult.singlenodevalueread only a node representing the value of the single node result, which may be null. x
pathresult.snapshotlengthread only the number of nodes in the result snapshot. x
pathresult.stringvalueread only a string representing the value of the result if resulttype is string_type. methods x
pathresult.iteratenext() if the result is a node set, this method iterates over it and returns the next node from it or null if there are no more nodes. ...
...And 3 more matches
path - SVG: Scalable Vector Graphics
the
path attribute has two different meanings, either it defines a text
path along which the characters of a text are rendered, or a motion
path along which a referenced element is animated. two elements are using this attribute: <animatemotion> and <text
path> html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <
path id="my
path" fill="none" stroke="silver" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <text> <text
path path="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50"> quick brown fox jumps over the lazy dog. ...
... html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <
path id="my
path" fill="none" stroke="silver" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <text> <text
path path="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50"> quick brown fox jumps over the lazy dog. </text
path> </text> </svg> animatemotion for <animatemotion>,
path defines the motion
path, expressed in the same format and interpreted the same way as the d geometric property for the <
path> element. ...
...70 75,50" /> <text> <text
path path="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50"> quick brown fox jumps over the lazy dog. </text
path> </text> </svg> animatemotion for <animatemotion>,
path defines the motion
path, expressed in the same format and interpreted the same way as the d geometric property for the <
path> element. the effect of a motion
path animation is a translation along the x- and y-axes of the current user coordinate system by the x and y values computed over time. value <
path-data> default value none animatable no <
path-data> this value defines the motion
path along which the referenced element is animated. for detailed information about the commands that can be used, see the expla...
...And 3 more matches
<clipPath> - SVG: Scalable Vector Graphics
the <clip
path> svg element defines a clipping
path, to be used by the clip-
path property. a clipping
path restricts the region to which paint can be applied. conceptually, parts of the drawing that lie outside of the region bounded by the clipping
path are not drawn. html,body,svg { height:100% } <svg viewbox="0 0 100 100"> <clip
path id="myclip"> <!-- everything outside the circle will be clipped and therefore invisible. --> <circle cx="40" cy="35" r="35" /> </clip
path> <!-- the original black heart, for reference --> <
path id="heart" d="m10,30 a20,20,0,0,1,50,30 a20,20,0,0,1,90,30 q90,60,50,90 q10,60,10,30 z" /> <!-- only the portion of the red heart inside the clip circle is visible. ...
... everything outside the circle will be clipped and therefore invisible. --> <circle cx="40" cy="35" r="35" /> </clip
path> <!-- the original black heart, for reference --> <
path id="heart" d="m10,30 a20,20,0,0,1,50,30 a20,20,0,0,1,90,30 q90,60,50,90 q10,60,10,30 z" /> <!-- only the portion of the red heart inside the clip circle is visible. --> <use clip-
path="url(#myclip)" xlink:href="#heart" fill="red" /> </svg> /* with a touch of css for browsers who * * implemented the r geometry property. */ @keyframes openyourheart {from {r: 0} to {r: 60px}} #myclip circle { animation: openyourheart 15s infinite; } a clipping
path is conceptually equivalent to a custom viewport for the referencing element. thus, it affects the rendering of an element, ...
...metry property. */ @keyframes openyourheart {from {r: 0} to {r: 60px}} #myclip circle { animation: openyourheart 15s infinite; } a clipping
path is conceptually equivalent to a custom viewport for the referencing element. thus, it affects the rendering of an element, but not the element's inherent geometry. the bounding box of a clipped element (meaning, an element which references a <clip
path> element via a clip-
path property, or a child of the referencing element) must remain the same as if it were not clipped. by default, pointer-events are not dispatched on clipped regions. ...
...And 3 more matches
<mpath> - SVG: Scalable Vector Graphics
the <m
path> sub-element for the <animatemotion> element provides the ability to reference an external <
path> element as the definition of a motion
path. usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes core attributes » xlink attributes » externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgm
pathelement interface. ...
...fic attributes xlink:href dom interface this element implements the svgm
pathelement interface. example svg <svg width="100%" height="100%" viewbox="0 0 500 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <rect x="1" y="1" width="498" height="298" fill="none" stroke="blue" stroke-width="2" /> <!-- draw the outline of the motion
path in blue, along with three small circles at the start, middle and end. ...
...terface. example svg <svg width="100%" height="100%" viewbox="0 0 500 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <rect x="1" y="1" width="498" height="298" fill="none" stroke="blue" stroke-width="2" /> <!-- draw the outline of the motion
path in blue, along with three small circles at the start, middle and end. --> <
path id="
path1" d="m100,250 c 100,50 400,50 400,250" fill="none" stroke="blue" stroke-width="7.06" /> <circle cx="100" cy="250" r="17.64" fill="blue" /> <circle cx="250" cy="100" r="17.64" fill="blue" /> <circle cx="400" cy="250" r="17.64" fill="blue" /> <!-- here is a triangle which will be moved about the motion
path. it is defined with an upright orientation with the bas...
...And 3 more matches
nsIDOMXPathException
dom/interfaces/x
path/nsidomx
pathexception.idlscriptable describes an exception resulting from x
path operations. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description code unsigned short the error code; see error codes for details. constants error codes constant value description invalid_expression_err 51 an invalid x
path expression was used. type_err 52 an attempt was made to reference an unavailable type. ...
...rations. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description code unsigned short the error code; see error codes for details. constants error codes constant value description invalid_expression_err 51 an invalid x
path expression was used. ...
...ecko 1.7 attributes attribute type description code unsigned short the error code; see error codes for details. constants error codes constant value description invalid_expression_err 51 an invalid x
path expression was used. ...
...And 2 more matches
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
the canvasrenderingcontext2d.scroll
pathintoview() method of the canvas 2d api scrolls the current or given
path into view. it is similar to element.scrollintoview(). syntax void ctx.scroll
pathintoview(); void ctx.scroll
pathintoview(
path); parameters
path a
path2d
path to use. examples using the scroll
pathintoview method this example demonstrates the scroll
pathintoview() method. ...
...lement.scrollintoview(). syntax void ctx.scroll
pathintoview(); void ctx.scroll
pathintoview(
path); parameters
path a
path2d
path to use. examples using the scroll
pathintoview method this example demonstrates the scroll
pathintoview() method. ...
...l
pathintoview(); void ctx.scroll
pathintoview(
path); parameters
path a
path2d
path to use. examples using the scroll
pathintoview method this example demonstrates the scroll
pathintoview() method. ...
...And 2 more matches
IDBIndex.keyPath - Web APIs
the key
path property of the idbindex interface returns the key
path of the current index. if null, this index is not auto-populated. note: this feature is available in web workers. syntax var mykey
path = myindex.key
path; value any data type that can be used as a key
path. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the key
path of the current index is logged to the console: it should be returned as lname. finally, we iterate through each recor...
... record, and insert the data into an html table. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmob...
...And 2 more matches
IDBObjectStore.keyPath - Web APIs
the key
path read-only property of the idbobjectstore interface returns the key
path of this object store. if this property is null, the application must provide a key for each modification operation. note: this feature is available in web workers. syntax var mykey
path = objectstore.key
path; value any value type. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.key
path to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialise...
...hing is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
URLUtilsReadOnly.pathname - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
XPathEvaluator - Web APIs
the x
pathevaluator interface allows to compile and evaluate x
path expressions. it is implemented by the document interface. methods x
pathevaluator.createexpression() creates a parsed x
path expression with resolved namespaces. x
pathevaluator.creatensresolver() adapts any dom node to resolve namespaces allowing the x
path expression to be evaluated relative to the context of the node where it appeared within the document. x
pathevaluator.evaluate() evaluates an x
path expression string and returns a result of the specified type if possible. example the following example shows the use of the x
pathevaluator interface. ...
...or.creatensresolver() adapts any dom node to resolve namespaces allowing the x
path expression to be evaluated relative to the context of the node where it appeared within the document. x
pathevaluator.evaluate() evaluates an x
path expression string and returns a result of the specified type if possible. example the following example shows the use of the x
pathevaluator interface. ...
...ion to be evaluated relative to the context of the node where it appeared within the document. x
pathevaluator.evaluate() evaluates an x
path expression string and returns a result of the specified type if possible. example the following example shows the use of the x
pathevaluator interface. ...
...And 2 more matches
XPathExpression - Web APIs
this interface is a compiled x
path expression that can be evaluated on a document or specific node to return information from its dom tree. this is useful when an expression will be reused in an application, because it is just compiled once and all namespace prefixes which occur within the expression are preresolved. objects of this type are created by calling x
pathevaluator.createexpression(). methods x
pathexpression.evaluate() evaluates the x
path expression on the given node or document. example the following example shows the use of the x
pathexpression interface. ...
...application, because it is just compiled once and all namespace prefixes which occur within the expression are preresolved. objects of this type are created by calling x
pathevaluator.createexpression(). methods x
pathexpression.evaluate() evaluates the x
path expression on the given node or document. example the following example shows the use of the x
pathexpression interface. ...
... the expression are preresolved. objects of this type are created by calling x
pathevaluator.createexpression(). methods x
pathexpression.evaluate() evaluates the x
path expression on the given node or document. example the following example shows the use of the x
pathexpression interface. ...
...And 2 more matches
XPathResult.singleNodeValue - Web APIs
the read-only singlenodevalue property of the x
pathresult interface returns a node value or null in case no node was matched of a result with x
pathresult.resulttype being any_unordered_node_type or first_ordered_node_type. note: this feature is available in web workers. syntax var value = result.singlenodevalue; return value the return value is the node value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not any_unordered_node_type or first_ordered_node_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the singlenodevalue property. ...
... syntax var value = result.singlenodevalue; return value the return value is the node value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not any_unordered_node_type or first_ordered_node_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the singlenodevalue property. ...
...alue is the node value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not any_unordered_node_type or first_ordered_node_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the singlenodevalue property. ...
...And 2 more matches
<path> - SVG: Scalable Vector Graphics
the <
path> svg element is the generic element to define a shape. all the basic shapes can be created with a
path element. html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <
path d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z"/> </svg> attributes d this attribute defines the shape of the
path. value type: <string> ; default value: ''; animatable: yes
pathlength this attribute lets authors specify the total length for the
path, in user units. value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: require...
... length for the
path, in user units. ...
... recommendation initial definition ...
...And 2 more matches
Axes - XPath
ancestor indicates all the ancestors of the context node beginning with the parent node and traveling through to the root node. ...
... ancestor indicates all the ancestors of the context node beginning with the parent node and traveling through to the root node. ...
... ancestor indicates all the ancestors of the context node beginning with the parent node and traveling through to the root node. ...
...And 2 more matches
XPath - MDN Web Docs Glossary: Definitions of Web-related terms
x
path is a query language that can access sections and content in an xml document. ...
... x
path is a query language that can access sections and content in an xml document. ...
... x
path is a query language that can access sections and content in an xml document. ...
... x
path is a query language that can access sections and content in an xml document. ...
CanvasRenderingContext2D.closePath() - Web APIs
the canvasrenderingcontext2d.close
path() method of the canvas 2d api attempts to add a straight line from the current point to the start of the current sub-
path. if the shape has already been closed or has only one point, this function does nothing. this method doesn't draw anything to the canvas directly. you can render the
path using the stroke() or fill() methods. syntax void ctx.close
path(); examples closing a triangle this example creates the first two (diagonal) sides of a triangle using the lineto() method. after that, the triangle's base is created with the close
path() method, which automatically connects the shape's first and last points. html <canvas id="canvas"></canvas> javascript the triangle's corners are at (20, 150), (120, 20), and (220, 150). const canvas = docum...
...sides of a triangle using the lineto() method. after that, the triangle's base is created with the close
path() method, which automatically connects the shape's first and last points. html <canvas id="canvas"></canvas> javascript the triangle's corners are at (20, 150), (120, 20), and (220, 150). ...
...t points. html <canvas id="canvas"></canvas> javascript the triangle's corners are at (20, 150), (120, 20), and (220, 150). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.begin
path(); ctx.moveto(20, 140); // move pen to bottom-left corner ctx.lineto(120, 10); // line to top corner ctx.lineto(220, 140); // line to bottom-right corner ctx.close
path(); // line to bottom-left corner ctx.stroke(); result closing just one sub-
path this example draws a smiley face consisting of three disconnected sub-
paths. note: although close
path() is called after all the arcs have been created, only the last arc (sub-
path) gets closed. html <canvas id="canvas"></canvas> javascript the first two arcs create the face's eyes. the last arc cre...
...smiley face consisting of three disconnected sub-
paths. note: although close
path() is called after all the arcs have been created, only the last arc (sub-
path) gets closed. html <canvas id="canvas"></canvas> javascript the first two arcs create the face's eyes. the last arc creates the mouth. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.begin
path(); ctx.arc(240, 20, 40, 0, math.pi); ctx.moveto(100, 20); ctx.arc(60, 20, 40, 0, math.pi); ctx.moveto(215, 80); ctx.arc(150, 80, 65, 0, math.pi); ctx.close
path(); ctx.linewidth = 6; ctx.stroke(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.close
path' in that specification. living standard ...
Event.composedPath() - Web APIs
the composed
path() method of the event interface returns the event’s
path which is an array of the objects on which listeners will be invoked. this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. syntax var composed = event.composed
path(); parameters none. return value an array of eventtarget objects representing the objects on which an event listener will be invoked. examples in our composed-composed-
path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their mode...
... .appendchild(pelem); } }); we then insert one of each element into our page: <open-shadow text="i have an open shadow root"></open-shadow> <closed-shadow text="i have a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log(e.composed); console.log(e.composed
path()); }); when you click on the <open-shadow> element and then the <closed-shadow> element, you'll notice two things. first, the composed property returns true beause the click event is always able to propagate across shadow boundaries. second, you'll notice a difference in the value of composed
path for the two elements. the <open-shadow> element's composed
path is this: array [ p, shadowroot, op...
...otice two things. first, the composed property returns true beause the click event is always able to propagate across shadow boundaries. second, you'll notice a difference in the value of composed
path for the two elements. the <open-shadow> element's composed
path is this: array [ p, shadowroot, open-shadow, body, html, htmldocument https://mdn.github.io/web-components-examples/composed-composed-
path/, window ] whereas the <closed-shadow> element's composed
path is a follows: array [ closed-shadow, body, html, htmldocument https://mdn.github.io/web-components-examples/composed-composed-
path/, window ] in the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary. specifications specification ...
...
path is a follows: array [ closed-shadow, body, html, htmldocument https://mdn.github.io/web-components-examples/composed-composed-
path/, window ] in the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary. specifications specification status comment domthe definition of 'composed
path()' in that specification. living standard ...
FileSystemEntry.fullPath - Web APIs
the read-only full
path property of the filesystementry interface returns a usvstring specifying the full, absolute
path from the file system's root to the file represented by the entry. this can also be thought of as a
path which is relative to the root directory, with a "/" prepended to it to make it absolute. syntax var full
path = filesystementry.full
path; value a usvstring indicating the entry's full
path. example this example shows a function which is called with a file system; it then gets a filesystemfileentry for a file named data.json and returns its full
path. ...
...
path which is relative to the root directory, with a "/" prepended to it to make it absolute. syntax var full
path = filesystementry.full
path; value a usvstring indicating the entry's full
path. example this example shows a function which is called with a file system; it then gets a filesystemfileentry for a file named data.json and returns its full
path. function gotfilesystem(fs) { let
path = ""; fs.root.getfile("data.json", { create: true, exclusive: true }, function(entry) {
path = full
path; }, handleerror(error)); return
path; } obviously, this is somewhat contrived, since we know that the file's full
path is "/data.json", having just looked it up ourselves, but the concept holds up for scenarios in which you don't know it. specifications specification ...
... draft initial specification. this api has no official w3c or whatwg specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...pecification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
Path2D() - Web APIs
the
path2d() constructor returns a newly instantiated
path2d object, optionally with another
path as an argument (creates a copy), or optionally with a string consisting of svg
path data. syntax new
path2d(); new
path2d(
path); new
path2d(d); parameters
path optional when invoked with another
path2d object, a copy of the
path argument is created. d optional when invoked with a string consisting of svg
path data, a new
path is created from that description. examples creating and copying
paths this example creates and copies a
path2d
path. ...
...d with another
path2d object, a copy of the
path argument is created. d optional when invoked with a string consisting of svg
path data, a new
path is created from that description. examples creating and copying
paths this example creates and copies a
path2d
path. <canvas id="canvas"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let
path1 = new
path2d();
path1.rect(10, 10, 100,100); let
path2 = new
path2d(
path1);
path2.moveto(220, 60);
path2.arc(170, 60, 50, 0, 2 * math.pi); ctx.stroke(
path2); using svg
paths this example creates a
path2d
path using svg
path data. ...
... and copies a
path2d
path. <canvas id="canvas"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let
path1 = new
path2d();
path1.rect(10, 10, 100,100); let
path2 = new
path2d(
path1);
path2.moveto(220, 60);
path2.arc(170, 60, 50, 0, 2 * math.pi); ctx.stroke(
path2); using svg
paths this example creates a
path2d
path using svg
path data. the
path will move to point (m10 10) and then move horizontally 80 points to the right (h 80), then 80 points down (v 80), then 80 points to the left (h -80), and then back to the start (z). ...
... using svg
paths this example creates a
path2d
path using svg
path data. the
path will move to point (m10 10) and then move horizontally 80 points to the right (h 80), then 80 points down (v 80), then 80 points to the left (h -80), and then back to the start (z). <canvas id="canvas"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let p = new
path2d('m10 10 h 80 v 80 h -80 z'); ctx.fill(p); specification specification status comment html living standardthe definition of '
path2d()' in that specification. living standard initial definition. ...
XPathResult.booleanValue - Web APIs
the read-only booleanvalue property of the x
pathresult interface returns the boolean value of a result with x
pathresult.resulttype being boolean_type. note: this feature is available in web workers. syntax var value = result.booleanvalue; return value the return value is the boolean value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not boolean_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the booleanvalue property. ...
...this feature is available in web workers. syntax var value = result.booleanvalue; return value the return value is the boolean value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not boolean_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the booleanvalue property. ...
... workers. syntax var value = result.booleanvalue; return value the return value is the boolean value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not boolean_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the booleanvalue property. ...
...turn value the return value is the boolean value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not boolean_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the booleanvalue property. html <div>x
path example</div> <p>text is 'x
path example': <output></output></p> javascript var x
path = "//div/text() = 'x
path example'"; var result = document.evaluate(x
path, document, null, x
pathresult.boolean_type, null); document.queryselector("output").textcontent = result.booleanvalue; result specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathresult.booleanvalue' in that specification. r...
CSS Motion Path - CSS: Cascading Style Sheets
motion
path is a css module that allows authors to animate any graphical object along a custom
path. the idea is that when you want to animate an element moving along a
path, you previously only had animating translation, position, etc. at your disposal, which wasn't ideal and only allowed for simple movements. with offset-
path you can define a specific
path of any shape you want. you then animate it along that
path by animating offset-distance, and can choose to rotate it at any point using offset-rotate. ...
...iously only had animating translation, position, etc. at your disposal, which wasn't ideal and only allowed for simple movements. with offset-
path you can define a specific
path of any shape you want. you then animate it along that
path by animating offset-distance, and can choose to rotate it at any point using offset-rotate. ...
... only had animating translation, position, etc. at your disposal, which wasn't ideal and only allowed for simple movements. with offset-
path you can define a specific
path of any shape you want. you then animate it along that
path by animating offset-distance, and can choose to rotate it at any point using offset-rotate. ...
.... basic example <div id="motion-demo"></div> #motion-demo { offset-
path:
path('m20,20 c20,100 200,0 200,100'); animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } reference properties offset offset-anchor offset-distance offset-
path offset-position offset-rotate specifications specification status comment motion
path module level 1 working draft initial definition. ...
Critical rendering path - Web Performance
the critical rendering
path is the sequence of steps the browser goes through to convert the html, css, and javascript into pixels on the screen. optimizing the critical render
path improves render performance.the critical rendering
path includes the document object model (dom), css object model (cssom), render tree and layout. the document object model is created as the html is parsed. the html may request javascript, which may, in turn, alter the dom. the html includes or makes requests for styles, which in turn builds the css object model. the browser engine combines the two to create the render tree. layout determines the size and location of everything on the page. once layout is determined, pixels are painted to the screen. ...
...tml is parsed. the html may request javascript, which may, in turn, alter the dom. the html includes or makes requests for styles, which in turn builds the css object model. the browser engine combines the two to create the render tree. layout determines the size and location of everything on the page. once layout is determined, pixels are painted to the screen. optimizing the critical rendering
path improves the time to first render. understanding and optimizing the critical rendering
path is important to ensure reflows and repaints can happen at 60 frames per second, to ensure performant user interactions and avoid jank. understanding crp web performance includes the server requests and responses, loading, scripting, rendering, layout, and the painting of the pixels to the screen. a requ...
...tion about the html element. the information is described using tokens. nodes are connected into a dom tree based on token hierarchy. if another set of starttag and endtag tokens come between a set of starttag and endtags, you have a node inside a node, which is how we define the hierarchy of the dom tree. the greater the number of nodes, the longer the following events in the critical rendering
path will take. measure! a few extra nodes won't make a difference, but divitis can lead to jank. css object model the dom contains all the content of the page. the cssom contains all the styles of the page; information on how to style that dom. cssom is similar to the dom, but different. while the dom construction is incremental, cssom is not. css is render blocking: the browser blocks page renderi...
...f those resources. performance tips include 1) minimizing the number of critical resources by deferring their download, marking them as async, or eliminating them altogether, 2) optimizing the number of requests required along with the file size of each request, and 3) optimizing the order in which critical resources are loaded by prioritizing the downloading critical assets, shorten the critical
path length. ...
key - XPath
defined xslt 1.0 12.2 gecko support supported. ...
... defined xslt 1.0 12.2 gecko support supported. ...
... defined xslt 1.0 12.2 gecko support supported. ...
...key. syntax key(keyname ,value ) arguments keyname a string containing the name of the xsl:key element to be used. value the returned node-set will contain every node that has this value for the given key. returns a node set. notes the xsl:key element defines what attribute on what given elements will be used to match the key. this function is an xslt-specific addition to x
path. it is not a part of the core x
path function library. defined xslt 1.0 12.2 gecko support supported. ...
PR_GetLibraryPath
if sufficient storage cannot be allocated to contain the copy, the function returns null. storage for the result is allocated by the runtime and becomes the responsibility of the caller. ...
...if sufficient storage cannot be allocated to contain the copy, the function returns null. storage for the result is allocated by the runtime and becomes the responsibility of the caller. ...
...if sufficient storage cannot be allocated to contain the copy, the function returns null. storage for the result is allocated by the runtime and becomes the responsibility of the caller. ...
SVGMPathElement - Web APIs
the svgm
pathelement interface corresponds to the <m
path> element. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2...
...naco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgelement</text></a><polyline points="481,25 491,20 491,30 481,25" stroke="#d4dde4" fill="none"/><line x1="491" y1="25" x2="499" y2="25" stroke="#d4dde4"/><line x1="499" y1="25" x2="499" y2="90" stroke="#d4dde4"/><line x1="499" y1="90" x2="482" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svgm
pathelement" target="_top"><rect x="331" y="65" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgm
pathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interf...
...ointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. specifications specification status comment svg animations level 2the definition of 'svgm
pathelement' in that specification. editor's draft removed the implemented interface svgexternalresourcesrequired. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgm
pathelement' in that specification. recommendation initial definition ...
XPathResult.numberValue - Web APIs
the read-only numbervalue property of the x
pathresult interface returns the numeric value of a result with x
pathresult.resulttype being number_type. note: this feature is available in web workers. syntax var value = result.numbervalue; return value the return value is the numeric value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not number_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the numbervalue property. ...
...e: this feature is available in web workers. syntax var value = result.numbervalue; return value the return value is the numeric value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not number_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the numbervalue property. ...
...urn value the return value is the numeric value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not number_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the numbervalue property. html <div>x
path example</div> <div>number of <div>s: <output></output></div> javascript var x
path = "count(//div)"; var result = document.evaluate(x
path, document, null, x
pathresult.number_type, null); document.queryselector("output").textcontent = result.numbervalue; result specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathresult.numbervalue' in that specification. recommendation init...
XPathResult.snapshotLength - Web APIs
the read-only snapshotlength property of the x
pathresult interface represents the number of nodes in the result snapshot. note: this feature is available in web workers. syntax var snapshotlength = result.snapshotlength; return value an integer value representing the number of nodes in the result snapshot. exceptions type_err in case x
pathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the snapshotlength property. ...
...syntax var snapshotlength = result.snapshotlength; return value an integer value representing the number of nodes in the result snapshot. exceptions type_err in case x
pathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the snapshotlength property. ...
...nting the number of nodes in the result snapshot. exceptions type_err in case x
pathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the snapshotlength property. html <div>x
path example</div> <div>number of matched nodes: <output></output></div> javascript var x
path = "//div"; var result = document.evaluate(x
path, document, null, x
pathresult.ordered_node_snapshot_type, null); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathresult.snapshotlength' in that specification. recommen...
XPathResult.stringValue - Web APIs
the read-only stringvalue property of the x
pathresult interface returns the string value of a result with x
pathresult.resulttype being string_type. note: this feature is available in web workers. syntax var value = result.stringvalue; return value the return value is the string value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not string_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the stringvalue property. ...
...te: this feature is available in web workers. syntax var value = result.stringvalue; return value the return value is the string value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not string_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the stringvalue property. ...
... return value is the string value of the x
pathresult returned by document.evaluate(). exceptions type_err in case x
pathresult.resulttype is not string_type, an x
pathexception of type type_err is thrown. example the following example shows the use of the stringvalue property. html <div>x
path example</div> <div>text content of the <div> above: <output></output></div> javascript var x
path = "//div/text()"; var result = document.evaluate(x
path, document, null, x
pathresult.string_type, null); document.queryselector("output").textcontent = result.stringvalue; result specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathresult.stringvalue' in that specification. recommendation init...
position - XPath
<xsl:template match="//a[position() = 5]"> <!-- this template matches the fifth a element anywhere in the document. ...
...nctions, x
path axes the position function returns a number equal to the context position from the expression evaluation context. syntax position() returns an integer equal to the context position from the expression evaluation context. notes note that a node's position in a context is not zero-based. the first node has a position of 1. the context is determined by the rest of the
path. <xsl:template match="//a[position() = 5]"> <!-- this template matches the fifth a element anywhere in the document. ...
...ed by the rest of the
path. <xsl:template match="//a[position() = 5]"> <!-- this template matches the fifth a element anywhere in the document. --> </xsl:template> <xsl:template match="//div[@class='foo']/bar[position() = 1]"> <!-- this template matches the first bar element that is a child of a div element with a class attribute equal to "foo" --> </xsl:template> defined x
path 1.0 4.1 gecko support supported. ...
XPath - Archive of obsolete content
notes and sample code for x
path and ajax (the following was moved from document.evaluate) obj.evaluate(x
pathexpression,contextnode,namespaceresolver,resulttype,result); //obj and contextnode should be the same object, if context is a ajax xml object (example: returnedxml) this should be used as : returnedxml.evaluate(x
pathexpression,returnedxml,namespaceresolver,returntype,result); //contextnode should be used in the one in which it was created //add by mooring 2008-11-15 16:00 china var xhr = new ajax('post','demo.xml',parsexml,'xml'); //ajax is a class written by javascript which return responsexml object to parsexml function function parsexml(obj)//obj is the returnxml object now { if(!obj.documentelement) { alert("your browser does't support this script!"); return;...
...l object now { if(!obj.documentelement) { alert("your browser does't support this script!"); return; } var fields = [];//store the results if(window.activexobject) { var tobj = obj.documentelement.selectnodes("/root/field/item"); for(var i=0;i<tobj.length; i++) { fields.push(tobj[i].text); } } else { var tobj = obj.evaluate("/root/field/item",obj.documentelement,null, x
pathresult.any_type, null); var tmp = tobj.iteratenext(); while(tmp) { fields.push(tmp.textcontent); tmp = tobj.iteratenext(); } } alert(fields); } //here is the demo xml file for x
path <?xml version="1.0"?> <root> <field> <item>art_id</item> <item>psection</item> <item>qkind</item> <item>qtitle</item> <item>question</item> <item>pic</item> <item>answer1</item> <...
CanvasRenderingContext2D.beginPath() - Web APIs
the canvasrenderingcontext2d.begin
path() method of the canvas 2d api starts a new
path by emptying the list of sub-
paths. call this method when you want to create a new
path. note: to create a new sub-
path, i.e., one matching the current canvas state, you can use canvasrenderingcontext2d.moveto(). syntax void ctx.begin
path(); examples creating distinct
paths this example creates two
paths, each of which contains a single line. html <canvas id="canvas"></canvas> javascript the begin
path() method is called before beginning each line, so that they may be drawn with different colors. ...
.... syntax void ctx.begin
path(); examples creating distinct
paths this example creates two
paths, each of which contains a single line. html <canvas id="canvas"></canvas> javascript the begin
path() method is called before beginning each line, so that they may be drawn with different colors. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // first
path ctx.begin
path(); ctx.strokestyle = 'blue'; ctx.moveto(20, 20); ctx.lineto(200, 20); ctx.stroke(); // second
path ctx.begin
path(); ctx.strokestyle = 'green'; ctx.moveto(20, 20); ctx.lineto(120, 120); ctx.stroke(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.begin
path' in that specification. liv...
XPathEvaluator.createNSResolver() - Web APIs
this method adapts any dom node to resolve namespaces so that an x
path expression can be easily evaluated relative to the context of the node where it appeared within the document. this adapter works like the dom level 3 method node.lookupnamespaceuri() in resolving the namespace uri from a given prefix using the current information available in the node's hierarchy at the time the method is called, also correctly resolving the implicit xml prefix. syntax x
pathnsresolver x
pathevaluator.creatensresolver(noderesolver); parameters noderesolver a node to be used as a context for namespace resolution. return value an x
pathnsresolver object which resolves namespaces with respect to the definitions in scope for a specified node. specifications specification status commen...
...x. syntax x
pathnsresolver x
pathevaluator.creatensresolver(noderesolver); parameters noderesolver a node to be used as a context for namespace resolution. return value an x
pathnsresolver object which resolves namespaces with respect to the definitions in scope for a specified node. specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathevaluator.creatensresolver()' in that specification. recommendation initial definition ...
XPathException - Web APIs
in the dom x
path api the x
pathexception interface represents exception conditions that can be encountered while performing x
path operations. properties x
pathexception.code read only returns a short that contains one of the error code constants. constants constant value description invalid_expression_err 51 if the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific x
pathevaluator or contains specialized extension functions or variables not supported by this implementation. type_err 52 if the expression cannot be converted to return the specified type. ...
...ror or otherwise is not a legal expression according to the rules of the specific x
pathevaluator or contains specialized extension functions or variables not supported by this implementation. type_err 52 if the expression cannot be converted to return the specified type. specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathexception' in that specification. recommendation initial definition ...
<hatchpath> - SVG: Scalable Vector Graphics
the <hatch
path> svg element defines a hatch
path used by the <hatch> element. usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elements<script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes d offset dom interface this element implements the svghatch
pathelement interface. ...
...global attributes core attributes global event attributes presentation attributes style attributes specific attributes d offset dom interface this element implements the svghatch
pathelement interface. ...
boolean - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the boolean function evaluates an expression and returns true or false. syntax boolean( expression ) arguments expression the expression to be evaluated. the expression can refer to numbers and node-sets as well as booleans. returns boolean true or false after evaluating expression. notes a number evaluates to false if it is positive or negative zero or nan. otherwise, it evaluates true. a node-set evaluates to true if it is non-empty. a string evaluates to false if it an empty string. otherwise, it evaluates to true. an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type. ...
...uating expression. notes a number evaluates to false if it is positive or negative zero or nan. otherwise, it evaluates true. a node-set evaluates to true if it is non-empty. a string evaluates to false if it an empty string. otherwise, it evaluates to true. an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type. defined x
path 1.0 4.3 gecko support supported. ...
current - XPath
for an outermost expression (an expression not occurring within another expression), the current node is always the same as the context node (which will be returned by the . or self syntax). the following two are symantically equivalent. <xsl:value-of select="current()"/> <xsl:value-of select="."/> in an inner expression (e.g. ...
... for an outermost expression (an expression not occurring within another expression), the current node is always the same as the context node (which will be returned by the . or self syntax). the following two are symantically equivalent. <xsl:value-of select="current()"/> <xsl:value-of select="."/> in an inner expression (e.g. ...
document - XPath
syntax document(uri [,node-set] ) arguments uri an absolute or relative uri of the document to be retrieved. the uri may also include a fragment identifier. node-set (optional) an expression pointing to a node-set in the external document that should be returned. returns a node-set. notes if the uri contains a fragment identifier and that fragment can be identified in the external document, that fragment will be treated as the root in the node-set argument's expression. ...
...me second argument just as given in the function call) and the resulting node-sets had been concatenated into a single node-set. other specific conditions exist with specified behaviors. see the xslt 1.0 documentation for details. since the uri is relative to the xsl document, document("") would return the root node of the current document. this function is an xslt-specific addition to x
path. it is not a part of the core x
path function library. defined xslt 1.0 12.1 gecko support supported. ...
format-number - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the format-number function evaluates a number and returns a string representing the number in a given format. syntax format-number(number ,pattern [,decimal-format] ) arguments number the number to be formatted pattern a string in the format of the jdk 1.1 decimalformat class. (the documentation for jdk 1.1 is not available online. here is the java se 6 decimalformat.) decimal-format (optional) the name of an xsl:decimal-format element that defines the number format to be used. if omitted, the default decimal-format will be used. returns a string representing the number in the new format. notes this function is an xslt-specific addition to x
path. it is not a part of the co...
... for jdk 1.1 is not available online. here is the java se 6 decimalformat.) decimal-format (optional) the name of an xsl:decimal-format element that defines the number format to be used. if omitted, the default decimal-format will be used. returns a string representing the number in the new format. notes this function is an xslt-specific addition to x
path. it is not a part of the core x
path function library. defined xslt 1.0 12.3 gecko support supported. ...
id - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the id function finds nodes matching the given ids and returns a node-set containing the identified nodes. syntax id(expression ) arguments expression if expression is a node-set, then the string value of each node in the node-set is treated as an individual id. the returned node set is the nodes corresponding to those ids. if expression is a string, or anything other than a node-set, then expression is treated as a space-separated list of ids. the returned node set is the nodes corresponding to those ids. returns a node-set containing the node or nodes identified by the given id or ids. notes the dtd of the xml document determines what attribute is an id. ...
...set is the nodes corresponding to those ids. if expression is a string, or anything other than a node-set, then expression is treated as a space-separated list of ids. the returned node set is the nodes corresponding to those ids. returns a node-set containing the node or nodes identified by the given id or ids. notes the dtd of the xml document determines what attribute is an id. see x
path 1.0 5.2.1 defined x
path 1.0 4.1 gecko support partially supported. ...
lang - XPath
syntax lang(string ) arguments string the language code or localization (language and country) code to be matched. returns true if the context node matches the given languages. otherwise, false. notes a node's language is determined by its xml:lang attribute. if the current node does not have an xml:lang attribute, then the value of the xml:lang attribute of the nearest ancestor that has an xml:lang attribute will determine the current node's language. ...
... ...
not - XPath
syntax not(expression ) arguments expression the expression is evaluated exactly as if it were passed as an argument to the boolean() function. returns true for an expression that evaluates to false; false for an expression that evaluates to true. notes this function should behave similarly to the boolean() function except that it returns the opposite value. you can test if an element doesn't have some attribute. ...
... ...
number - XPath
syntax number( [object] ) arguments object(optional) the object to be converted to a number. if this argument is omitted, the current context node will be used. returns the resulting number after converting the object. notes strings are converted to a number by stripping the leading whitespace in the string before the number and ignoring whitespace after the number. if the string does not match this pattern, then the string is converted to nan. boolean true is converted to 1. false is converted to 0. ...
...ing does not match this pattern, then the string is converted to nan. boolean true is converted to 1. false is converted to 0. a node-set is first converted to a string as if by a call to the string() function and then converted in the same way as a string argument. an object of a type other than the four basic types is converted to a number in a way that is dependent on that type. defined x
path 1.0 4.4 gecko support supported. ...
string - XPath
syntax string( [object] ) arguments object(optional) the object to convert to a string. if omitted, the context node is used. returns a string notes if the object is a node-set, the string value of the first node in the set is returned. a number is converted as follows: nan is converted to the string nan. positive zero is converted to the string 0. negative zero is converted to the string 0. positive infinity is converted to the string infinity. negative infinity is converted to the string -infinity. ...
...ing 0. negative zero is converted to the string 0. positive infinity is converted to the string infinity. negative infinity is converted to the string -infinity. decimal numbers between -1 and 1 are converted to a string with a single leading 0 before the decimal point. boolean true is converted to the string true. boolean false is converted to the string false. defined x
path 1.0 4.2 gecko support supported. ...
translate - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the translate function evaluates a string and a set of characters to translate and returns the translated string. syntax translate(string, abc, xyz) arguments string the string to evaluate. abc the string of characters that will be replaced. xyz the string of characters used for replacement. the first character in xyz will replace every occurrence of the first character in abc that appears in string. returns the translated string. notes x
path notes that the translate function is not a sufficient solution for case conversion in all languages. a future version of x
path may provide additional functions for case conversion. however, this is the closest we have at present to a ...
...nopqrstuvwxyz')" /> output the quick brown fox. if abc is longer than xyz, then every occurrence of characters in abc that do not have a corresponding character in xyz will be removed. example <xsl:value-of select="translate('the quick brown fox.', 'brown', 'red')" /> output the quick red fdx. if xyz contains more characters than abc, the extra characters are ignored. defined x
path 1.0 4.2 gecko support supported. ...
fs/path - Archive of obsolete content
experimental provides access to the local filesystem with the nodejs
path module api. usage this module attempts to implement the nodejs
path module api. please refer the nodejs
path module api documentation for this module. ...
PR_SetLibraryPath
registers a default library
pathname with a runtime. syntax #include <prlink.h> prstatus pr_setlibrary
path(const char *
path); parameters the function has this parameter:
path a pointer to a character array that contains the directory
path that the application should use as a default. the syntax of the
pathname is not defined, nor whether that
pathname should be absolute or relative. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may indicate that the function cannot allocate sufficient storage to make a copy of the
path string description this function registers a default library
pathname with the runtime. this allows an environment to express policy decisions globally and lazily, rather than hardcodin...
File.mozFullPath - Web APIs
a privileged exension to the file interface, the mozfull
path property contains the full
pathname of the represented file. this property is only available from within browser code or old-style xpcom-based firefox extensions. it is not available to web content. ...
HTMLHyperlinkElementUtils.pathname - Web APIs
the htmlhyperlinkelementutils.
pathname property is a usvstring containing an initial '/' followed by the
path of the url (or the empty string if there is no
path). syntax string = object.
pathname; object.
pathname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.
pathname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.
pathname; // returns:'/docs/htmlhyperlinkelementutils.
pathname' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.
pathname' in that specification. living standard initial definition. ...
SVGGeometryElement.pathLength - Web APIs
the svggeometryelement.
pathlength property reflects the
pathlength attribute and returns the total length of the
path, in user units. note: this property was originally part of the svg
pathelement interface. svg 2 introduced the svggeometryelement interface and moved the property to it. syntax var
pathlength = someelement.
pathlength; specifications specification status comment scalable vector graphics (svg) 2the definition of 'svggeometryelement.
pathlength' in that specification. candidate recommendation initial definition ...
SVGPathElement.getPointAtLength() - Web APIs
the svg
pathelement.getpointatlength() method returns the point at a given distance along the
path. note: in svg 2 this property was moved to the svggeometryelement interface, from which the svg
pathelement inherits it. syntax svgpoint someelement.getpointatlength(float distance); parameters distance a float referring to the distance along the
path. return value an svgpoint indicating the point at a given distance along the
path. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'svg
pathelement.gettotallength()' in that specification. recommendation initial definition ...
SVGPathElement.getTotalLength() - Web APIs
the svg
pathelement.gettotallength() method returns the user agent's computed value for the total length of the
path in user units. note: in svg 2 this method was moved to the svggeometryelement interface, from which the svg
pathelement inherits it. syntax float someelement.gettotallength(); return value a float indicating the total length of the
path in user units. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'svg
pathelement.gettotallength()' in that specification. recommendation initial definition ...
XPathException.code - Web APIs
the code read-only property of the x
pathexception interface returns a short that contains one of the error code constants. syntax var exceptioncode = exception.code; value a short number representing the error code. specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathexception' in that specification. recommendation initial definition ...
XPathNSResolver.lookupNamespaceURI() - Web APIs
the lookupnamespaceuri method looks up the namespace uri associated to the given namespace prefix within an x
path expression evaluated by the x
pathevaluator interface. syntax domstring x
pathnsresolver.lookupnamespaceuri(prefix); parameters prefix a domstring representing the prefix to look for. return value a domstring representing the associated namespace uri or null if none is found. specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathnsresolver.lookupnamespaceuri()' in that specification. recommendation initial definition ...
XPathNSResolver - Web APIs
the x
pathnsresolver interface permits prefix strings in an x
path expression to be properly bound to namespace uri strings. the x
pathevaluator interface can construct an implementation of x
pathnsresolver from a node, or the interface may be implemented by any application. methods x
pathnsresolver.lookupnamespaceuri() looks up the namespace uri associated to the given namespace prefix. specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'x
pathnsresolver' in that specification. recommendation initial definition ...
child - XPath
the child axis indicates the children of the context node. if an x
path expression does not specify an axis, the child axis is understood by default. since only the root node or element nodes have children, any other use will select nothing. specifications specification status comment x
path 3.1the definition of 'child' in that specification. recommendation x
path 3.0the definition of 'child' in that specification. recommendation x
path 2.0the definition of 'child' in that specification. recommendation x
path 1.0the definition of 'child' in that specification. recommendation initial definition. ...
self - XPath
the self axis indicates the context node itself. it can be abbreviated as a single period (.). specifications specification status comment x
path 3.1the definition of 'self' in that specification. recommendation x
path 3.0the definition of 'self' in that specification. recommendation x
path 2.0the definition of 'self' in that specification. recommendation x
path 1.0the definition of 'self' in that specification. recommendation initial definition. ...
ceiling - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the ceiling function evaluates a decimal number and returns the smallest integer greater than or equal to the decimal number. syntax ceiling(number ) arguments number the number to be evaluated. returns the nearest integer greater than or equal to number. for example: ceiling (5.2) = 6 ceiling (-5.2) = -5 defined x
path 1.0 4.4 gecko support supported. ...
choose - XPath
note: this method should be used instead of if(), which has been deprecated. syntax choose( boolean , object1, object2 ) arguments boolean the boolean operation to use when determining which object to return. object1 the first object to consider returning. object2 the second object to consider returning. returns if the boolean parameter is true, the first object is returned; otherwise, the second object is returned. note: all parameters are evaluated, even the one that's not returned. defined xforms 1.1 gecko support supported. ...
concat - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the concat function concatenates two or more strings and returns the resulting string. syntax concat(string1 ,string2 [,stringn]* ) arguments stringn this function accepts two or more arguments. each of these arguments is a string. returns a single string that is the concatenation of all the strings passed to the function as arguments. defined x
path 1.0 4.2 gecko support supported. ...
contains - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the contains function determines whether the first argument string contains the second argument string and returns boolean true or false. syntax contains(haystack, needle) arguments haystack the string to be searched needle the string to look for as a substring of haystack returns true if haystack contains needle. otherwise, false. defined x
path 1.0 4.2 gecko support supported. ...
count - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the count function counts the number of nodes in a node-set and returns an integer. syntax count(node-set ) arguments node-set the node set to be counted. returns an integer representing the number of nodes in a node-set. defined x
path 1.0 4.1 gecko support supported. ...
element-available - XPath
syntax element-available(qname ) arguments qname must evaluate to a valid qname. the qname is expanded into an expanded-name using the namespace declarations in scope for the expression. returns returns true if and only if the expanded-name is the name of an instruction. if the expanded-name has a namespace uri equal to the xslt namespace uri, then it refers to an element defined by xslt. otherwise, it refers to an extension element. if the expanded-name has a null namespace uri, the element-available function will return false. ...
false - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the false function returns boolean false. syntax false() returns boolean false. notes this function is useful part of a comparison: <xsl:if test="boolean((1 > 2) = false())"> the expression evaluates as true </xsl:if> defined x
path 1.0 4.3 gecko support supported. ...
floor - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the floor function evaluates a decimal number and returns the largest integer less than or equal to the decimal number. syntax floor( number ) arguments number the decimal number to be evaluated. returns the nearest integer less than or equal to number. defined x
path 1.0 4.4 gecko support supported. ...
function-available - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the function-available function determines if a given function is available and returns boolean true or false. syntax function-available(name ) arguments name the name of the function to test. returns boolean true or false. defined x
path 1.0 15 gecko support supported. ...
generate-id - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the generate-id function generates a unique id for the first node in a given node-set and returns a string containing that id. syntax generate-id( [node-set] ) arguments node-set (optional) an id will be generated for the first node in this node-set. if omitted, the current context node will be used. returns a string containing the generated id. notes the same id must be generated every time for the same node in the current document in the current transformation. the generated id may not be the same in subsequent transformations. this function is an xslt-specific addition to x
path. it is not a part of the core x
path function library. defined xslt 1.0 12.4 gecko support su...
last - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the last function returns a number equal to the context size from the expression evaluation context. syntax last() returns an integer equal to the context size from the expression evaluation context. notes this is often used with the position() function to determine if a particular node is the last in a node-set. defined x
path 1.0 4.1 gecko support supported. ...
local-name - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the local-name function returns a string representing the local name of the first node in a given node-set. syntax local-name( [node-set] ) arguments node-set (optional) the local name of the first node in this node-set will be returned. if this argument is omitted, the current context node will be used. returns a string. notes the local name is the local part of an expanded-name. defined x
path 1.0 4.1 gecko support supported. ...
name - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the name function returns a string representing the qname of the first node in a given node-set. syntax name( [node-set] ) arguments node-set (optional) the qname of the first node in this node-set will be returned. if this argument is omitted, the current context node will be used. returns a string representing the qname of a node. notes the qname is the node's qualified name, including its namespace prefix and its local name. defined x
path 1.0 4.1 gecko support supported. ...
namespace-uri - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the namespace-uri function returns a string representing the namespace uri of the first node in a given node-set. syntax namespace-uri( [node-set] ) arguments node-set (optional) the namespace uri of the first node in this node-set will be returned. if this argument is omitted, the current context node will be used. returns a string representing uri of the namespace in which the given node resides. notes if the given node does not have a specified namespace, the returned string will be an empty string. for nodes other than element and attribute nodes, the returned string will always be an empty string. defined x
path 1.0 4.1 gecko support supported. ...
normalize-space - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the normalize-space function strips leading and trailing white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string. syntax normalize-space( [string] ) arguments string (optional) the string to be normalized. if omitted, string used will be the same as the context node converted to a string. returns the normalized string. defined x
path 1.0 4.2 gecko support supported. ...
round - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the round function returns a number that is the nearest integer to the given number. syntax round(decimal ) arguments decimal the decimal number to be rounded. returns the nearest integer less then, greater than, or equal todecimal. notes -0.5 rounds to negative zero. 0.4 rounds to postive zero. defined x
path 1.0 4.4 gecko support supported. ...
starts-with - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the starts-with checks whether the first string starts with the second string and returns true or false. syntax starts-with(haystack, needle) arguments haystack the string to look in. needle the string to look for. returns true if haystack starts with needle. otherwise, false. defined x
path 1.0 4.2 gecko support supported. ...
string-length - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the string-length function returns a number equal to the number of characters in a given string. syntax string-length( [string] ) arguments string(optional) the string to evaluate. if omitted, string used will be the same as the context node converted to a string. returns an integer equal to the number of characters in the string. defined x
path 1.0 4.2 gecko support supported. ...
substring-after - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the substring-after function returns a string that is the rest of a given string after a given substring. syntax substring-after(haystack ,needle ) arguments haystack the string to be evaluated. part of this string will be returned. needle the substring to search for. everything after the first occurrence ofneedle inhaystack will be returned. returns a string. examples x
path example output substring-after('aa-bb','-') bb substring-after('aa-bb','a') a-bb substring-after('aa-bb','b') b substring-after('aa-bb','q') (empty string) defined x
path 1.0 4.2 gecko support supported. ...
substring-before - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the substring-before function returns a string that is the part of a given string before a given substring. syntax substring-before(haystack ,needle ) arguments haystack the string to be evaluated. part of this string will be returned. needle the substring to search for. everything before the first occurrence ofneedle inhaystack will be returned. returns a string. examples x
path example output substring-before('aa-bb','-') aa substring-before('aa-bb','a') (empty string) substring-before('aa-bb','b') aa- substring-before('aa-bb','q') (empty string) defined x
path 1.0 4.2 gecko support supported. ...
substring - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the substring function returns a part of a given string. syntax substring(string ,start [,length] ) arguments string the string to evaluate. start the position withinstring the substring begins length(optional) the length of the substring. if omitted, the returned string will contain every character from thestart position to the end ofstring. returns a string. notes as in other x
path functions, the position is not zero-based. the first character in the string has a position of 1, not 0. defined x
path 1.0 4.2 gecko support supported. ...
sum - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the sum function returns a number that is the sum of the numeric values of each node in a given node-set. syntax sum(node-set ) arguments node-set the node-set to be evaluated. each node in this node-set is evaluated as if it were passed to the number() function, and a sum of the resulting numbers is returned. returns a number. notes (none) defined x
path 1.0 4.3 gecko support supported. ...
system-property - XPath
syntax system-property(name) arguments name (optional) the name of the system property. the argument must evaluate to a string that is a qname. the qname is expanded into a name using the namespace declarations in scope for the expression. the system-property function returns an object representing the value of the system property identified by the name. if there is no such system property, the empty string should be returned. returns an object representing the given system-property. ...
true - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the true function returns a boolean value of true. syntax true() returns boolean true. defined x
path 1.0 4.3 gecko support supported. ...
unparsed-entity-url - XPath
this is non-xml data referenced in the dtd of the source document. syntax string unparsed-entity-url(string) arguments the name of the unparsed entity. if the argument is not a string, it is converted using the rules of the string() function. the name should be an xml name. returns the uri of the unparsed entity retrieved from the dtd, if it exists. otherwise an empty string. defined xslt 1.0 12.4 gecko support not supported. ...
Functions - XPath
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes the following is an annotated list of core x
path functions and xslt-specific additions to x
path, including a description, syntax, a list of arguments, result-type, source in the appropriate w3c recommendation, and degree of present gecko support. for further information on using x
path/xslt functions, please see the for further reading page. boolean() ceiling() choose() concat() contains() count() current() xslt-specific document() xslt-specific element-available() false() floor() format-number() xslt-specific function-available() generate-id() xslt-specific id() (partially supported) key() xslt-specific lang() last() local-name() name() namespace-uri() normalize-space() not(...
OS.File for the main thread
the following variant does the same thing but will fail if "file.txt" already exists: let encoder = new textencoder(); // this encoder can be reused for several writes let array = encoder.encode("this is some text"); // convert the text to an array let promise = ...
... these examples require firefox 19 or a more recent version. example: rename a file you have to use os.file.move to rename a file: let promise = os.file.move("oldname.txt", "newname.txt", {nooverwrite:true}); here's a working example which renames test.txt to testrenamed.txt if the file is located in directory...
... // buffer "file.txt.tmp". these examples require firefox 19 or a more recent version. ...
...And 58 more matches
Drawing shapes with canvas - Web APIs
« previousnext » now that we have set up our canvas environment, we can get into the details of how to draw on the canvas. by the end of this article, you will have learned how to draw rectangles, triangles, lines, arcs and curves, providing familiarity with some of the basic shapes. working with
paths is essential when drawing objects onto the canvas and we will see how that can be done. the grid before we can start drawing, we need to talk about the canvas grid or coordinate space. our html skeleton from the previous page had a canvas element 150 pixels wide and 150 pixels high. to the right, you see this canvas with the default grid overlayed. normally 1 unit in the grid corresponds to 1 pixel on the canvas. the origin of this grid is positioned in the top left corner...
...gin. so the position of the top left corner of the blue square becomes x pixels from the left and y pixels from the top, at coordinate (x,y). later in this tutorial we'll see how we can translate the origin to a different position, rotate the grid and even scale it, but for now we'll stick to the default. drawing rectangles unlike svg, <canvas> only supports two primitive shapes: rectangles and
paths (lists of points connected by lines). all other shapes must be created by combining one or more
paths. luckily, we have an assortment of
path drawing functions which make it possible to compose very complex shapes. first let's look at the rectangle. there are three functions that draw rectangles on the canvas: fillrect(x, y, width, height) draws a filled rectangle. strokerect(x, y, width, ...
...on draws a large black square 100 pixels on each side. the clearrect() function then erases a 60x60 pixel square from the center, and then strokerect() is called to create a rectangular outline 50x50 pixels within the cleared square. in upcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke style of the rendered shapes. ...
...And 38 more matches
nsIFile
representation of a location in the filesystem. inherits from: nsisupports last changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) nsifile is the correct platform-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility. with an nsifile you can navigate to ancestors or descendants without having to deal with the different
path separators used on different platforms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem. an nsifile can be retrieved by either instantiating an nsilocalfile using a platform specific
path string or by using cross-platform locations retrieved from the directory service. all methods with string parameters have tw...
...ve methods" are not. in addition, the native form cannot deal with files whose name contains characters outside the default system code page on windows. using the native form limits the ability of your code to deal with the full unicode support on windows 2000 or later where the os itself does not have such a limitation. therefore, you must not use the native form unless it is guaranteed that the
path passed to a native form function is always ascii. to create an nsifile from a
path you can use fileutils.jsm: var fileutils = cu.import("resource://gre/modules/fileutils.jsm").fileutils var nsifile = new fileutils.file( filename ) note: nsilocalfile was merged with this interface in gecko 14. much of the documentation has not been updated to reflect this change. method overview v...
...= cu.import("resource://gre/modules/fileutils.jsm").fileutils var nsifile = new fileutils.file( filename ) note: nsilocalfile was merged with this interface in gecko 14. much of the documentation has not been updated to reflect this change. ...
...And 34 more matches
Install script template - Archive of obsolete content
ewer"; // plids (http://mozilla.org/projects/plugins/plugin-identifier.html) are coined by vendors. ...
...; var mimetype = "application/x-my-plugin"; var suffix = "my"; var suffix_description = "my plugin files"; var company_name = "mypluginco"; var plugin_description = "my exemplary plugin mine all mine"; // registry constant
paths // these will be used when the win32 registry keys are written var hkey_local_machine = "hkey_local_machine"; var hkey_current_user = "hkey_current_user"; var reg_moz_
path = "software\\mozillaplugins"; // my own error code in case secondary installation fails var nosecondaryinstall = 1; // error return codes need some memory var err; // error return codes when we try and install to the current browser var errblock1; // error return codes when we try and do a secondary installation var errblock2 = 0; // global variable containing our secondary install loca...
... if this is a scriptable plugin errblock2 = addfile (plid, version, component_file, secondaryfolder, null); if (errblock2!=0) { logcomment("could not add " + component_file + " to " + secondaryfolder + ":" + errblock2); return errblock2; } } return 0; // 0 means everything went well with the secondary install } function writeplidsolution() { //concatenate the secondary install
path with the filename to make a fully qualified
pathname var qualifiedsecondaryfolderdll = secondaryfolder + plugin_file; var qualifiedsecondaryfolderxpt = secondaryfolder + component_file; // write plid keys (mozilla.org/projects/plugins/first-install-problem.html) // write plid keys to hklm var hklm_status = registerplid(hkey_local_machine, reg_moz_
path, plid, qualifiedse...
...And 29 more matches
stroke-linejoin - SVG: Scalable Vector Graphics
the stroke-linejoin attribute is a presentation attribute defining the shape to be used at the corners of
paths when they are stroked. note: as a presentation attribute stroke-linejoin can be used as a css property. ...
... the stroke-linejoin attribute is a presentation attribute defining the shape to be used at the corners of
paths when they are stroked. note: as a presentation attribute stroke-linejoin can be used as a css property. ...
... the stroke-linejoin attribute is a presentation attribute defining the shape to be used at the corners of
paths when they are stroked. note: as a presentation attribute stroke-linejoin can be used as a css property. ...
...And 27 more matches
d - SVG: Scalable Vector Graphics
the d attribute defines a
path to be drawn. a
path definition is a list of
path commands where each command is composed of a command letter and numbers that represent the command parameters. the commands are detailed below. three elements have this attribute: <
path>, <glyph>, and <missing-glyph> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <
path fill="none" stroke="red" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </svg>
path for <
path>, d is a string containing a series of
path commands that define the
path to be drawn. value <string> default value none animatable yes glyph warning: as of svg2 <glyph> is deprecated ...
... value <string> default value none animatable yes note: the point of origin (the coordinate 0,0) is usually the upper left corner of the context. ...
...ng> default value none animatable yes note: the point of origin (the coordinate 0,0) is usually the upper left corner of the context. however the <glyph> element has its origin in the bottom left corner of its letterbox. missing-glyph warning: as of svg2 <missing-glyph> is deprecated and shouldn't be used. ...
...And 21 more matches
SVG documentation index - SVG: Scalable Vector Graphics
reference, svg, svg attribute assigns a class name or set of class names to an element. you may assign the same class name or names to any number of elements, however, multiple class names must be separated by whitespace characters. 40 clip svg, svg attribute the clip attribute is a presentation attribute defining the visible region of an element. 41 clip-
path svg, svg attribute the clip-
path presentation attribute defines or associates a clipping
path with the element it is related to. 42 clip-rule svg, svg attribute the clip-rule attribute only applies to graphics elements that are contained within a <clip
path> element. the clip-rule attribute basically works as the fill-rule attribute, except that it applies to <clippa...
... 44 color svg, svg attribute the color attribute is used to provide a potential indirect value, currentcolor, for the fill, stroke, stop-color, flood-color, and lighting-color attributes. ...
... 44 color svg, svg attribute the color attribute is used to provide a potential indirect value, currentcolor, for the fill, stroke, stop-color, flood-color, and lighting-color attributes. ...
...And 21 more matches
nsIHttpServer
} let host = "localhost"; if (typeof port === "string" && port.indexof(':') != -1){ [host, port] = port.split(':'); port = parseint(port); server.identity.add('http', host, port); } server.wrappedjsobject._start(port, host); return true; }, registerfile: function(
path, file
path) { var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.initwith
path(file
path); return server.registerfile(
path, file); }, registerdirectory : function(
path, directory
path) { var file = components.classes['@mozilla.org/file/local;1'...
... .createinstance(components.interfaces.nsilocalfile); file.initwith
path(file
path); return server.registerfile(
path, file); }, registerdirectory : function(
path, directory
path) { var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.initwith
path(directory
path); return server.registerdirectory(
path, file); }, register
pathhandler: function(
path, handlercallback) { server.register
pathhandler(
path, function (request, response) { var req = createhttprequest(request); var resp = new httpresponse(response); handlercallback(req, resp); ...
...his server is * stopped and all pending requests have been fully served * @throws ns_error_null_pointer * if callback is null * @throws ns_error_unexpected * if this server is not running */ void stop(in nsihttpserverstoppedcallback callback); /** * associates the local file represented by the string file with all requests * which match request. ...
...And 20 more matches
nsILocalFile
ble via the local file system. 66 introduced gecko 1.0 deprecated gecko 14 inherits from: nsifile last changed in gecko 1.0 implemented by: @mozilla.org/file/local;1. ...
.... 66 introduced gecko 1.0 deprecated gecko 14 inherits from: nsifile last changed in gecko 1.0 implemented by: @mozilla.org/file/local;1. ...
... 14 inherits from: nsifile last changed in gecko 1.0 implemented by: @mozilla.org/file/local;1. ...
...And 20 more matches
nsIURLParser
ring authority, in long authoritylen, out unsigned long usernamepos, out long usernamelen, out unsigned long passwordpos, out long passwordlen, out unsigned long hostnamepos, out long hostnamelen, out long port); void parsefilename(in string filename, in long filenamelen, out unsigned long basenamepos, out long basenamelen, out unsigned long extensionpos, out long extensionlen); void parsefile
path(in string file
path, in long file
pathlen, out unsigned long directorypos, out long directorylen, out unsigned long basenamepos, out long basenamelen, out unsigned long extensionpos, out long extensionlen); void parse
path(in string
path, in long
pathlen, out unsigned long file
pathpos, out long file
pathlen, out unsigned long parampos, out long paramlen, out unsigned long querypos, out long queryle...
...out parameters of the methods are all optional (that is the caller may ...
...out parameters of the methods are all optional (that is the caller may pass-in a null val...
...And 19 more matches
stroke-linecap - SVG: Scalable Vector Graphics
the stroke-linecap attribute is a presentation attribute defining the shape to be used at the end of open sub
paths when they are stroked. note: as a presentation attribute stroke-linecap can be used as a css property. ...
... the stroke-linecap attribute is a presentation attribute defining the shape to be used at the end of open sub
paths when they are stroked. note: as a presentation attribute stroke-linecap can be used as a css property. ...
... the stroke-linecap attribute is a presentation attribute defining the shape to be used at the end of open sub
paths when they are stroked. note: as a presentation attribute stroke-linecap can be used as a css property. ...
...And 19 more matches
SVG and CSS - SVG: Scalable Vector Graphics
top-2" offset="95%"/> </radialgradient> </defs> <text id="heading" x="-280" y="-270">svg demonstration</text> <text id="caption" x="-280" y="-250">move your mouse pointer over the flower.</text> <g id="flower"> <circle id="overlay" cx="0" cy="0" r="200" stroke="none" fill="url(#fade)"/> <g id="outer-petals"> <g class="quadrant"> <g class="segment"> <
path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate(18)"> <
path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate...
...ll" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate(18)"> <
path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate(36)"> <
path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate(54)"> <
path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate...
...ll" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate(54)"> <
path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate(72)"> <
path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> </g> <g class="quadrant"> <g class="segment" transform="rotate(90)"> <
path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <
path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> ...
...And 19 more matches
nsIZipWriter
ods addentrychannel() adds data from a channel to the zip file. if the operation is performed on the queue then the channel will be opened asynchronously, otherwise the channel must support being opened synchronously. void addentrychannel( in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsichannel achannel, in boolean aqueue ); parameters azipentry the
path of the file entry to add to the zip file. this is the
path it will be located at within the zip file. note: you must use forward slashes ('/') in the
path. amodtime the modification time of the entry in microseconds. acompression one of the compression constants, indicating the compression method to use. achannel the channel from which to get the data. aqueue if true, the operation is ...
...of the compression constants, indicating the compression method to use. achannel the channel from which to get the data. aqueue if true, the operation is queued for later execution. if false, the operation is performed immediately. will be performed when processqueue() is called. exceptions thrown ns_error_not_initialized no zip file is open. ns_error_file_already_exists the specified
path already exists in the zip file. ns_error_in_progress the zip writer is already performing another operation. addentrydirectory() adds a new directory entry to the zip file. if azipentry does not end with "/" then it will be added. note: although it is not necessary to add directory entries in order to add file entries within them, some zip utilities may have problems with that, so it may be...
...azipentry does not end with "/" then it will be added. note: although it is not necessary to add directory entries in order to add file entries within them, some zip utilities may have problems with that, so it may be best to add the directory entries explicitly first. void addentrydirectory( in autf8string azipentry, in prtime amodtime, in boolean aqueue ); parameters azipentry the
path of the directory entry to add to the zip file.note: you must use forward slashes in the
path. (a forward slash is '/') detail: this azipentry is very important, this example demonstrates its usage: var zw = cc['@mozilla.org/zipwriter;1'].createinstance(ci.nsizipwriter); var myzipfile = fu.file('c:\\myzipfile.zip'); //this file will be creatd in c drive var pr = {pr_rdonly: 0x01, pr_wronly: 0...
...And 18 more matches
Applying styles and colors - Web APIs
colors of the shapes' outlines. we use the arc() method to draw circles instead of squares. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); for (var i = 0; i < 6; i++) { for (var j = 0; j < 6; j++) { ctx.strokestyle = 'rgb(0, ' + math.floor(255 - 42.5 * i) + ', ' + math.floor(255 - 42.5 * j) + ')'; ctx.begin
path(); ctx.arc(12.5 + j * 25, 12.5 + i * 25, 10, 0, math.pi * 2, true); ctx.stroke(); } } } <canvas id="canvas" width="150" height="150"></canvas> draw(); the result looks like this: screenshotlive sample transparency in addition to drawing opaque shapes to the canvas, we can also draw semi-transparent (or translucent) shapes. this is done by either setting the gl...
...using rgba() gives you a littl...
...rrent line dash pattern. linedashoffset = value specifies where to start a dash array on a line. you'll get a better understanding of what these do by looking at the examples below. a linewidth example this property sets the current line thickness. values must be positive numbers. by default this value is set to 1.0 units. the line width is the thickness of the stroke centered on the given
path. in other words, the area that's drawn extends to half the line width on either side of the
path. because canvas coordinates do not directly reference pixels, special care must be taken to obtain crisp horizontal and vertical lines. in the example below, 10 straight lines are drawn with increasing line widths. the line on the far left is 1.0 units wide. however, the leftmost and all other odd-in...
...And 17 more matches
cfx - Archive of obsolete content
docs main.md lib main.js package.json readme.md tests test-main.js cfx run this command is used to run the add-on. called with no options it looks for a file called package.json in the current directory, loads the corresponding add-on, and runs it under the version of firefox it finds in the platform's default install
path. 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. you can specify a different version of the host application using the --binary option, passing in the
path to the application binary to run. the
path may be specified as a full
path or may be relative to the current directory. bu...
...ile. you can specify an existing profile using the --profiledir option, and this gives you access to that profile's history, bookmarks, and other add-ons. this enables you to run your add-on alongside debuggers like firebug. see "using --profiledir" for more information. -b binary, --binary=binary use the host application binary specified in binary. binary may be specified as a full
path or as a
path relative to the current directory. --binary-args=cmdargs pass extra arguments to the binary being executed (for example, firefox). for example, to pass the -jsconsole argument to firefox, which will launch the javascript error console, try the following: cfx run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote...
...w.mozilla.org" -jsconsole' --extra-packages=extra_packages extra packages to include, specified as a comma-separated list of package names. -g config, --use-config=config pass a set of options by referencing a named configuration. -p profiledir, --profiledir=profiledir use an existing profile located in profiledir. profiledir may be specified as a full
path or as a
path relative to the current directory. see "using --profiledir" for more information. --package-
path=package
path extra directories for package search. --pkgdir=pkgdir use an add-on located in pkgdir. pkgdir may be specified as a full
path or as a
path relative to the current directory. --static-args=static_args pass arguments to your add-on, ...
...And 16 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
d", "file url"); frequently used xpcom functions let’s take a look at those xpcom functions that are used especially frequently. you should be able to get the gist of how xpcom is used by looking at the sample code. you can paste almost all the sample code in this chapter into your existing test.xul file to try it out. feel free to fill in blank spots as you see fit. make sure to change file
paths to match your own environment. you can download the source code used in this chapter. get window while you can use javascript to get child windows opened from the parent window, you cannot get dialogs or windows that have no relation to that window. to overcome this limitation, nsiwindowmediator makes it possible to access all of firefox's windows. get active window one thing that nsiwindow...
...efox, including dialogs, etc. manipulating files using xpcom xpcom provides a number of interfaces allowing you to perform file manipulations without concern for whether you are running on windows, mac os x, or linux. in order to work with local files, first you need to create a nsilocalfile object representing the local file, as shown in listing 6. when you initialize this by passing the full
path to the file with the nsilocalfile.initwith
path() method, it becomes available to all functions. it doesn't matter whether a file at the specified
path already exists. note: use the
path format suited to your platform: the windows “\”
path delimiter is interpreted as an escape code, so should always be written “\\”; characters like “./” on linux require no special handling. listing 6...
... passing true as a parameter for the nsilocalfile.remove() method will recursively delete folders and files. let's see what happens when we pass true to delete all the contents of a folder. ...
...And 16 more matches
Index
iod; however, it works only in a limited amount of more advanced scenarios. unfortunately, the world of certificates has become more complex in the recent past. new certificate authorities enter the global pki market, and in order to get started with their business, they might make deals with established cas and receive so-called cross-signing-certificates. as a result, when searching for a trust
path from (a) to a trusted anchor (root) certificate (z), the set of candidate issuer certificates might have different issuer names (referring to the second or higher issuer level). as a consequence, it will be necessary to try multiple different alternative routes while searching for (z), in a recursive manner. only the newer verification engine (internally named libpkix) is capable of doing that pr...
... key databases is not recommended. -installdir root-installation-directory specify the root installation directory relative to which files will be installed by the -jar option. this directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory. -libfile library-file specify a
path to a library file containing the implementation of the pkcs #11 interface module that is being added to the database. -mechanisms mechanism-list specify the security mechanisms for which a particular module will be flagged as a default provider. the mechanism-list is a colon-delimited list of mechanism names. enclose this list in quotati...
... installation file format”. the jar installation script defines the setup information for each platform that the module can be installed on. for example: platforms { linux:5.4.08:x86 { modulename { "example pkcs #11 module" } modulefile { crypto.so } defaultmechanismflags{0x0000} cipherenableflags{0x0000} files { crypto.so {
path{ /tmp/crypto.so } } setup.sh { executable
path{ /tmp/setup.sh } } } } linux:6.0.0:x86 { equivalentplatform { linux:5.4.08:x86 } } } both the install script and the required libraries must be bundled in a jar file, which is specified with the -jar argument. modutil -dbdir sql:/home/mt"jar-install-filey/shar...
...And 14 more matches
Document.evaluate() - Web APIs
null is common for html documents or when no namespace prefixes are used. ...
...null is common for html documents or when no namespace prefixes are used. ...
...null is common for html documents or when no namespace prefixes are used. ...
...And 14 more matches
Drawing graphics - Learn web development
a canvasrenderingcontext2d object (in our case, ctx). many operations need to be given coordinates to pinpoint exactly where to draw something — the top left of the canvas is point (0, 0), the horizontal (x) axis runs from left to right, and the vertical (y) axis runs from top to bottom. drawing shapes tends to be done using the rectangle shape primitive, or by tracing a line along a certain
path and then filling in the shape. below we'll show how to do both. simple rectangles let's start with some simple rectangles. first of all, take a copy of your newly coded canvas template (or make a local copy of 1_canvas_template.html if you didn't follow the above steps). next, add the following lines to the bottom of your javascript: ctx.fillstyle = 'rgb(255, 0, 0)'; ctx.fillrect...
...to change this (it takes a number representing the number of pixels wide the stroke is). add the following line in between the previous two lines: ctx.linewidth = 5; now you should see that your white outline has become much thicker! that's it for now. at this point your example should look like this: note: the finished code is available on github as 2_canvas_rectangles.html. drawing
paths if you want to draw anything more complex than a rectangle, you need to draw a
path. basically, this involves writing code to specify exactly what
path the pen should move along on your canvas to trace the shape you want to draw. canvas includes functions for drawing straight lines, circles, bézier curves, and more. let's start the section off by making a fresh copy of our canvas template (1_...
...
path the pen should move along on your canvas to trace the shape you want to draw. canvas includes functions for drawing straight lines, circles, bézier curves, and more. let's start the section off by making a fresh copy of our canvas template (1_canvas_template.html), in which to draw the new example. we'll be using some common methods and properties across all of the below sections: begin
path() — start drawing a
path at the point where the pen currently is on the canvas. on a new canvas, the pen starts out at (0, 0). moveto() — move the pen to a different point on the canvas, without recording or tracing the line; the pen simply "jumps" to the new position. fill() — draw a filled shape by filling in the
path you've traced so far. stroke() — draw an outline shape by drawing ...
...And 13 more matches
Examples
how to throw reject if you have a function that is a promise, and want to end it and throw a reject, you can throw an error. components.utils.import("resource://gre/modules/osfile.jsm") let
path = os.
path.join(os.constants.
path.tmpdir, "file.txt"); let promise = os.file.exists(
path); let newpromise = promise.then(function onfulfill(aexists) { if (aexists) { console.log("you have file.txt in your temporary directory."); } else { throw new error("you don't have file.txt in your temporary directory."); } }); // unexpected errors should always be reported at the end of a promise chain. let lastpromise = newpromise.then(function onfulfill(){ }) .catch(function onreject(arejectreason) { console.warn('newpromise failed with reason: ', arejectreason); }); using a pro...
...rted at the end of a promise chain. let lastpromise = newpromise.then(function onfulfill(){ }) .catch(function onreject(arejectreason) { console.warn('newpromise failed with reason: ', arejectreason); }); using a promise returned by a function (verbose) this example uses a verbose syntax, showing all the involved promises. ...
...e end of a promise chain. let lastpromise = newpromise.then(function onfulfill(){ }) .catch(function onreject(arejectreason) { console.warn('newpromise failed with reason: ', arejectreason); }); using a promise returned by a function (verbose) this example uses a verbose syntax, showing all the involved promises. components.utils.import("resource://gre/modules/osfile.jsm") let
path = os.
path.join(os.constants.
path.tmpdir, "file.txt"); let promise = os.file.exists(
path); let newpromise = promise.then(function onfulfill(aexists) { if (aexists) { console.log("you have file.txt in your temporary directory."); } else { console.log("you don't have file.txt in your temporary directory."); } }); // unexpected errors should always be reported at the end of a promise chain. le...
...And 13 more matches
Document Object Model (DOM) - Web APIs
les and stylesheets, browser history, and so forth. these interfaces are discussed further in the html dom api documentation. ...
...eelement svgfeturbulenceelement svgfilterelement svgfilterprimitivestandardattributes svgfontelement svgfontfaceelement svgfontfaceformatelement svgfontfacenameelement svgfontfacesrcelement svgfontfaceurielement svgforeignobjectelement svggelement svggeometryelement svgglyphelement svgglyphrefelement svggradientelement svggraphicselement svghatchelement svghatch
pathelement svghkernelement svgimageelement svglineargradientelement svglineelement svgmarkerelement svgmaskelement svgmeshelement svgmeshgradientelement svgmeshpatchelement svgmeshrowelement svgmetadataelement svgmissingglyphelement svgm
pathelement svg
pathelement svgpatternelement svgpolylineelement svgpolygonelement svgradialgradientelement svgrectelement svgscrip...
...chelement svgmeshrowelement svgmetadataelement svgmissingglyphelement svgm
pathelement svg
pathelement svgpatternelement svgpolylineelement svgpolygonelement svgradialgradientelement svgrectelement svgscriptelement svgsetelement svgsolidcolorelement svgstopelement svgstyleelement svgsvgelement svgswitchelement svgsymbolelement svgtextcontentelement svgtextelement svgtext
pathelement svgtextpositioningelement svgtitleelement svgtrefelement svgtspanelement svguseelement svgunknownelement svgviewelement svgvkernelement svg data type interfaces here are the dom apis for data types used in the definitions of svg properties and attributes. static type svgangle svgcolor svgicccolor svgelementinstance svgelementinstancelist svglength svglength...
...And 12 more matches
jpm - Archive of obsolete content
minal window, enter sudo apt-get install nodejs nodejs-legacy npm. to test your installation, run: /usr/bin/env node -v if you get an error message saying /usr/bin/env: node: no such file or directory and you have installed nodejs through a package manager, nodejs may have been installed under a different executable name. ...
...r, it must be present in your
path under the name node. on debian and ubuntu, this can be remedied by ensuring you installed the compatibility package, nodejs-legacy: sudo apt-get install nodejs-legacy on other distributions, you may have to create a local symlink to nodejs manually: sudo ln -s "$(which nodejs)" /usr/local/bin/node installing jpm after you have npm installed and node on your
path, install jpm just as you would any other npm package. installing jpm globally npm install jpm --global depending on your setup, you might need to run this as an administrator: sudo npm install jpm --global installing jpm locally if you do not wish to, or are unable to, install jpm globally, you may instead install it locally: cd $home && npm install jpm to run jpm from a terminal when inst...
...tall jpm --global depending on your setup, you might need to run this as an administrator: sudo npm install jpm --global installing jpm locally if you do not wish to, or are unable to, install jpm globally, you may instead install it locally: cd $home && npm install jpm to run jpm from a terminal when installed locally, you must add the directory "$home/node_modules/.bin/" to your terminal's
path first. add the following line to the end of the file $home/.profile to add it to your
path permanently (as the file .profile is executed every time a new terminal is opened): export
path="$home/node_modules/.bin/:$
path" installing jpm from git alternatively, you can also get the latest version of jpm using git: git clone https://github.com/mozilla-jetpack/jpm.git cd jpm npm install npm link ...
...And 11 more matches
Tamarin build documentation - Archive of obsolete content
this folder to 'android-ndk'. - run the android sdk/avd manager at /android-public/android-sdk-mac_86/tools/android and add android sdk platform-tools (to get adb), sdk platform android 2.3.3, and api 10 (samples and docs are optional). if you have trouble starting the app try this: $ export android_swt=$android_build_top/android-sdk-mac_86/tools/lib/x86_64 where $android_build_top is the full
path to your sdk/ndk top folder - get the openssl-0.9.8r.tar (openssl-1.0.0c.tar.gz won't work) openssl files from http://www.openssl.org (use the source link on the left). unzip the file and put the /openssl main folder under your sdk/ndk top folder. make sure its name is just "openssl". then build as follows: - replace the makefile in the main folder with the one attached to this page. - change ...
...y/mac/#qa/qa2001/qa1118.html - create a /frameworks/base/opengl/include/egl folder under your sdk/ndk top folder. get the ersion 1.4 egl header files (egl.h, eglext.h and eglplatform.h) from http://www.khronos.org/registry/egl/ and save or copy them there. ...
...ild tamarin release shell - get tamarin-redux - export the following variables into the environment $ export android_toolchain=<full
path to your android sdk/ndk top folder> $ export android_ndk=$android_toolchain/android-ndk $ export android_ndk_bin=$android_ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin $ export android_sdk=$android_toolchain/android-sdk-mac_86 $ export
path=$
path:$android_sdk/platform-tools:$android_ndk_bin - example commands to build tamarin: $ hg clone http://hg.mozilla.org/tamarin-redux $ cd tamarin-redux $ mkdir objdir-release $ cd objdir-release $ ../configure.py --arm-arch=armv7-a --target=arm-android $ make to make a debug shell use this command: ../configure.py --enable-debug --arm-arch=armv7-a --target=arm-android using cross-platfo...
...And 11 more matches
Eclipse CDT Manual Setup
happil...
...happily, eclipse makes manual configuration unnecessary. like some other ides, that are used with projects like mozilla that have their own build system. ...
...le that's compiled during an actual build. this process is sometimes called "build option discovery" or "compiler option discovery". the way that eclipse cdt does build option discovery is to scan the console output from a real build looking for lines where a compiler was invoked. ...
...And 11 more matches
Setting up the Gecko SDK
tract the sdk, it should have the layout seen below: layout of the extracted sdk the directories represent different modules in the sdk. for example, the headers for networking are all located in the necko directory, and the headers that xpcom requires are in the xpcom directory. this directory structure makes build scripts slightly more complicated (since there will be many different include
paths), but it helps to organize the parts of the sdk meaningfully. the two top level header files are special. the file mozilla-config.h lists all of the defines used in the sdk. including this header file in your project ensures that the component you create uses the same defines as the gecko libraries themselves. note that mozilla-config.h may be need to be included before other includes in your c...
...d the gecko sdk on the disk. to edit project settings, select settings from the project menu (or press alt-f7). most of the changes you make in the following steps apply to all configurations of the project (both debug and optimized), so select "all configurations" from the settings for dropdown menu: on the c/c++ tab, select the preprocessor category. this window is where you add the include
paths to the gecko sdk as well as two preprocessor defines: xpcom_glue mozilla_strict_api at a minimum, you must include the nspr, the embedstring and string include directories, and the xpcom include subdirectory. if your component will use other parts of the sdk (e.g., necko), you will have to add these include directories to this field as well. assuming you are using the example location for...
... well as two preprocessor defines: xpcom_glue mozilla_strict_api at a minimum, you must include the nspr, the embedstring and string include directories, and the xpcom include subdirectory. if your component will use other parts of the sdk (e.g., necko), you will have to add these include directories to this field as well. assuming you are using the example location for your project, these
paths are the following: c:\gecko-sdk\embedstring\include c:\gecko-sdk\xpcom\include c:\gecko-sdk\nspr\include c:\gecko-sdk\string\include under the c++ language category, disable exception handling. as described in the section exceptions in xpcom, exception handling isn't supported across interface boundaries, so setting this option may catch problems during development. the weblock compon...
...And 11 more matches
DirectoryEntrySync - Web APIs
. about this document this document was last updated on march 2, 2012 and follows the w3c specifications (working draft) drafted on april 19, 2011. this specification is pretty much abandoned, having failed to reach any substantial traction. basic concepts if you want to create subdirectories, you have to create each child directory in sequence. if you try to create a directory using a full
path that includes parent directories that do not exist yet, you get an error. so create the hierarchy by recursively adding a new
path after creating the parent directory. example the getfile() method returns a fileentrysync, which represents a file in the file system. the following creates an empty file called seekrits.txt in the root directory. var fileentry = fs.root.getfile('seekrits.txt', {c...
...reate: true}); the getdirectory() method returns a directoryentrysync, which represents a file in the file system. the following creates a new directory called superseekrit in the root directory. var direntry = fs.root.getdirectory('superseekrit', {create: true}); method overview directoryreadersync createreader () raises (fileexception); fileentrysync getfile (in domstring
path, in optional flags options) raises (fileexception); directoryentrysync getdirectory (in domstring
path, in optional flags options) raises (fileexception); void removerecursively () raises (fileexception); methods createreader() creates a new directoryreadersync to read entries from this directory. directoryreadersync createreader ( ) raises (fileexception); returns ...
...with the following codes: exception description not_found_err the directory does not exist. security_err the browser determined that it was not safe to look up the metadata. [ todo: explain why ] getfile() depending on how you've set the options parameter, the method either creates a file or looks up an existing file. void getfile ( in domstring
path, in optional flags options ) raises (fileexception); parameter
path either an absolute
path or a relative
path from the directory to the file to be looked up or created. you cannot create a file whose immediate parent does not exist. create the parent directory first. options an object literal describing the behavior of the method. if the file does not exist, it is created. obje...
...And 11 more matches
File I/O - Archive of obsolete content
le objects are nsifile. for legacy reasons, there is also an nsilocalfile interface. creating an nsifile object components.utils.import("resource://gre/modules/fileutils.jsm"); var file = new fileutils.file("/home"); or the same without using fileutils.jsm: var file = components.classes["@mozilla.org/file/local;1"]. createinstance(components.interfaces.nsilocalfile); file.initwith
path("/home"); note: the
path should be in the "native" form (for example"c:\\windows"). if you need to use file:// uris as initializers, see discussion of nsiioservice below. note: you can still get a file object even if the specified file does not exist, and no exception will be thrown. an exception is thrown only when methods that require the file to exist are called, e.g., isdirectory(), movet...
...zilla.org/file/directory_service;1"]. getservice(components.interfaces.nsiproperties). get("profd", components.interfaces.nsifile); // or using services.jsm and ci = components.interfaces var file = services.dirsvc.get("profd", ci.nsifile); // append the file name. file.append("data.txt"); // note: "file" is an object that implements nsifile. if you want the // file system
path, use file.
path note: file is an object that implements nsifile. if you want the file system
path, use file.
path, . here are some of the special locations the directory service supports: (scope: d = product-wide, f = profile wide) string scope meaning achrom d %curprocd%/chrome aplugns d %curprocd%/plugins (deprecated - use aplugnsdl) ...
... directory in their profile: %profile%/chrome. resource:app d the application directory in an xulrunner application. look in the source for other strings available: xpcom/io/nsappdirectoryservicedefs.h, xpcom/io/nsdirectoryservicedefs.h. other such keys as the "profd" key are available; check the known locations. enumerating drives on windows while you can use initwith
path("/") on unix-like systems (linux, mac) to get the root of the file system, there's no such root on windows. however, you can enumerate available drives using the following code: components.utils.import("resource://gre/modules/fileutils.jsm"); var root = new fileutils.file("\\\\."); var drivesenum = root.directoryentries, drives = []; while (drivesenum.hasmoreelements()) { drives.push(drivesen...
...And 10 more matches
Promises - Archive of obsolete content
and their related javascript helper modules. these older interfaces should be avoided, even in their asynchronous forms, due to their performance penalties and needless complexity. representative example usage components.utils.import("resource://gre/modules/osfile.jsm"); task.spawn(function* () { // retrieve file metadata to check modification time. let info = yield os.file.stat(config
path); if (info.lastmodificationdate <= timestamp) return; timestamp = info.lastmodificationdate; // read the file as a utf-8 string, parse as json. let config = json.parse( yield os.file.read(config
path, { encoding: "utf-8" })); let files = []; // get the directory contents from a list of directories. for (let dir of config.directories) { // ite...
... yield os.file.read(config
path, { encoding: "utf-8" })); let files = []; // get the directory contents from a list of directories. for (let dir of config.directories) { // iterate over the contents of the directory. let iter = new os.file.directoryiterator(dir); yield iter.foreach(entry => { if (!entry.isdir) files.push(entry.
path); }); iter.close(); } // read the files as binary blobs and process them. let processor = new fileprocessor(); for (let file of files) { let data = yield os.file.read(file); processor.add(data); } // now write the processed files back out, as a binary blob. ...
... files.push(entry.
path); }); iter.close(); } // read the files as binary blobs and process them. let processor = new fileprocessor(); for (let file of files) { let data = yield os.file.read(file); processor.add(data); } // now write the processed files back out, as a binary blob. yield os.file.writeatomic(config.processed
path, processor.process(), { tmp
path: config.processed
path + "." + math.random() }); // and write out a new config file. ...
...And 10 more matches
Eclipse CDT
mainly for managed projects but we use an unmanaged project for mozilla (since it has its own build system). using this plugin will result in parts of the ui described below being hidden or disabled. download "eclipse ide for c/c++ developers" (not eclipse ide for enterprise java developers) from the eclipse download page, install it, and add the directory containing the eclipse binary to your
path (/applications/eclipse.app/contents/eclipse/ on mac). (while package managers like snap sometimes provide an eclipse package, they do not include the c++ developer tools. since it's a pain to install them and keep them up to date we do not recommend getting eclipse this way.) increase eclipse's memory limits! make sure you do this! before you use eclipse with the mozilla source you must inc...
...a, so that it includes headers from the objdir etc. these can be found and processed by eclipse. note: your moz_objdir must be outside the mozilla source directory. once your build is complete, mach can then generate a useful eclipse project on your behalf. first, make sure that the directory of eclipse's eclipse binary (typically /applications/eclipse.app/contents/macos/ on macos) is in your
path. then, to create the eclipse project and open it, run: ./mach ide eclipse or to create the eclipse project without opening it yet, run: ./mach build-backend -b cppeclipse building the eclipse project should only take a few seconds. in the case of the build-backend command, instructions on how to open the project will be displayed after the command completes. manual setup, and more more inf...
...j1 -wb" (or just "make" if you don't care about keeping code assistance working) instead of using just-print-mozilla-build.py. if you want to invoke "make -f client.mk" from your source directory instead of invoking 'make' from your object directory, then in the "c/c++ build" section of the project properties, set "build command" to "make -f client.mk" and set "build directory" to just "${projdir
path}" (this is the top of the source tree). select the behavior tab and remove the "all" from the "build (incremental build)" field. select "c/c++ build > build variables", and add a variable "mozconfig", and set it to the
path of your .mozconfig file relative to the top source directory. set any other environment variables you want to set for the build, then close the project properties window. now...
...And 10 more matches
sample2
d_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 <dbdir
path> ", "[-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 <headerfilename> -i <ipfilename> -e <encryptfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <heade...
...orresponding private key \n\n", progname, "-d -b <headerfilename> -e <encryptfilename> -o <opfilename>"); fprintf(stderr, "%s %s\n --sign using private key \n\n", progname, "-s -b <headerfilename> -i <infilename> "); fprintf(stderr, "%s %s\n --verify using public key \n\n", progname, "-v -b <headerfilename> -i <ipfilename> "); fprintf(stderr, "options:\n\n"); fprintf(stderr, "%-30s - db directory
path\n\n", "-d <dbdir
path>"); fprintf(stderr, "%-30s - db password [optional]\n\n", "-p <dbpwd>"); fprintf(stderr, "%-30s - db password file [optional]\n\n", "-f <dbpwdfile>"); fprintf(stderr, "%-30s - noise file name [optional]\n\n", "-z <noisefilename>"); fprintf(stderr, "%-30s - input file name\n\n", "-i <ipfilename>"); fprintf(stderr, "%-30s - header file name\n\n", "-b <headerfilename>"); fprintf...
...) { 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 <dbdir
path> -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...
...And 9 more matches
Add to iPhoto
for this), a pointer to the unicode string to copy into the new string object (ctypes.jschar.ptr), and the length of the unicode string in characters. cfurl the cfurl type is used to describe a url. it differs from a string in that it offers url-specific methods for managing the content, and includes methods for converting between urls and file system routine data formats such as fsref and unix
pathnames. we use a few of these routines because the launch services routine we'll be using to launch iphoto and pass it the image to import uses cfurl for the file references. let's take a look at two of the routines declared here: this.cfurlcreatefromfilesystemrepresentation = this.lib.declare("cfurlcreatefromfilesystemrepresentation", ctypes.default_abi, ...
..."file system representation" strings on mac os x ar...
..."file system representation" strings on mac os x are in utf-8 format. ...
...And 9 more matches
Compositing and clipping - Web APIs
off certain areas, clear sections from the canvas (not limited to rectangles like the clearrect() method does) and more. globalcompositeoperation = type this sets the type of compositing operation to apply when drawing new shapes, where type is a string identifying which of the twelve compositing operations to use. see compositing examples for the code of the following examples. ...
... clear sections from the canvas (not limited to rectangles like the clearrect() method does) and more. globalcompositeoperation = type this sets the type of compositing operation to apply when drawing new shapes, where type is a string identifying which of the twelve compositing operations to use. see compositing examples for the code of the following examples. ...
... operation to apply when drawing new shapes, where type is a string identifying which of the twelve compositing operations to use. see compositing examples for the code of the following examples. clipping
paths a clipping
path is like a normal canvas shape but it acts as a mask to hide unwanted parts of shapes. this is visualized in the image on the right. the red star shape is our clipping
path. everything that falls outside of this
path won't get drawn on the canvas. ...
...And 9 more matches
Creating Reusable Modules - Archive of obsolete content
ilepicker;1"] .createinstance(nsifilepicker); var window = require("sdk/window/utils").getmostrecentbrowserwindow(); fp.init(window, "select a file", nsifilepicker.modeopen); fp.appendfilters(nsifilepicker.filterall | nsifilepicker.filtertext); var rv = fp.show(); if (rv == nsifilepicker.returnok || rv == nsifilepicker.returnreplace) { var file = fp.file; // get the
path as string. note that you usually won't // need to work with the string
paths. var
path = fp.file.
path; // work with returned nsilocalfile... } return
path; } hash function firefox has built-in support for hash functions, exposed via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, giv...
...ing. note that you usually won't // need to work with the string
paths. var
path = fp.file.
path; // work with returned nsilocalfile... } return
path; } hash function firefox has built-in support for hash functions, exposed via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its
path. ...
...nctions, exposed via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its
path. ...
...And 8 more matches
Index - Archive of obsolete content
ion of apis to broadcast and subscribe to events. 83 event/target create objects that broadcast events. 84 frame/hidden-frame creates firefox frames (i.e. xul <iframe> elements) that are not displayed to the user. 85 frame/utils provides helper functions for working with platform internals like frames and browsers. 86 fs/
path provides access to the local filesystem with the nodejs
path module api. 87 io/byte-streams provides streams for reading and writing bytes. 88 io/file provides access to the local filesystem. 89 io/text-streams provides streams for reading and writing text. 90 lang/functional functional helper metho...
...xecution code snippets no summary! 180 dialogs and prompts add-ons, code snippets, extensions, xul no summary! 181 downloading files code snippets to download a file, create an instance of nsiwebbrowserpersist and call its nsiwebbrowserpersist.saveuri() method, passing it a url to download and an nsifile instance representing the local file name/
path. 182 drag & drop code snippets 183 embedding svg code snippets no summary! 184 examples and demos from articles no summary! 185 file i/o add-ons, code snippets, extensions, files, streams, tutorial no summary! 186 finding window handles add-ons, code snippets, extensions, xpcom, js-ctypes no...
...these are the sort of things that super-review should be catching for code that goes into the tree; avoiding these to star...
...And 8 more matches
nsIWindowsRegKey
e scriptable access to the windows registry system. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) the interface represents a single key in the registry. this interface is highly win32 specific. ...
...duced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) the interface represents a single key in the registry. this interface is highly win32 specific. ...
...h, in unsigned long mode); astring getchildname(in unsigned long index); astring getvaluename(in unsigned long index); unsigned long getvaluetype(in astring name); boolean haschanged(); boolean haschild(in astring name); boolean hasvalue(in astring name); boolean iswatching(); void open(in unsigned long rootkey, in astring rel
path, in unsigned long mode); nsiwindowsregkey openchild(in astring rel
path, in unsigned long mode); acstring readbinaryvalue(in astring name); unsigned long long readint64value(in astring name); unsigned long readintvalue(in astring name); astring readstringvalue(in astring name); void removechild(in astring rel
path); void removevalue(in ...
...And 8 more matches
ctypes.open
shared library, a native file which can be loaded and used from js-ctypes, compile it with these commands: gcc -fpic -c mycfuntionsforunix.c gcc -shared -o mycfuntionsforunix.so mycfuntionsforunix.o a file named mycfuntionsforunix.so is successfully created. this native file can be placed in any folder of an addon and then loaded from js-ctypes. they can also be loaded from the system library
path. loading the native file if your addon is restartless, you must set it to be unpacked. see: http://stackoverflow.com/questions/19382201/how-to-load-dll-from-sdk-addon-data-folder it is important to note that custom native files cannot be loaded through chrome:// or resource:// uris. they must be accessed through a local file
path (file://) or a jar
path (jar:). if the addon is an unpacked add...
...less, you must set it to be unpacked. see: http://stackoverflow.com/questions/19382201/how-to-load-dll-from-sdk-addon-data-folder it is important to note that custom native files cannot be loaded through chrome:// or resource:// uris. they must be accessed through a local file
path (file://) or a jar
path (jar:). if the addon is an unpacked addon, such as bootstrap or add-on sdk addons, the jar
path must be used. therefore, the
path has to be converted and then the converted
path is used for loading with ctypes.open. if the native file is located at chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so then it is converted to a file uri like this: components.utils.import("resource://gre/modules/services.jsm"); var cr = components.classes['@mozilla.org/chrome/chrome-registry;1'].get...
... a file uri like this: components.utils.import("resource://gre/modules/services.jsm"); var cr = components.classes['@mozilla.org/chrome/chrome-registry;1'].getservice(components.interfaces.nsichromeregistry); var chromeuri_mylib = services.io.newuri('chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so', 'utf-8', null); var localfile_mylib = cr.convertchromeurl(chromeuri_mylib); var jar
path_mylib = localfile_mylib.spec; // "jar:file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@jetpack.xpi!/mysubfolder/mycfunctionsforunix.so" var file
path_mylib = localfilemylib.
path; // "file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@jetpack.xpi!/mysubfolder/mycfunc...
...And 8 more matches
offset - CSS: Cascading Style Sheets
the offset css shorthand property sets all the properties required for animating an element along a defined
path. note: early versions of the spec called this property motion. ...
... the offset css shorthand property sets all the properties required for animating an element along a defined
path. note: early versions of the spec called this property motion. ...
...ts all the properties required for animating an element along a defined
path. note: early versions of the spec called this property motion. ...
...And 8 more matches
fill-rule - SVG: Scalable Vector Graphics
the fill-rule attribute is a presentation attribute defining the algorithm to use to determine the inside part of a shape. note: as a presentation attribute, fill-rule can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <
path>, <polygon>, <polyline>, <text>, <text
path>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg"> <!-- default value for fill-rule --> <polygon fill-rule="nonzero" stroke="red" points="50,0 21,90 98,35 2,35 79,90"/> <!-- the center of the shape has two
path segments (shown by the red stroke) between it and infinity. it is therefore considered outside the shape, and not filled.
... the fill-rule attribute provides two options for how the inside (that is, the area to be filled) of a shape is determined: nonzero the value nonzero determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction, and then examining the places where a segment of the shape crosses the ray. ...
...is, the area to be filled) of a shape is determined: nonzero the value nonzero determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction, and then examining the places where a segment of the shape crosses the ray. starting with a count of zero, add one each time a
path segment crosses the ray from left to right and subtract one each time a
path segment crosses the ray from right to left. ...
...And 8 more matches
side - SVG: Scalable Vector Graphics
the side attribute determines the side of a
path the text is placed on (relative to the
path direction). ...
... the side attribute determines the side of a
path the text is placed on (relative to the
path direction). ...
... the side attribute determines the side of a
path the text is placed on (relative to the
path direction). ...
...And 8 more matches
system - Archive of obsolete content
query the add-on's environment and access arguments passed to it. usage querying your environment using the system module you can access environment variables (such as
path), find out which operating system your add-on is running on and get information about the host application (for example, firefox or fennec), such as its version. ...
... query the add-on's environment and access arguments passed to it. usage querying your environment using the system module you can access environment variables (such as
path), find out which operating system your add-on is running on and get information about the host application (for example, firefox or fennec), such as its version. ...
...ent and access arguments passed to it. usage querying your environment using the system module you can access environment variables (such as
path), find out which operating system your add-on is running on and get information about the host application (for example, firefox or fennec), such as its version. ...
...And 7 more matches
/loader - Archive of obsolete content
require() function. create task specific loaders with restricted module access. provide unload hooks that may be used to undo changes made by anything loaded into it. ...
... a set of configuration options:
paths: describes where the loader should find the modules it is asked to load. mandatory. modules: provides a set of module exports. optional. globals: provides a set of globals shared across modules loaded via this loader. optional. resolve: provide customized module resolution logic. optional. id: provide add-on id to attach to loaded modules. optional.
paths the loader needs to be provided with a set of locations to indicate where to find modules loaded using require(). this is provided by a mandatory options.
paths hash that represents the mapping between module id prefixes and locations. ...
...
paths the loader needs to be provided with a set of locations to indicate where to find modules loaded using require(). this is provided by a mandatory options.
paths hash that represents the mapping between module id prefixes and locations. ...
...And 7 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
eate a new extension, rather than copying the components directly into firefox's binary directory. the main advantage of using an extension is that it is easy to package everything up and install it on another machine. so here's your basic, plain-vanilla top-level makefile (makefile.in in the main extension directory): depth = ../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ v
path = @srcdir@ include $(depth)/config/autoconf.mk module = myextension dirs = public src xpi_name = myextension install_extension_id = myextension@mycompany.com xpi_pkgname = myextension dist_files = install.rdf include $(topsrcdir)/config/rules.mk a detailed description of the make process, describing the key features of this makefile, can be found here. module...
... would discourage this practice (among other things, static linking means the same code gets loaded more than once into memory, and the code won't be available from javascript or other non-c++ languages) and encourage the use of xpcom wherever possible. the makefile in the public/ directory should follow this model: depth = ../../.. ...
...lla/$(moz_objdir)/dist/include/. it contains stubs for the component .h and .cpp files that you can copy and paste into your implementation files. all you have to do is fill in the implementation stubs in the c++ file and you're good to go. here's an example of the makefile you need to place into your src directory: depth = ../../.. ...
...And 7 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
e ldap address book, create an email account, and configure imap and smtp: [root@calaz /usr/lib/thunderbird] $ cat thunderbird.cfg //put everything in a try/catch try { // 1) env variables if(getenv("user") != "") { // *nix settings var env_user = getenv("user"); var env_home = getenv("home"); } else { // windows settings var env_user = getenv("username"); var env_home = getenv("home
path"); } var env_mozdebug= getenv("mozilla_debug"); // var env_user = prompt("indiquez votre login", toto); // 2) lock general preferences //ldap address book lockpref("ldap_2.prefs_migrated", true); lockpref("ldap_2.servers.ldapint.auth.savepassword", true); lockpref("ldap_2.servers.ldapint.description", "ldap int"); lockpref("ldap_2.servers.ldapint.filename", "abook-1.mab"); lockpref("ldap_2.serve...
...0.2 at least :-(, so i applied the workaround i proposed in that bug report (start_pos += 1;). thunderbird 2.x beta 2 recently (2007/03/21) i've tested with thunderbird 2 beta 2 (2007/01/16) to check if autoconfig + ldap is still supported . apprently it's ok . autonfig api is there, ldap call works fine, good !. my tests were on windows vista, and i noticed at least one difference, it is that
paths changed; now the profile is in (for my procacci user sample): c:\users\procacci\appdata\roaming\thunderbird\profiles\v6we4uku.default start in debug mode in comand line interface: debug with displayerror() here's the result, i used the displayerror() method ( not the best way :-( see bug 206294 ) to show environment and ldap variables in order to check that it worked fine. just settin...
...ne.org/viewtopic.php?p=3381133#3381133 defaultpref("browser.safebrowsing.enabled", false); defaultpref("browser.safebrowsing.malware.enabled", false); // 1) env variables if(getenv("user") != "") { // *nix settings var env_user = getenv("user"); var env_home = getenv("home"); } else { // windows settings var env_user = getenv("username"); var env_home = getenv("home
path"); } var env_mozdebug= getenv("mozilla_debug"); // 2) define here (because if set after "3)" below it doesn't work !) processldapvalues which is eventually called by getldapattributes() just below, // check getldapattributes() code from $mozilla_home/defaults/autoconfig/prefcalls.js to see the inside call to "user defined" processldapvalues /* commented all this section about ldap calls, ...
...And 7 more matches
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
ows java code to interact with xpcom objects. as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++. prerequisites java 1.4.2 or newer xulrunner 1.8.0.1 or newer embedding in order to embed mozilla in your java application, you will need to add the library mozillainterfaces.jar (located in xulrunner/sdk/lib folder) to your class
path. this library provides the interfaces necessary to bootstrap mozilla and call xpcom methods. to start embedding, we use the methods provided by the mozilla singleton class. first, the java application must find a suitable xulrunner installation: mozilla mozilla = mozilla.getinstance(); greversionrange[] range = new greversionrange[1]; range[0] = new greversionrange("1.8.0", true, "1.9", fals...
...nd call xpcom methods. to start embedding, we use the methods provided by the mozilla singleton class. ...
.... to start embedding, we use the methods provided by the mozilla singleton class. ...
...And 7 more matches
addDirectory - Archive of obsolete content
adddirectory unpacks an entire directory into a temporary location. ...
... adddirectory unpacks an entire directory into a temporary location. ...
... adddirectory unpacks an entire directory into a temporary location. ...
...And 7 more matches
NSS tools : modutil
a special case. changing the names of the certificate and key databases is not recommended. -installdir root-installation-directory specify the root installation directory relative to which files will be installed by the -jar option. this directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory. -libfile library-file specify a
path to a library file containing the implementation of the pkcs #11 interface module that is being added to the database. -mechanisms mechanism-list specify the security mechanisms for which a particular module will be flagged as a default provider. the mechanism-list is a colon-delimited list of mechanism names. enclose this list in quotation marks if it contains spaces. the module becomes a ...
...is described in more detail in [1]the section called “jar installation file format”. the jar installation script defines the setup information for each platform that the module can be installed on. for example: platforms { linux:5.4.08:x86 { modulename { "example pkcs #11 module" } modulefile { crypto.so } defaultmechanismflags{0x0000} cipherenableflags{0x0000} files { crypto.so {
path{ /tmp/crypto.so } } setup.sh { executable
path{ /tmp/setup.sh } } } } linux:6.0.0:x86 { equivalentplatform { linux:5.4.08:x86 } } } both the install script and the required libraries must be bundled in a jar file, which is specified with the -jar argument. modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir sql:/home/my/sharednssdb this installati...
...ame and file, and any optional information like supported ciphers and mechanisms. multiple platforms can be defined in a single install file. ...
...And 7 more matches
CanvasRenderingContext2D.stroke() - Web APIs
examples a simple stroked rectangle this example creates a rectangle using the rect() method, and then draws it to the canvas using stroke(). ...
... examples a simple stroked rectangle this example creates a rectangle using the rect() method, and then draws it to the canvas using stroke(). ...
... examples a simple stroked rectangle this example creates a rectangle using the rect() method, and then draws it to the canvas using stroke(). ...
...And 7 more matches
CanvasRenderingContext2D - Web APIs
ontext, call getcontext() on the <canvas> element, supplying '2d' as the argument: const canvas = document.getelementbyid('my-house'); const ctx = canvas.getcontext('2d'); with the context in hand, you can draw anything you like. this code draws a house: // set line width ctx.linewidth = 10; // wall ctx.strokerect(75, 140, 150, 110); // door ctx.fillrect(130, 190, 40, 60); // roof ctx.begin
path(); ctx.moveto(50, 140); ctx.lineto(150, 60); ctx.lineto(250, 140); ctx.close
path(); ctx.stroke(); the resulting drawing looks like this: reference drawing rectangles there are three methods that immediately draw rectangles to the canvas. canvasrenderingcontext2d.clearrect() sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, ...
...anvaspattern. shadows canvasrenderingcontext2d.shadowblur specifies the blurring effect. default: 0 canvasrenderingcontext2d.shadowcolor color of the shadow. default: fully-transparent black. canvasrenderingcontext2d.shadowoffsetx horizontal distance the shadow will be offset. default: 0. canvasrenderingcontext2d.shadowoffsety vertical distance the shadow will be offset. default: 0.
paths the following methods can be used to manipulate
paths of objects. canvasrenderingcontext2d.begin
path() starts a new
path by emptying the list of sub-
paths. call this method when you want to create a new
path. canvasrenderingcontext2d.close
path() causes the point of the pen to move back to the start of the current sub-
path. it tries to draw a straight line from the current point to the sta...
...l this method when you want to create a new
path. canvasrenderingcontext2d.close
path() causes the point of the pen to move back to the start of the current sub-
path. it tries to draw a straight line from the current point to the start. if the shape has already been closed or has only one point, this function does nothing. canvasrenderingcontext2d.moveto() moves the starting point of a new sub-
path to the (x, y) coordinates. canvasrenderingcontext2d.lineto() connects the last point in the current sub-
path to the specified (x, y) coordinates with a straight line. canvasrenderingcontext2d.beziercurveto() adds a cubic bézier curve to the current
path. canvasrenderingcontext2d.quadraticcurveto() adds a quadratic bézier curve to the current
path. canvasrenderingcontext2d.arc() adds a c...
...And 7 more matches
Advanced animations - Web APIs
nvas id="canvas" width="600" height="300"></canvas> as usual, we need a drawing context first. to draw the ball, we will create a ball object which contains properties and a draw() method to paint it on the canvas. var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var ball = { x: 100, y: 100, radius: 25, color: 'blue', draw: function() { ctx.begin
path(); ctx.arc(this.x, this.y, this.radius, 0, math.pi * 2, true); ctx.close
path(); ctx.fillstyle = this.color; ctx.fill(); } }; ball.draw(); nothing special here, the ball is actually a simple circle and gets drawn with the help of the arc() method. adding velocity now that we have a ball, we are ready to add a basic animation like we have learned in the last chapter of this tu...
...rame() helps us to control the animation. the ball gets moving by adding a velocity vector to the position. for each frame, we also clear the canvas to remove old circles from prior frames. ...
...ector to the position. for each frame, we also clear the canvas to remove old circles from prior frames. ...
...And 7 more matches
HTMLCanvasElement.toBlob() - Web APIs
co (mozilla only) this uses -moz-parse to convert the canvas to ico. windows xp doesn't support converting from png to ico, so it uses bmp instead. a download link is created by setting the download attribute. the value of the download attribute is the name it will use as the file name. ...
...ws xp doesn't support converting from png to ico, so it uses bmp instead. a download link is created by setting the download attribute. the value of the download attribute is the name it will use as the file name. ...
...image/vnd.microsoft.icon', '-moz-parse-options:format=bmp;bpp=32'); save toblob to disk with os.file (chrome/add-on context only) this technique saves it to the desktop and is only useful in firefox chrome context or add-on code as os apis are not present on web sites. ...
...And 7 more matches
Using IndexedDB - Web APIs
e example). ...
...ctstore("name", { key
path: "mykey" }); }; in this case, the database will already have the object stores from the previous version of the database, so you do not have to create these object stores again. you only need to create any new object stores, or delete object stores from the previous version that are no longer needed. if you need to change an existing object store (e.g., to change the key
path), then you must delete the old object store and create it again with the new options. (note that this will delete the information in the object store! if you need to save that information, you should read it out and save it somewhere else before upgrading the database.) trying to create an object store with a name that already exists (or trying to delete an object store with a name that does not...
...link, see the idbdatabase reference article. structuring the database now to structure the database. indexeddb uses object stores rather than tables, and a single database can contain any number of object stores. whenever a value is stored in an object store, it is associated with a key. there are several different ways that a key can be supplied depending on whether the object store uses a key
path or a key generator. the following table shows the different ways the keys are supplied: key
path (key
path) key generator (autoincrement) description no no this object store can hold any kind of value, even primitive values like numbers and strings. you must supply a separate key argument whenever you want to add a new value. yes no this object st...
...And 7 more matches
shape-outside - CSS: Cascading Style Sheets
/interactive-examples and send us a pull request. ...
...rder radius shaping rules for the inside of the border. content-box defines the shape enclosed by the outside content edge. each corner radius of this box is the larger of 0 or border-radius - border-width - padding. <basic-shape> the float area is computed based on the shape created by of one of inset(), circle(), ellipse(), polygon(), or as added in the level 2 specification
path(). if a <shape-box> is also supplied, it defines the reference box for the <basic-shape> function. otherwise, the reference box defaults to margin-box. <image> the float area is extracted and computed based on the alpha channel of the specified <image> as defined by shape-image-threshold. note: user agents must use the potentially cors-enabled fetch method defined by the html5 specification ...
...)<circle()> = circle( [ <shape-radius> ]? [ at <position> ]? )<ellipse()> = ellipse( [ <shape-radius>{2} ]? [ at <position> ]? )<polygon()> = polygon( <fill-rule>? , [ <leng...
...And 7 more matches
rotate - SVG: Scalable Vector Graphics
if the value of rotate is auto, the element turns to align its right-hand side in the current direction of motion. if the value is auto-reverse, it turns its left-hand side in the current direction of motion. ...
...if the value of rotate is auto, the element turns to align its right-hand side in the current direction of motion. if the value is auto-reverse, it turns its left-hand side in the current direction of motion. ...
...ts left-hand side in the current direction of motion. setting rotate's value to a number specifies a constant rotation, in degrees, that does not change with the animation. the default value of 0 keeps the animated element in its original orientation. ...
...And 7 more matches
SVG animation with SMIL - SVG: Scalable Vector Graphics
smil in favor of css animations and web animations, the chrome developers have since suspended that deprecation. firefox 4 introduced support for animating svg using synchronized multimedia integration language (smil). smil allows you to: animate the numeric attributes of an element (x, y, ...) animate transform attributes (translation or rotation) animate color attributes follow a motion
path this is done adding an svg element like <animate> inside the svg element to animate. below are examples for the four different ways. animating attributes of an element the following example animates the cx attribute of a circle. to do so, we add an <animate> element inside the <circle> element. the important attributes for <animate> are: attributename the name of the attribute to animate.
... example 1: linear motion in this example, a blue circle bounces between the left and right edges of a black box, over and over again, indefinitely. the...
...h="15" height="34" fill="blue" stroke="black" stroke-width="1"> <animatetransform attributename="transform" begin="0s" dur="20s" type="rotate" from="0 60 60" to="360 100 60" repeatcount="indefinite" /> </rect> </svg> animation following a
path the <animatemotion> element lets you animate an element position and rotation according to a
path. the
path is defined the same way as in <
path>. ...
...And 7 more matches
io/file - Archive of obsolete content
experimental provides access to the local filesystem. usage
paths
path specifications in this api are platform-specific. this means that on windows
paths are specified using the backslash
path separator (\), and on unix-like systems like linux and os x
paths are specified using the forward slash
path separator (/). if your add-on uses literal windows-style
path specifications with this api, your add-on likely won't work when users run it on unix-like systems. likewise, if your add-on uses literal unix-style
path specifications, it won't work for users on windows. to ensure your add-on works for everyone, generate
paths using the join function. unfortunately this api does not currently provide a way to obtain an absolute base
path which you could then use with join. for now, you need t...
... users on windows. to ensure your add-on works for everyone, generate
paths using the join function. unfortunately this api does not currently provide a way to obtain an absolute base
path which you could then use with join. for now, you need to require("chrome") and use the xpcom directory service as described in this article about file i/o. note that if you do decide to hardcode windows-style
paths, be sure to escape backslashes in strings. for example, to specify the file at c:\users\myk, you need to use the string "c:\\users\\myk", not "c:\users\myk". read more about escaping characters in strings. globals functions basename(
path) the
path parameter must be an absolute
path, relative
paths will cause an error. use the fs/
path module for relative
path support. returns the last co...
...backslashes in strings. for example, to specify the file at c:\users\myk, you need to use the string "c:\\users\\myk", not "c:\users\myk". read more about escaping characters in strings. globals functions basename(
path) the
path parameter must be an absolute
path, relative
paths will cause an error. use the fs/
path module for relative
path support. returns the last component of the given
path. for example, basename("/foo/bar/baz") returns "baz". if the
path has no components, the empty string is returned. parameters
path : string the
path of a file. ...
...And 6 more matches
xml:base support in old browsers - Archive of obsolete content
'scheme' per http://www.ietf.org/rfc/rfc2396.txt' xmlbase = getxmlbase (thisitem); if (!xmlbase.match(/\/$/) && !xlink.match(/\/$/)) { // if no preceding slash on xlink or trailing slash on xml:base, add one in between xmlbase += '/'; } else if (xmlbase.match(/\/$/) && xlink.match(/\/$/)) { xmlbase = xmlbase.substring(0, xmlbase.length-2); // strip off last slash to join with xlink
path with slash } // alert(xmlbase + '::' + xlink); } var link = xmlbase + xlink; if (!link.match(scheme)) { // if there is no domain, we'll need to use the current domain var loc = window.location; if (link.indexof('/') === 0 ) { // if link is an absolute url, it should be from the host only link = loc.protocol + '//' + loc.host + link; } else { // if link is r...
... // var ns = 'http://www.w3.org/xml/1998/namespa...
... // var ns = 'http://www.w3.org/xml/1998/namespace'; var att, protocolpos; va...
...And 6 more matches
Code snippets - Archive of obsolete content
ing data. for each (let client in tabsengine.getallclients()) { for each (let tab in client.tabs) { let url = tab.urlhistory[0]; // load the tab via the tabbed browser api. ...
...ata. for each (let client in tabsengine.getallclients()) { for each (let tab in client.tabs) { let url = tab.urlhistory[0]; // load the tab via the tabbed browser api. ...
...each (let tab in client.tabs) { let url = tab.urlhistory[0]; // load the tab via the tabbed browser api. ...
...And 6 more matches
addFile - Archive of obsolete content
addfile unpacks a single subcomponent into a temporary location. queues the subcomponent for addition to the client version registry and installation to its final destination. ...
... addfile unpacks a single subcomponent into a temporary location. queues the subcomponent for addition to the client version registry and installation to its final destination. ...
...eues the subcomponent for addition to the client version registry and installation to its final destination. ...
...And 6 more matches
Manifest Files - Archive of obsolete content
one line in it: create a new directory somewhere. for example, on a windows machine, you might use c:\testfiles create a new ascii1 file called test.manifest in the chrome directory. it doesn't actually matter what the file is called as long as it has the .manifest extension. ( 1. doesn't work with utf-8 with bom.) add the following line to it: content tests file:///c:/testfiles/ the file
path in that line should point to the directory created above. if you aren't sure what the file
path is, open that directory in a browser and copy the url from the address field. that's it! now, all you need to do is add some xul files into that new directory, and you will be able to load them by typing in a chrome url of the form chrome://tests/content/<filename>. of course, you will need to restart ...
...th is, open that directory in a browser and copy the url from the address field. that's it! now, all you need to do is add some xul files into that new directory, and you will be able to load them by typing in a chrome url of the form chrome://tests/content/<filename>. of course, you will need to restart the browser for the changes to take effect. if the file doesn't load, make sure that the file
path is correct. the basic syntax of the lines in the manifest file for content packages is: 'content <packagename> <file
path>' the first field 'content' indicates a content package. for themes, 'skin' is used while 'locale' is used for locales. the packagename in the example above is 'tests', which means that the first field in the chrome url is 'tests' as in chrome://tests/content/sample.xul. if the...
...you can specify multiple packages by including another line in the manifest file. ...
...And 6 more matches
Setting up your own test automation environment - Learn web development
ction.) obviously, some of the browsers are os-specific, but we're going to stick with firefox and chrome, as they are available across all the main oses. download the latest geckodriver (for firefox) and chromedriver drivers. unpack them into somewhere fairly easy to navigate to, like the root of your home user directory. ...
...e os-specific, but we're going to stick with firefox and chrome, as they are available across all the main oses. download the latest geckodriver (for firefox) and chromedriver drivers. unpack them into somewhere fairly easy to navigate to, like the root of your home user directory. add the chromedriver and geckodriver driver's location to your system
path variable. ...
...this is a common mistake. ...
...And 6 more matches
IPDL Tutorial
rom each ipdl protocol. this generated code manages the details of the underlying communication layer (sockets and pipes), constructing and sending messages, ensuring that all actors adhere to their specifications, and handling many error conditions. the following ipdl code defines a very basic interaction of browser and plugin actors: async protocol pplugin { child: async init(nscstring plugin
path); async shutdown(); parent: async ready(); }; this code declares the pplugin protocol. two messages can be sent from the parent to the child, init() and shutdown(). one message can be sent from the child to the parent, ready(). ipdl protocols start with the letter p. the file in which the protocol is declared must have a matching name, pplugin.ipdl. generated c++ code when pplugin.ipdl ...
...rent.h, and ppluginchild.h will be generated in the ipc/ipdl/_ipdlheaders/ directory of the build tree. the ppluginparent and ppluginchild classes are abstract classes that must be subclassed. each outgoing message is a c++ method which can be called. ...
...ublic: bool sendinit(const nscstring& plugin
path) { // generated code to send an init() message } bool sendshutdown() { // generated code to send a shutdown() message } protected: /** * a subclass of ppluginparent must implement this method to handle the ready() message. */ bool recvready() = 0; }; class ppluginchild { protected: bool recvinit(const nscstring& plugin
path) = 0; bool recvshutdown() = 0; public: bool sendready() { // generated code to send a ready() message } }; these parent and child abstract classes take care of all the "protocol layer" concerns: serializing data, sending and receiving messages, and checking protocol safety. it is the responsibility of the implementor to create subclasses to perform the actual work involved in each me...
...And 6 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
num { 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 <dbdir
path> ", "[-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 <headerfilename> -i <ipfilename> -e <encryptfilename> | ", "-b <headerfilen...
... <headerfilename> -e <encryptfilename> -o <opfilename>"); fprintf(stderr, "%s %s\n --sign using private key \n\n", progname, "-s -b <headerfilename> -i <infilename> "); fprintf(stderr, "%s %s\n --verify using public key \n\n", progname, "-v -b <headerfilename> -i <ipfilename> "); fprintf(stderr, "options:\n\n"); fprintf(stderr, "%-30s - db directory
path\n\n", "-d <dbdir
path>"); fprintf(stderr, "%-30s - db password [optional]\n\n", "-p <dbpwd>"); fprintf(stderr, "%-30s - db password file [optional]\n\n", "-f <dbpwdfile>"); fprintf(stderr, "%-30s - noise file name [optional]\n\n", "-z <noisefilename>"); fprintf(stderr, "%-30s - input file name\n\n", "-i <ipfi...
...ir, 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 <dbdir
path> -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, ...
...And 6 more matches
NSS tools : modutil
key databases is not recommended. -installdir root-installation-directory specify the root installation directory relative to which files will be installed by the -jar option. this directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory. -libfile library-file specify a
path to a library file containing the implementation of the pkcs #11 interface module that is being added to the database. -mechanisms mechanism-list specify the security mechanisms for which a particular module will be flagged as a default provider. the mechanism-list is a colon-delimited list of mechanism names. enclose this list in quotati...
... installation file format”. the jar installation script defines the setup information for each platform that the module can be installed on. for example: platforms { linux:5.4.08:x86 { modulename { "example pkcs #11 module" } modulefile { crypto.so } defaultmechanismflags{0x0000} cipherenableflags{0x0000} files { crypto.so {
path{ /tmp/crypto.so } } setup.sh { executable
path{ /tmp/setup.sh } } } } linux:6.0.0:x86 { equivalentplatform { linux:5.4.08:x86 } } } both the install script and the required libraries must be bundled in a jar file, which is specified with the -jar argument. modutil -dbdir sql:/home/mt"jar-install-filey/shar...
...d mechanisms. multiple platforms can be defined in a single install file. ...
...And 6 more matches
CanvasRenderingContext2D.arcTo() - Web APIs
this method is commonly used for making rounded corners. note: be aware that you may get unexpected results when using a relatively large radius: the arc's connecting line will go in whatever direction it must to meet the specified radius. syntax void ctx.arcto(x1, y1, x2, y2, radius); parameters x1 the x-axis coordinate of the first control point. y1 the y-axis coordinate of the first control point. ...
...er from there to a second control point. without arcto(), these two segments would form a sharp corner: arcto() creates a circular arc that fits this corner and smooths is out. in other words, the arc is tangential to both segments. ...
...ar arc that fits this corner and smooths is out. in other words, the arc is tangential to both segments. ...
...And 6 more matches
mach
mach figures out how to execute the tests for you! 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. mach's logic for determining which mozconfig to use is effectively the following: if a .mozconfig file (some say it is the file mozconfig without the dot) exists in the cur...
...ts in the current directory, use that. if the mozconfig environment variable is set, use the file pointed to in that variable. if the current working directory mach is invoked with is inside an object directory, the mozconfig used when creating that object directory is used. the default mozconfig search logic is applied. here are some examples: # use an explicit mozconfig file. ...
...nted to in that variable. if the current working directory mach is invoked with is inside an object directory, the mozconfig used when creating that object directory is used. the default mozconfig search logic is applied. here are some examples: # use an explicit mozconfig file. $ mozconfig=/
path/to/mozconfig ./mach build # alternatively (for persistent mozconfig usage): $ export mozconfig=/
path/to/mozconfig $ ./mach build # let's pretend the mozconfig environment variable isn't set. ...
...And 5 more matches
Promise
chain failed to handle a rejection", there is likely something to be fixed in the code. see handling errors and common pitfalls below. documentation conventions in documentation, the type of the fulfillment value is usually specified between angular brackets. for example, the os.file.exists function returns a promise that will eventually fulfill with a boolean: promise<boolean> exists(string
path); the rejection reason may be specified separately in the function's documentation, and is considered to be an error object unless otherwise specified. method overview promise then([optional] function onfulfill, [optional] function onreject); promise catch([optional] function onreject); constructor creates a new promise, initially in the pending state, and provides r...
...e:value}}: fulfillment value or rejection reason, for fulfilled or rejected promises only. {{private:handlers}}: array of objects holding references to functions registered by the then() method, for pending promises only. examples see the examples page. ...
...jects holding references to functions registered by the then() method, for pending promises only. examples see the examples page. handling errors and common pitfalls you should report unhandled errors, unless you're handing off the promise to a caller or another code
path that will handle the error. // ###### wrong: silently drops any rejection notified by "os.file.exists". os.file.exists(
path).then(exists => { if (exists) myread(
path); }); // ###### wrong: silently drops any exception raised by "myread". ...
...And 5 more matches
Localizing without a specialized tool
.9.2 (a directory containing localization directories, one dir per localization; often referred to as "l10n base") x-testing (a directory with your localization files) please either follow this structure closely or adjust all commands in the documentation as needed by your custom set-up. get the source change your current directory to your working directory with the following command: $ cd /
path/to/your/working/directory first, you will need to check out the sources of mozilla-1.9.2 together with the en-us strings. assuming that you have installed mercurial, issue the following command: $ hg clone http://hg.mozilla.org/releases/mozilla-1.9.2 this will pull the mozilla 1.9.2 sources from the remote repository and create a mercurial clone in mozilla-1.9.2 inside your working directory. n...
...'s files and the en-us reference. first, install compare-locales. you can follow more detailed guidelines on compare-locale's page, but running the following command from the command line should be enough: $ sudo easy_install -u compare-locales to start, be sure to open your command line interface and change your directory to where you are keeping your localization files, the en-us sources $ cd /
path/to/your/working/directory now, you will need run compare locales. to do this, enter the following commands, keeping sure to change "x-testing" to the actual locale code of your locale. $ compare-locales mozilla-1.9.2/browser/locales/l10n.ini l10n-mozilla-1.9.2 x-testing for convenience, try saving the output of this command to a text file on your desktop so you can review it as you go. run: $ ...
... contains the string "manage search engines...". (strings in the dtd files are called "entities".) "manage search engines..." can easily be found in the firefox browser ui by clicking on the drop-down arrow in the search box in the upper-right corner of your browser. at the bottom of the list of search engines that appears, you'll see, "manage search engines...". to start, make sure you are in /
path/to/your/working/directory/l10n-mozilla-1.9.2/x-testing and then, type the command mkdir /browser/chrome/browser now, step back out to the broader directory that contains both your l10n base (l10n-mozilla-1.9.2) and the en-us source code (mozilla-1.9.2). you can do this by typing: cd ../../ where each ".." represents the prior sub directory before the main directory where you want to be. you ...
...And 5 more matches
Index
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. 135 ns_newlocalfile functions, functions:frozen, xpcom, xpcom api reference the ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file
path. 136 ns_newnativelocalfile functions, functions:frozen, xpcom, xpcom api reference the ns_newnativelocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file
path. 137 ns_realloc functions, functions:frozen, xpcom, xpcom api reference reallocates a block of memory using the xpcom memory manager. ...
...e as follows. 153 nscategorymanager components, components:frozen, xpcom, xpcom api reference the xpcom category manager. 154 nsdirectoryservice components, components:frozen, xpcom, xpcom api reference the xpcom directory service. this service returns the locations of "well known" directories in an os-independent manner. for instance, it can give you the
path of the system's temporary directory, desktop directory, current working directory, and so on. 155 nslocalfile components, components:frozen, xpcom, xpcom api reference a component implementing nsilocalfile. 156 nsobserverservice components, needscontent, reference, référence(2), xpcom the xpcom observer service. 157 nsscriptableinputstream ...
... interfaces:scriptable, mozilla, reference, xpcom, xpcom interface reference, xpcom:dom, nsidomwindowinternal it provides many of the common functions used in javascript such as alert() or open(). 526 nsidomwindowutils dom, interfaces, interfaces:scriptable, needscontent, xpcom interface reference implemented by: window. ...
...And 5 more matches
nsIURL
netwerk/base/public/nsiurl.idlscriptable this interface provides convenience methods that further break down the
path portion of nsiuri. ...
...tp://host/directory/filebasename.fileextension#ref http://host/directory/filebasename.fileextension;param \ \ / \ ----------------------- \ | / \ filename / ---------------------------- | file
path you can get a nsiurl from an nsiuri, using the queryinterface() method: var myuri = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice) .newuri("http://developer.mozilla.org", null, null); try { var myurl = myuri.queryinterface(components.interfaces.nsiurl); } catch(e) { // the uri is not an url }...
...ot an url } or using instanceof: if (myuri instanceof components.interfaces.nsiurl) { // your code here } method overview autf8string getcommonbasespec(in nsiuri auritocompare); autf8string getrelativespec(in nsiuri auritocompare); attributes attribute type description directory autf8string directory portion of a url. if the url denotes a
path to a directory and not a file, for example http://host/foo/bar/, then the directory attribute accesses the complete /foo/bar/ portion, and the filename is the empty string. if the trailing slash is omitted, then the directory is /foo/ and the file is bar (that is this is a syntactic, not a semantic breakdown of the
path). and hence don't rely on this for something to be a definitely be a file. bu...
...And 5 more matches
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
examples managing button focus this example draws two buttons on a canvas. the drawfocusifneeded() method is used to draw a focus ring when appropriate. ...
... examples managing button focus this example draws two buttons on a canvas. the drawfocusifneeded() method is used to draw a focus ring when appropriate. ...
... examples managing button focus this example draws two buttons on a canvas. the drawfocusifneeded() method is used to draw a focus ring when appropriate. ...
...And 5 more matches
Basic animations - Web APIs
function clock() { var now = new date(); var ctx = docu...
...clock() { var now = new date(); var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.save(); ctx.clearrect(0, 0, 150, 150); ctx.translate(75, 75); ctx.scale(0.4, 0.4); ctx.rotate(-math.pi / 2); ctx.strokestyle = 'black'; ctx.fillstyle = 'white'; ctx.linewidth = 8; ctx.linecap = 'round'; // hour marks ctx.save(); for (var i = 0; i < 12; i++) { ctx.begin
path(); ctx.rotate(math.pi / 6); ctx.moveto(100, 0); ctx.lineto(120, 0); ctx.stroke(); } ctx.restore(); // minute marks ctx.save(); ctx.linewidth = 5; for (i = 0; i < 60; i++) { if (i % 5!= 0) { ctx.begin
path(); ctx.moveto(117, 0); ctx.lineto(120, 0); ctx.stroke(); } ctx.rotate(math.pi / 30); } ctx.restore(); var sec = now.getseco...
... ctx.lineto(120, 0); ctx.stroke(); } ctx.rotate(math.pi / 30); } ctx.restore(); var sec = now.getseconds(); var min = now.getminutes(); var hr = now.gethours(); hr = hr >= 12 ? ...
...And 5 more matches
Writing forward-compatible websites - Developer guides
ally a particularly common instance of assuming that one feature (the presence of a particular substring in the user agent (ua) string) implies something about the presence or absence of other features. if you have to ua-sniff, only sniff for past browser versions if you have to resort to ua sniffing, only use it to target past browser versions of particular browsers. ...
...) implies something about the presence or absence of other features. if you have to ua-sniff, only sniff for past browser versions if you have to resort to ua sniffing, only use it to target past browser versions of particular browsers. first, have a default code
path that runs in unknown browsers and in the current and future versions of browsers you are testing with. then, if the default code
path doesn't work in past versions of particular browsers and the breakage cannot be detected by sniffing for the absence of certain features your default code
path uses, it's ok to add hacks that are targeted to old versions of particular browsers by sniffing for those old browser versions. for the purpose of this piece of advice, "current" means the most recent version of a browser you have tested.
...d the breakage cannot be detected by sniffing for the absence of certain features your default code
path uses, it's ok to add hacks that are targeted to old versions of particular browsers by sniffing for those old browser versions. for the purpose of this piece of advice, "current" means the most recent version of a browser you have tested. ...
...And 5 more matches
Set-Cookie - HTTP
eader type response header forbidden header name no forbidden response-header name yes syntax set-cookie: <cookie-name>=<cookie-value> set-cookie: <cookie-name>=<cookie-value>; expires=<date> set-cookie: <cookie-name>=<cookie-value>; max-age=<non-zero-digit> set-cookie: <cookie-name>=<cookie-value>; domain=<domain-value> set-cookie: <cookie-name>=<cookie-value>;
path=<
path-value> set-cookie: <cookie-name>=<cookie-value>; secure set-cookie: <cookie-name>=<cookie-value>; httponly set-cookie: <cookie-name>=<cookie-value>; samesite=strict set-cookie: <cookie-name>=<cookie-value>; samesite=lax set-cookie: <cookie-name>=<cookie-value>; samesite=none // multiple attributes are also possible, for example: set-cookie: <cookie-name>=<cookie-value>; domain=<domain-val...
... are allowed for <cookie-value> though. __secure- prefix: cookies names starting with __secure- (dash is part of the prefix) must be set with the secure flag from a secure page (https). __host- prefix: cookies with names starting with __host- must be set with the secure flag, must be from a secure page (https), must not have a domain specified (and therefore aren't sent to subdomains) and the
path must be /. expires=<date> optional the maximum lifetime of the cookie as an http-date timestamp. see date for the required formatting. if unspecified, the cookie becomes a session cookie. a session finishes when the client shuts down, and session cookies will be removed. warning: many web browsers have a session restore feature that will save all tabs and restore them next time the ...
...x-age has precedence. domain=<domain-value> optional host to which the cookie will be sent. if omitted, defaults to the host of the current document url, not including subdomains. contrary to earlier specifications, leading dots in domain names (.example.com) are ignored. multiple host/domain values are not allowed, but if a domain is specified, then subdomains are always included.
path=<
path-value> optional a
path that must exist in the requested url, or the browser won't send the cookie header. the forward slash (/) character is interpreted as a directory separator, and subdirectories will be matched as well: for
path=/docs, /docs, /docs/web/, and /docs/web/http will all match. secure optional a secure cookie is only sent to the server when a request is made with the https...
...And 5 more matches
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
note: references to svg in external files must be to the same origin as the referencing document. using embedded svg to apply an svg effect using css styles, you first need to create the css style that references the svg to apply. ...
...r adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam. </p> <p> lorem ipsum dolor sit amet, consectetur adipisicing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. ...
..., sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam. </p> <p> lorem ipsum dolor sit amet, consectetur adipisicing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. ...
...And 5 more matches
visibility - SVG: Scalable Vector Graphics
e set to hidden still might receive events. note: as a presentation attribute, visibility can be used as a css property. see the css visibility property for more information. ...
...as a presentation attribute, visibility can be used as a css property. see the css visibility property for more information. ...
... animatable yes visible this value indicates that the element will be painted. hidden this value indicates that the element will not be painted. though it is still part of the rendering tree, i.e. ...
...And 5 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
svgelement.style removed implementation status unknown svggraphicselement.gettransformtoelement() removed not removed yet svggraphicselement.getctm() on the outermost element implementation status unknown animval attribute alias of baseval implementation status unknown dataset attribute for svgelement implementation status unknown moved
pathlength attribute and gettotallength() and getpointatlength() methods from svg
pathelement to svggeometryelement implemented (bug 1239100) document structure change notes svgsvgelement.suspendredraw(), svgsvgelement.unsuspendredraw(), and svgsvgelement.unsuspendredrawall() deprecated turned into no-ops (bug 734079) externalresourcesrequired attribute r...
...(bug 1239218) lang attribute without namespace implemented (bug 721920) svgsvgelement.viewport removed never implemented xml:base attribute removed implementation status unknown reorder descendent elements of <switch> having systemlanguage attribute according to allowreorder smil attribute implementation status unknown made <tspan> and <text
path> graphics elements implementation status unknown allow x, y, width, and height on <symbol> implementation status unknown made <use> element shadow trees consistent with shadow dom spec implementation status unknown role mapping of <a> element depending on whether it is a valid link implementation status unknown aria state and property attributes ani...
...rveaspectratio attribute removed (bug 1280425) added non-scaling-size, non-rotation and fixed-position keywords for vector-effect property not implemented yet (bug 1318208) vector-effect has no effect within 3d rendering context implementation status unknown consider clip and overflow on svg document referenced by <image> implementation status unknown
paths change notes b and b
path commands implementation status unknown z and z
path commands to add
path coordinate data to previous command implementation status unknown not render <
path>, <polygon> and <polyline> with no data implementation status unknown svg
pathseg*, svganimated
pathdata and related methods removed from svg
pathelement ...
...And 5 more matches
Texts - SVG: Scalable Vector Graphics
by this degree. a list of numbers makes each character rotate to its respective value, with remaining characters rotating according to the last value. textlength this is a more obscure attribute giving the calculated length of the string. it is meant to allow the rendering engine to fine-tune the positions of the glyphs when its own measured text length doesn't meet the one provided here. ...
...respective value, with remaining characters rotating according to the last value. textlength this is a more obscure attribute giving the calculated length of the string. it is meant to allow the rendering engine to fine-tune the positions of the glyphs when its own measured text length doesn't meet the one provided here. ...
... to the last value. textlength this is a more obscure attribute giving the calculated length of the string. it is meant to allow the rendering engine to fine-tune the positions of the glyphs when its own measured text length doesn't meet the one provided here. ...
...And 5 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
ension development environment. create a development profile if you want to partition your everyday browsing environment from your development environment in firefox, set up a second profile for development. to create this dev profile start firefox with firefox.exe -no-remote -p dev on the first start the profile manager will appear, where you can create the dev profile and configure its home-
path. change your preferences for more efficient development before you get to work developing your extension, you’ll want to change some of your firefox preferences. this isn’t a requirement for extension development, but i recommend it as a way to work more efficiently. preference description value nglayout.debug.disable_xul_cache (not present in firefox 3.5+)...
...in the gui, including style sheets and images. most extensions include only one skin package, but you can include multiple skin packages to allow the gui to change with different themes. chrome url use a file called a “chrome manifest” to register chrome packages with firefox and start using them. to register a package, you use a special uri scheme called a “chrome url” to represent the
path to the file. chrome urls are structured as: chrome://%package name%/%package type%/%relative
path to source file% for example, the chrome url for the firefox browser window is as follows: chrome://browser/content/browser.xul here, the package name is “browser”, the file “browser.xul”, and the type of the package is “content”. source files represented through chrome urls run with u...
...nifest file as shown in listing 2. listing 2: content for chrome.manifest content helloworld content/ overlay chrome://browser/content/browser.xul chrome://helloworld/content/overlay.xul register the content package (content instruction) line 1, beginning content, contains the code used to register the chrome’s content package. here, helloworld is a package name, and content/ is a relative
path to the folder where the source file is stored. registering the content package makes it so that the overlay.xul file in the content folder can be accessed using the chrome url, chrome://helloworld/content/overlay.xul. xul cross-package overlay (overlay instruction) line 2, beginning overlay, contains the code used to invoke the cross-package overlay, overlaying the firefox browser window, at ch...
...And 4 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
tion on the initialization process. verifying the target the first thing the installation script does when it's executed is to check that there is adequate disk space for the software to be installed, where the verifydiskspace function is called as a condition of the main installation block that starts at line 24). ...
...ipt does when it's executed is to check that there is adequate disk space for the software to be installed, where the verifydiskspace function is called as a condition of the main installation block that starts at line 24). ...
...adequate disk space for the software to be installed, where the verifydiskspace function is called as a condition of the main installation block that starts at line 24). ...
...And 4 more matches
Error codes returned by Mozilla APIs
) ns_error_illegal_during_shutdown (0x8046001e) many operations cannot be performed once the application is being shutdown. this error will occur in this situation. file errors the following table lists the errors that could occur when using files. while these errors can occur when using the file apis, they can also occur with other components that use files. ns_error_file_unrecognized_
path (0x80520001) this error occurs when an attempt is made to set a
path that isn't valid for the platform. for example, if a character in the
path is not valid for a filename. in addition, this error may occur when a relative
path is supplied to a method that expects an absolute
path and vice versa. ns_error_file_unresolvable_symlink (0x80520002) an attempt was made to access a symbolic link to a...
... is not a directory. ns_error_file_target_does_not_exist (0x80520006) an attempt was made to reference a file that does not exist for copy/move, checking its size, etc. ns_error_file_copy_or_move_failed (0x80520007) a call to nsifile.copyto() or nsifile.moveto() failed. ns_error_file_already_exists (0x80520008) an attempt was made to create a file that already exists. ns_error_file_invalid_
path (0x80520009) this error occurs when an attempt is made to use a
path that isn't valid for the platform. ns_error_file_disk_full (0x8052000a) this error will occur if attempting to write to a disk that is full. ns_error_file_corrupted (0x8052000b) indicates that an attempt was made to open or access a file that has been corrupted, or that the format of a file is unknown. this error might occu...
...se it is locked, typically because the file is already being used by another application. ns_error_file_too_big (0x8052000f) this error occurs when nsifile.createunique() cannot create a file with a unique filename. this indicates that too many files have been created already. ns_error_file_no_device_space (0x80520010) ns_error_file_name_too_long (0x80520011) indicates that a file name or
path is larger than the platform can handle. ns_error_file_not_found (0x80520012) an attempt was made to access a file that does not exist. use nsifile.exists() to check if the file exists beforehand. ns_error_file_read_only (0x80520013) an attempt was made to create or write to a file or directory that is read only. this might happen if the file is not writable, the directory containing the file ...
...And 4 more matches
Addon
operties before relying on them. overview of required methods void iscompatiblewith(in string appversion, in string platformversion) void findupdates(in updatelistener listener, in integer reason, in string appversion, in string platformversion) overview of optional methods void uninstall() void canceluninstall() boolean hasresource(in string
path) nsiuri getresourceuri(in string
path) void getdatadirectory(in datadirectorycallback callback) required properties attribute type description appdisabled read only boolean true if this add-on cannot be used in the application based on version compatibility, dependencies, and blocklisting. blockliststate read only integer t...
... error if an error has occured, an error object relevant to the error, othereise null. required methods iscompatiblewith() tests whether this add-on is known to be compatible with a particular applicati...
...ly string totaldownloads read only integer weeklydownloads read only integer dailyusers read only integer repositorystatus read only integer callbacks datadirectorycallback() a callback which is passed a directory
path, and, when an error has occured, an error object. void datadirectorycallback( in string
path, in error error ) parameters
path a string representation of the addon's data directory. error if an error has occured, an error object relevant to the error, othereise null. required methods iscompatiblewith() tests whether this add-on is known to be compatible with a particular application and platform version. void iscompatiblewith( in string appversion, in string platformver...
...And 4 more matches
Using JavaScript code modules
l continue to work but any subsequent import of the module will reload it and give a new reference. examples a template to download and edit is seen here on github - gists - _template-bootstrapjsm.xpi extending resource: urls prior to gecko 2.0, the most common way to load code modules was using resource: urls. ...
...code modules are simple javascript files with a .js or .jsm extension. ...
...is an alias to a location, usually a physical location relative to the application or xul runtime. there are multiple pre-defined aliases set up by the xul runtime: app - alias to the location of the xul application gre - alias to the location of the xul runtime the <relative-
path> can be multiple levels deep and is always relative to the location defined by the <alias>. the common relative
path is "modules" and is used by xul runner and firefox. code modules are simple javascript files with a .js or .jsm extension. <alias> must be unique to your add-on, as the application and other extensions share the same namespace for all aliases. using chrome.manifest the easiest way for extensions and xul applications to add custom aliases is by registering an alias in the chrome manifest using ...
...And 4 more matches
Application Translation with Mercurial
ble. if it is a red text consisting of a number and the word 'missing', then there are untranslated texts and you can move on with this guide. required tools build pre-requisites first, get the required programs to compile mozilla applications like firefox and thunderbird from build instructions. this is only necessary once. mozillabuild must be installed into an absolute file
path without whitespaces, else it will break. file comparison program for the translation, it is recommend to use file comparison program to compare the english file (containing the new texts) with the file of your locale (which is still missing the new strings). this example uses winmerge: download and install it. a comparison of alternatives (e.g. for linux and mac os) is available on wikipedia. ...
.... comm-aurora.hg) from https://ftp.mozilla.org/pub/mozilla.org/thunderbird/bundles/ in the next step, we will unpack the source code: open an input shell, e.g. by pressing the windows key and r on the keyboard or by calling the "run..." command from the windows "start" button, and then typing cmd and pressing the enter key. launch the installed mozillabuild toolset by launching it with its
path, e.g. c:\mozilla\coding\buildtools\mozillabuild\start-shell-msvc2010.bat you can autocomplete the file
path after typing a few characters and then pressing the tabulator key. if you launch the start-shell-l10n.bat, compiling features will be disabled. you can create translation patches, but creating language packs for the application, binary repacks of the application (changing the localization...
...ing language packs for the application, binary repacks of the application (changing the localization of the program), and compiling the application likely won't work. you are now in the mozilla development environment which emulates a linux environment. now go to the directory where you want to put the source code. it's highly recommended to put it onto the fastest hard drive in the device. file
paths here work starting with a slash (/) followed by the drive letter, and then the directory structure like on windows, but using slashes (/) instead of backslashes (\). so let's go to c:\mozilla by typing cd /c/mozilla/ create a new directory for the source code: mkdir mozilla-aurora initialize the new directory as new repository: hg init mozilla-aurora go into the new directory: cd mozi...
...And 4 more matches
Profiling with Xperf
soft windows performance toolkit already exists. ...
...d to do a registry tweak and then restart to enable stack walking: reg add "hklm\system\currentcontrolset\control\session manager\memory management" -v disablepagingexecutive -d 0x1 -t reg_dword -f symbol server setup with the latest versions of the windows performance toolkit, you can modify the symbol
path directly from within the program via the trace menu. just make sure you set the symbol
paths before enabling "load symbols" and before opening a summary view. ...
...t\control\session manager\memory management" -v disablepagingexecutive -d 0x1 -t reg_dword -f symbol server setup with the latest versions of the windows performance toolkit, you can modify the symbol
path directly from within the program via the trace menu. just make sure you set the symbol
paths before enabling "load symbols" and before opening a summary view. you can also modify the _nt_symbol_
path and _nt_symcache_
path environment variables to make these changes permanent. ...
...And 4 more matches
NSS Tools modutil
efaults to the user's netscape directory. windows nt has no default directory, so -dbdir must be used to specify a directory. -dbprefix prefix specify the prefix used on the cert8.db and key3.db files (for example, my_cert8.db and my_key3.db). this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -libfile library-file specify a
path to the dll or other library file containing the implementation of the pkcs #11 interface module that is being added to the database. -ciphers cipher-enable-list enable specific ciphers in a module that is being added to the database. the cipher-enable-list is a colon-delimited list of cipher names. enclose this list in quotation marks if it contains spaces. the following cipher is currently ava...
... this: + pkcs11_install_script: pk11install the sample script file could contain the following: forwardcompatible { irix:6.2:mips sunos:5.5.1:sparc }platforms { winnt::x86 { modulename { "fortezza module" } modulefile { win32/fort32.dll } defaultmechanismflags{0x0001} defaultcipherflags{0x0001} files { win32/setup.exe { executable relative
path { %temp%/setup.exe } } win32/setup.hlp { relative
path { %temp%/setup.hlp } } win32/setup.cab { relative
path { %temp%/setup.cab } } } } win95::x86 { equivalentplatform {winnt::x86} } sunos:5.5.1:sparc { modulename { "fortezza unix module" } modulefile { unix/fort.so } defaultmechanismflags{0x0001} c...
...h { %temp%/setup.hlp } } win32/setup.cab { relative
path { %temp%/setup.cab } } } } win95::x86 { equivalentplatform {winnt::x86} } sunos:5.5.1:sparc { modulename { "fortezza unix module" } modulefile { unix/fort.so } defaultmechanismflags{0x0001} cipherenableflags{0x0001} files { unix/fort.so { relative
path{%root%/lib/fort.so} absolute
path{/usr/local/netscape/lib/fort.so} filepermissions{555} } xplat/instr.html { relative
path{%root%/docs/inst.html} absolute
path{/usr/local/netscape/docs/inst.html} filepermissions{555} } } } irix:6.2:mips { equivalentplatform { sunos:5.5.1:sparc } }} script grammar the...
...And 4 more matches
Running Automated JavaScript Tests
sometimes jstests are called js reftests because of how they are run in the browser. both sets of tests can be used from a normal build of the js shell. (some js reftests will be skipped when run in the browser, as it lacks some shell-specific testing functionality.) running jstests running jstests on a js shell the jstests shell harness is js/src/tests/jstests.py. ...
...ing jstests on a js shell the jstests shell harness is js/src/tests/jstests.py. basic usage is: jstests.py
path_to_js_shell or using mach: ./mach jstests note that mach will generally find the js shell itself; the --shell argument can be used to specify the location manually. all other flags will be passed along to the harness. developers will often want to use the -d option: jstests.py -d
path_to_js_shell the -d option skips tests that are marked as randomly failing; random failures are usually just noise when being run for day-to-day developer testing. another common use case is to run just one test, or all the tests in just one directory: jstests.py
path_to_js_shell test_
path_substring [ test_
path_substring_2 ... ] this runs all the tests whose
paths contain test_
path_substring. ...
...mon use case is to run just one test, or all the tests in just one directory: jstests.py
path_to_js_shell test_
path_substring [ test_
path_substring_2 ... ] this runs all the tests whose
paths contain test_
path_substring. thus, you can run one test by giving its filename, or any substring that is a substring of that test filename only. you can run all tests in a directory by giving the directory
path. you can run three specific tests by giving the three names. or you can run all but selected tests with the --exclude option. now that the full set of test262 tests is included in the tree, jstests take a long time to complete. ...
...And 4 more matches
Starting WebLock
's nsimodule::registerself method is called. this callback allows the component to execute any one-time registration code it may need. the inverse of this function is the unregistration callback, where it's a good idea to undo whatever the registration function did. ...
...did. the two functions look like this: static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *a
path, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info); static ns_method weblockunregistration(nsicomponentmanager *acompmgr, nsifile *a
path, const char *registrylocation, const nsmodulecomponentinfo *info); the names of the functions can be anything you wish. both functions are passed the component manager and the
path to the component, including the opaque registrylocation. these are also parameters in the nsimodule implementation in xxx what is example 1? link to it hereexample 1. in ad...
... 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 *a
path, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return rv; nscomptr<nsicategorymanager> catman; rv = servma...
...And 4 more matches
nsIURI
se further structure on the uri. ...
...er structure on the uri. ...
...ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); return ioservice.newuri(aurl, aorigincharset, abaseuri); } components of a uri pre
path path scheme userpass host port ref ftp :// username@password @ hostname : portnumber /
pathname?query=value #ref method overview nsiuri clone(); nsiuri cloneignoringref(); boolean equals(in nsiuri other); boolean equalsexceptref(in nsiuri other); autf8string resolve(in autf8string relative
path); boolean schemeis(in string scheme); attributes attribute type description asciihost acstring...
...And 4 more matches
FileSystemDirectoryEntry.getDirectory() - Web APIs
the filesystemdirectoryentry interface's method getdirectory() returns a filesystemdirectoryentry object corresponding to a directory contained somewhere within the directory subtree rooted at the directory on which it's called. syntax filesystemdirectoryentry.getdirectory([
path][, options][, successcallback][, errorcallback]); parameters
path optional a usvstring representing an absolute
path or a
path relative to the directory on which the method is called, describing which directory entry to return. absolute
paths may not be able to be used, for security reasons. options optional an object based on the filesystemflags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an error if the file already exists. these options are curre...
...rror which occurred. return value undefined. errors if an error occurs and an errorcallback was specified, it gets called with a single parameter: a fileerror object describing the error. the fileerror.code specifies what type of error occurred, as follows: fileerror.not_found_err the create option was not specified (or was specified as false), and the directory doesn't exist. ...
... specified (or was specified as false), and the directory doesn't exist. fileerror.
path_exists_err the create and exclusive options were both true, indicating that the directory should be created but must not already exist, but the directory does in fact already exist. fileerror.security_err the request to access the directory was denied for security reasons. fileerror.type_mismatch_err the
path specified is not a directory; it's probably a file, but might be an unsupported file descriptor such as a pipe; this depends on the user agent to some extent. filesystemflags the options parameter is an object which is based on the filesystemflags dictionary; it provides flags which make it possible to adjust the behavior of the getdirectory() method. create optional if this property is tr...
...And 4 more matches
FileSystemDirectoryEntry.getFile() - Web APIs
} the filesystemdirectoryentry interface's method getfile() returns a filesystemfileentry object corresponding to a file contained somewhere within the directory subtree rooted at the directory on which it's called. syntax filesystemdirectoryentry.getfile([
path][, options][, successcallback][, errorcallback]); parameters
path optional a usvstring specifying the
path, relative to the directory on which the method is called, describing which file's entry to return. options optional an object based on the filesystemflags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an error if the file already exists. these options are currently not useful in web contexts. successcallback optional a method to be called once the filesystemfilee...
...h occurred. return value undefined. errors if an error occurs and an errorcallback was specified, it gets called with a single parameter: a fileerror object describing the error. the {domxref("fileerror.code")}} specifies what type of error occurred, as follows: fileerror.not_found_err the create option was not specified (or was specified as false), and the file doesn't exist. ...
...reate option was not specified (or was specified as false), and the file doesn't exist. fileerror.
path_exists_err the create and exclusive options were both true, indicating that the file should be created but must not already exist, but the file does in fact already exist. fileerror.security_err the request to access the file was denied for security reasons. fileerror.type_mismatch_err the
path specified is not a file; it's probably a directory, but might be an unsupported file descriptor such as a pipe; this depends on the user agent to some extent. filesystemflags the options parameter is an object which is based on the filesystemflags dictionary; it provides flags which make it possible to adjust the behavior of the getfile() method. create optional if this property is true, a...
...And 4 more matches
<basic-shape> - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax the <basic-shape> data type is defined with one of the basic shape functions listed below. when creating a shape, the reference box is defined by each property that uses <basic-shape> values. the coordinate system for the shape has its origin at the top-left corner of the reference box, with the x-axis running to the right and the y-axis running downwards. ...
...e. this defaults to center if omitted. polygon() polygon( [<fill-rule>,]? [<shape-arg> <shape-arg>]# ) <fill-rule> represents the filling rule used to determine the interior of the polygon. possible values are nonzero and evenodd. default value when omitted is nonzero. each pair argument in the list represents xi and yi - the x and y axis coordinates of the ith vertex of the polygon. ...
...faults to center if omitted. polygon() polygon( [<fill-rule>,]? [<shape-arg> <shape-arg>]# ) <fill-rule> represents the filling rule used to determine the interior of the polygon. possible values are nonzero and evenodd. default value when omitted is nonzero. each pair argument in the list represents xi and yi - the x and y axis coordinates of the ith vertex of the polygon. ...
...And 4 more matches
offset-anchor - CSS: Cascading Style Sheets
the offset-anchor css property specifies the point inside the box of an element travelling along an offset-
path that is actually moving along the
path. ...
... <position> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in bac...
...| center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples setting various offset-anchor values in the following example, we have three <div> elements nested in <section> elements. each <div> is given the same offset-
path (a horizontal line 200 pixels long) and animated to move along it. the three are then given different background-color and offset-anchor values. each <section> has been styled with a linear gradient to give it a horizontal line running through its center, to give you a visual display of where the <div>'s offset
paths are running. this allows you to see what effect the different offset-anchor v...
...And 4 more matches
Using HTTP cookies - HTTP
creating cookies after receiving an http request, a server can send one or more set-cookie headers with the response. the cookie is usually stored by the browser, and then the cookie is sent with requests made to the same server inside a cookie http header. an expiration date or duration can be specified, after which the cookie is no longer sent. additional restrictions to a specific domain and
path can be set, limiting where the cookie is sent. for details about the header attributes mentioned below, refer to the set-cookie reference article. the set-cookie and cookie headers the set-cookie http response header sends cookies from the server to the user agent. a simple cookie is set like this: set-cookie: <cookie-name>=<cookie-value> this shows the server sending headers to tell the clie...
...ument.cookie api; it is sent only to the server. for example, cookies that persist server-side sessions don't need to be available to javascript, and should have the httponly attribute. this precaution helps mitigate cross-site scripting (xss) attacks. here is an example: set-cookie: id=a3fwa; expires=wed, 21 oct 2021 07:28:00 gmt; secure; httponly define where cookies are sent the domain and
path attributes define the scope of the cookie: what urls the cookies should be sent to. domain attribute the domain attribute specifies which hosts are allowed to receive the cookie. if unspecified, it defaults to the same origin that set the cookie, excluding subdomains. if domain is specified, then subdomains are always included. therefore, specifying domain is less restrictive than omitting it. ...
... it defaults to the same origin that set the cookie, excluding subdomains. if domain is specified, then subdomains are always included. therefore, specifying domain is less restrictive than omitting it. however, it can be helpful when subdomains need to share information about a user. for example, if domain=mozilla.org is set, then cookies are available on subdomains like developer.mozilla.org. ...
...And 4 more matches
eval() - JavaScript
y here. in fact, its use here is discouraged. instead, use the property accessors, which are much faster and safer: var obj = { a: 20, b: 30 }; var propname = getpropname(); // returns "a" or "b" var result = obj[ propname ]; // obj[ "a" ] is the same as obj.a you can even use this method to access descendant properties. ...
...t, its use here is discouraged. instead, use the property accessors, which are much faster and safer: var obj = { a: 20, b: 30 }; var propname = getpropname(); // returns "a" or "b" var result = obj[ propname ]; // obj[ "a" ] is the same as obj.a you can even use this method to access descendant properties. ...
...s, which are much faster and safer: var obj = { a: 20, b: 30 }; var propname = getpropname(); // returns "a" or "b" var result = obj[ propname ]; // obj[ "a" ] is the same as obj.a you can even use this method to access descendant properties. using eval() this would look like: var obj = {a: {b: {c: 0}}}; var prop
path = getprop
path(); // returns e.g. ...
...And 4 more matches
clip-rule - SVG: Scalable Vector Graphics
« svg attribute reference home the clip-rule attribute only applies to graphics elements that are contained within a <clip
path> element. the clip-rule attribute basically works as the fill-rule attribute, except that it applies to <clip
path> definitions. the following fragment of code will cause an evenodd clipping rule to be applied to the clipping
path because clip-rule is specified on the <
path> element that defines the clipping shape: <g> <clip
path id="myclip"> <
path d="..." clip-rule="evenodd" /> </clip
path> <rect clip-
path="url(#myclip)" ... /> </g> whereas the following fragment of code will not cause an evenodd clipping rule to be applied because the clip-rule is specified on the referencing element, not on the object defining the clipping shape: <g> ...
...element that defines the clipping shape: <g> <clip
path id="myclip"> <
path d="..." clip-rule="evenodd" /> </clip
path> <rect clip-
path="url(#myclip)" ... /> </g> whereas the following fragment of code will not cause an evenodd clipping rule to be applied because the clip-rule is specified on the referencing element, not on the object defining the clipping shape: <g> <clip
path id="myclip"> <
path d="..." /> </clip
path> <rect clip-
path="url(#myclip)" clip-rule="evenodd" ... /> </g> as a presentation attribute, it also can be used as a property directly inside a css stylesheet usage context categories presentation attribute value nonzero | evenodd | inherit animatable yes normative document svg 1.1 (2nd e...
...xt categories presentation attribute value nonzero | evenodd | inherit animatable yes normative document svg 1.1 (2nd edition) nonzero see description of fill-rule property. evenodd see description of fill-rule property. ...
...And 4 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
//gre/modules/services.jsm"); from here on out, it is assumed you've imported services.jsm somewhere at the top of whatever file you're in and will be using it in all code examples. the examples will also assume that you know how to properly add instructions to your add-on's chrome.manifest to add and remove resource, chrome, locale, & etc. ...
...ol, which is not particularly fantastic (just the static file contents, not any loaded script/data). step 2a: load your jsm from chrome:// now with that preface out of the way, this part is easy: drop support for firefox 3.x if you haven't already, move your jsm files to wherever you've got your chrome mapping to for your xul overlay and/or windows, import your files from that new chrome mapped
path instead of the old resource one, and remove your "resource" line from your chrome.manifest file. it's probably a good idea to do this even if you aren't going fully restartless / extractionless due to the previously mentioned exposure to content of resource mappings. also, drop support for firefox 4 through 9 while you're at it. prior to firefox 10, the chrome.manifest file you rely on wasn't lo...
...les internal to your bundle will not be possible using the nsifile interface. if you need to read data, or otherwise access files within your bundle, there are two options. the first is to use the nsizipreader interface which permits continuing to use nsiinputstreams, etc. the second is to re-code to use xmlhttprequest. a file:// uri to the install location, or .xpi file, is available in install
path property of the bootstrap data structure passed to the startup(), shutdown(), install(), and uninstall() functions in what will be your bootstrap.js file (see below). how to get and load the data of of your add-on's files using the add-on manager api: // this is the old way of getting one of your files const myaddonid = ...; // just store a constant with your id components.utils.import("resour...
...And 3 more matches
Install.js - Archive of obsolete content
install.profile_chrome : install.delayed_chrome; // register content install.re...
...install.profile_chrome : install.delayed_chrome; // register content install.registerchrome(install.content | installty...
... your profile directory (ok) or your browser directory (cancel)?'); } // init install var dispname = this.extfullname + ' ' + this.extversion; var regname = '/' + this.extauthor + '/' + this.extshortname; install.initinstall(dispname, regname, this.extversion); // find directory to install into var install
path; if (this.profileinstall) install
path = profiledir; else install
path = install.getfolder('chrome'); // add jar file install.addfile(null, 'chrome/' + jarname, install
path, null); // register chrome var jar
path = install.getfolder(install
path, jarname); var installtype = this.profileinstall ? install.profile_chrome : install.delayed_chrome; // register content install.registerchrome(install.content | installtype, jar
path, 'content/' + this.ex...
...And 3 more matches
Running Tamarin acceptance tests - Archive of obsolete content
the tamarin acceptance tests can be used to verify your installation and or local changes that you have made to the source. to run acceptance tests on the android shell see the "testing the android shell" heading below. running the tamarin test suite requires the following steps: set the avm environment variable to the
path of the avmplus executable (avmshell). note: the name of the avmshell executable varies among the build systems; use the name of the avm shell produced from the build process you used, above. set the builtinabc environment variable to the
path of the generated/builtin.abc. you may build the .abc files build by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.j...
...uiltin.abc. you may build the .abc files build by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. set the asc environment variable, as described above. set the shellabc environment variable to the
path of the generated/shell_toplevel.abc. $ cd tamarin-redux/test/acceptance $ export asc=/users/build/hg/tamarin-redux/utils/asc.jar $ export builtinabc=/users/build/hg/tamarin-redux/generated/builtin.abc $ export shellabc=/users/build/hg/tamarin-redux/generated/shell_toplevel.abc $ export avm=/users/build/hg/tamarin-redux/objdir-release/shell/avmshell $ python runtests.py tamarin tests started: 201...
...ith the threads flag: python ./runtests.py --threads=3 threading on cygwin / windows due to an issue with cygwin python, threading does not work, and threads will always be set to 1. in order to use threading on windows you must install windows python and invoke runtests using that python executable in cygwin. the locations of avm, asc, builtinabc and shellabc must also be defined using windows
paths (replace backslashes [\] with forward slashes [/]): export avm=c:/location/of/avmshell.exe export asc=c:/location/of/asc.jar ... c:/python26/python.exe ./runtests.py --threads=3 other flags of interest (for a list of all flags, run runtests.py with -h/--help) --nohtml : will suppress the creation of an html output file --rebuildtests : will only rebuild test .abc's, will not attempt to run them.
...And 3 more matches
XML in Mozilla - Archive of obsolete content
support is very good with few bugs. dtds and other external entities mozilla does not load external entities from the web. mozilla can load external entities whose system identifier uses the chrome protocol. this feature is used mainly to localize mozilla to different languages (the ui strings are stored in external dtd files). another exception is an entity whose system identifier is a relative
path, and the xml declaration states that the document is not standalone (default), in which case mozilla will try to look for the entity under <bin>/res/dtd directory. mozilla may also make an exception with xhtml documents, see below. mozilla will read internal (dtd) subsets, and in special circumstances external dtds as explained above and will use this information to recognize id type attributes, ...
...we treat xhtml documents differently depending on the mime type (or file suffix if files are loaded from local discs). files that go through the html cod...
...) scheme obsolete since gecko 1.9.1 internet-draft document.load(), document.async part of dom level 3 load & save module, a w3c working draft xhtml we have reasonable xhtml support, most things should work. we treat xhtml documents differently depending on the mime type (or file suffix if files are loaded from local discs). ...
...And 3 more matches
Windows Install - Archive of obsolete content
windows install example this example shows the installation of a xpi in which user profile information is contained. note the disk space verification, the editing of the windows registry, the writing to the installation log, and the error checking before either performinstall or cancelinstall is called. ...
...ch user profile information is contained. note the disk space verification, the editing of the windows registry, the writing to the installation log, and the error checking before either performinstall or cancelinstall is called. ...
...sk space verification, the editing of the windows registry, the writing to the installation log, and the error checking before either performinstall or cancelinstall is called. ...
...And 3 more matches
XPCOM Interfaces - Archive of obsolete content
interface. this also has the side effect of calling queryinterface(), so afile will be a valid nsilocalfile afterwards. calling the functions of an interface now that we have an object that refers to a component with the nsilocalfile interface, we can call the functions of nsilocalfile through it. the table below shows some of the properties and methods of the nsilocalfile interface. initwith
path this method is used to initialize the
path and filename for the nsilocalfile. the first parameter should be the file
path, such as '/usr/local/mozilla'. leafname the filename without the directory part. filesize the size of the file. isdirectory() returns true if the nsilocalfile represents a directory. remove(recursive) deletes a file. if the recursive parameter is true, a director...
... directory, optionally renaming the file. the directory should be a nsilocalfile holding the directory to copy the file to. moveto(directory,newname) moves a file to another directory, or renames a file. the directory should be a nsilocalfile holding the directory to move the file to. in order to delete a file we first need to assign a file to the nsilocalfile. ...
... should be a nsilocalfile holding the directory to copy the file to. moveto(directory,newname) moves a file to another directory, or renames a file. the directory should be a nsilocalfile holding the directory to move the file to. in order to delete a file we first need to assign a file to the nsilocalfile. we can call the method initwith
path() to indicate which file we mean. just assign the
path of the file to this property. ...
...And 3 more matches
The First Install Problem - Archive of obsolete content
browsers installed later can find their plugins. on linux, a per-profile installation of plugins seems unavoidable. this document presents windows solutions for plugin vendors. the solution suggests that plugin vendors ought to leave dlls on a windows desktop whether or not a netscape gecko browser is detected, and then write keys in the windows registry giving future netscape gecko browsers the
path where the plugin resides and meta-information about how to load the plugin. this document supplements the key parsing methodology suggested for installers. the solution is to encourage plugin vendors to write registry keys to the win32 system registry, like the example application. this document proposes a meta-information model in the win32 registry similar to the one used by microsoft's hkey_cl...
...gins registered using the hkey_current_user\software\mozillaplugins\ tree are ignored by firefox (bug 293062) but this is fixed in trunk builds (bug 293062). add the following values to the newly created key -- some are string values (reg_sz), and some are actually subkeys. string values take the form stringvalue=valuedata, and subkeys contain their own string values and value data. ...
...\mozillaplugins\ tree are ignored by firefox (bug 293062) but this is fixed in trunk builds (bug 293062). add the following values to the newly created key -- some are string values (reg_sz), and some are actually subkeys. string values take the form stringvalue=valuedata, and subkeys contain their own string values and value data. "
path" -- string value -- this would be the absolute
path to the plugin module. ...
...And 3 more matches
Move the ball - Game development
nes, and add the following below them. the draw() function will be executed within setinterval every 10 miliseconds: function draw() { // drawing code } setinterval(draw, 10); thanks to the infinite nature of setinterval the draw() function will be called every 10 milliseconds forever, or until we stop it. now, let's draw the ball — add the following inside your draw() function: ctx.begin
path(); ctx.arc(50, 50, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.close
path(); try your updated code now — the ball should be repainted on every frame. making it move you won't notice the ball being repainted constantly at the moment, as it's not moving. let's change that. first, instead of a hardcoded position at (50,50) we will define a starting point at the bottom center p...
... of the canvas in variables called x and y, then use those to define the position the circle is drawn at. first, add the following two lines above your draw() function, to define x and y: var x = canvas.width/2; var y = canvas.height-30; next update the draw() function to use the x and y variables in the arc() method, as shown in the following highlighted line: function draw() { ctx.begin
path(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.close
path(); } now comes the important part: we want to add a small value to x and y after every frame has been drawn to make it appear that the ball is moving. let's define these small values as dx and dy and set their values to 2 and -2 respectively. add the following below your x and y variable def...
...dx and dy and set their values to 2 and -2 respectively. add the following below your x and y variable definitions: var dx = 2; var dy = -2; the last thing to do is to update x and y with our dx and dy variable on every frame, so the ball will be painted in the new position on every update. add the following two new lines indicated below to your draw() function: function draw() { ctx.begin
path(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.close
path(); x += dx; y += dy; } save your code again and try it in your browser. this works ok, although it appears that the ball is leaving a trail behind it: clearing the canvas before each frame the ball is leaving a trail because we're painting a new circle on every frame without remov...
...And 3 more matches
Browser chrome tests
s all tests, they won't work in a build with tests disabled (--disable-tests). running the browser chrome tests to run mochitest, first build mozilla with your changes; then run ./mach mochitest -f browser this will launch your build and open a "browser chrome tests" window, and report the results in the ui and to stdout. it is possible to run specific groups of tests. ...
... build with tests disabled (--disable-tests). running the browser chrome tests to run mochitest, first build mozilla with your changes; then run ./mach mochitest -f browser this will launch your build and open a "browser chrome tests" window, and report the results in the ui and to stdout. it is possible to run specific groups of tests. ...
...chrome tests to run mochitest, first build mozilla with your changes; then run ./mach mochitest -f browser this will launch your build and open a "browser chrome tests" window, and report the results in the ui and to stdout. it is possible to run specific groups of tests. as with mochitest, the
path given as an argument is the
path to a test or directory within the mozilla source tree. if the
path points to a directory, then the tests in that directory and all of its subdirectories will be run. ...
...And 3 more matches
Configuring Build Options
manually call configure with command-line options, but this is not recommended). the mozconfig file should be in your source directory (that is, /mozilla-central/mozconfig or /comm-central/mozconfig). create a blank mozconfig file: echo "# my first mozilla config" > mozconfig if your mozconfig isn't in your source directory, you can also use the mozconfig environment variable to specify the
path to your mozconfig. the
path you specify must be an absolute
path or else client.mk will not find it. this is useful if you choose to have multiple mozconfig files for different applications or configurations (see below for a full example). note that in the export example below the filename was not mozconfig. regardless of the name of the actual file you use, we refer to this file as the mozconfig...
...this will also help when troubleshooting because people will want to know which build options you have selected and will assume that you have put them in your mozconfig file. ...
... different objdirs. for example, a mozconfig-dbg: mk_add_options moz_objdir=@topsrcdir@/obj-ff-dbg ac_add_options --enable-debug and a mozconfig-rel-opt: mk_add_options moz_objdir=@topsrcdir@/obj-ff-rel-opt ac_add_options --disable-debug ac_add_options --enable-optimize allow for building both versions by specifiying the configuration via the mozconfig environment variable: $ env mozconfig=/
path/to/mozconfig-dbg ./mach build $ env mozconfig=/
path/to/mozconfig-rel-opt ./mach build don't forget to set the mozconfig environment variable for the mach run command as well. be aware that changing your mozconfig will require the configure process to be rerun and therefore the build will take considerably longer, so if you find yourself changing the same options regularly, it may be worth havin...
...And 3 more matches
How Mozilla's build system works
s document but is available here. one concept you will need be familiar with is variables in make. variables are defined by the syntax variable = value, and the value of a variable is referenced by writing $(variable). all variables are strings. all makefile.in files in mozilla have the same basic format: depth = ../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ v
path = @srcdir@ include $(depth)/config/autoconf.mk # ... main body of makefile goes here ... include $(topsrcdir)/config/rules.mk # ... additional rules go here ... the depth variable should be set to the relative
path from your makefile.in to the top-level mozilla directory. topsrcdir is substituted in by configure and points to the top-level mozilla directory. srcdir is also s...
... one other frequently used variable not specific to a particular build target is dirs. dirs is a list of subdirectories of the current directory to recursively build in. subdirectories are traversed after their parent directories. ...
...braries a non-component shared library is useful when there is common code that several components need to share and sharing it through xpcom is not appropriate or not possible. as an example, below is a portion of the makefile for libmsgbaseutil, which is linked against by all of the main news components: depth = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ v
path = @srcdir@ include $(depth)/config/autoconf.mk module = msgbaseutil library_name = msgbaseutil export_library = 1 short_libname = msgbsutl notice that the only change from the component example above is that is_component is not set. when this is not set, a shared library will be created and installed to dist/bin. static libraries as mentioned above, static libra...
...And 3 more matches
Old Thunderbird build
tinue following these build instructions. to build on windows, please read the prerequisites so you don't skip preparing the mapi headers needed to compile thunderbird. ...
...der a directory with spaces in the
path (e.g., don't use "documents and settings"). you can pick any other location, such as a new directory c:/thunderbird-src (where "c:/", with a forward slash, is intentional to clarify you are in the mozillabuild command prompt per windows build prerequisite). note: parts of the build process also have problems when the source code is in a directory where the
path is long (nested many levels deep). on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied errors, where access is denied not because of permission problems, but because the
paths being accessed have been truncated, and so do not exist). having the source deep in a filesystem hierarchy can also cause pro...
... file, although it's strongly recommended that you only use options that you fully understand. for example, to create a debug build instead of a release build, that file would contain: ac_add_options --enable-debug for more on configuration options, see the page configuring build options. note that if you use an moz_objdir it cannot be a sibling folder to your source directory. use an absolute
path to be sure! building thunderbird before you start, make sure that the version you checked out is not busted. for hg tip, you should see green bs on https://treeherder.mozilla.org/#/jobs?repo=comm-central to start the build, cd into the comm-central subdirectory, and run: ./mozilla/mach build mach is our command-line tool to streamline common developer tasks. see the mach article for more. ...
...And 3 more matches
Simple Thunderbird build
009 17:02 26,467 mapiutil.h 02/06/2009 17:02 97,301 mapival.h 02/06/2009 17:02 9,334 mapiwin.h 02/06/2009 17:02 1,906 mapiwz.h 02/06/2009 17:02 18,277 mapix.h 02/06/2009 17:02 5,012 mspst.h get the source note: on windows, you won't be able to build the thunderbird source code if it's under a directory with spaces in the
path (e.g., don't use "documents and settings"). you can pick any other location, such as a new directory c:/thunderbird-src (where "c:/", with a forward slash, is intentional to clarify you are in the mozillabuild command prompt per windows build prerequisite). note: parts of the build process also have problems when the source code is in a directory where the
path is long (nested many levels deep).
...having the source deep in a filesystem hierarchy can also cause problems with pymake builds on windows. ...
...ly understand. for example, to create a debug build instead of a release build, that file would also contain the line: ac_add_options --enable-debug each of these ac_add_options entries needs to be on its own line. for more on configuration options, see the page configuring build options. note that if you use an moz_objdir it cannot be a sibling folder to your source directory. use an absolute
path to be sure! to also build lightning when building thunderbird (deprecated) note: the lightning calendar add-on was integrated into thunderbird starting with version 74. the `--enable-calendar` option is now deprecated and no longer has any effect. if it is in your `mozconfig` file, you should go ahead and remove it when building thunderbird 74 or later, since support for it will eventually be...
...And 3 more matches
DownloadLastDir.jsm
the downloadlastdir.jsm javascript code module lets you retrieve the
path of the last directory into which a download occurred. to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/downloadlastdir.jsm"); if you are using addon sdk, you can import the code module as: let { cu } = require("chrome"); let downloadlastdir = cu.import("resource://gre/modules/downloadlastdir.jsm").downloadlastdir; once you've imported the module, you can then use the downloadlastdir object it exports. ...
...ils.import("resource://gre/modules/downloadlastdir.jsm"); if you are using addon sdk, you can import the code module as: let { cu } = require("chrome"); let downloadlastdir = cu.import("resource://gre/modules/downloadlastdir.jsm").downloadlastdir; once you've imported the module, you can then use the downloadlastdir object it exports. ...
...loadlastdir.jsm").downloadlastdir; once you've imported the module, you can then use the downloadlastdir object it exports. using the downloadlastdir object to determine or set the
path into which the last download occurred: // file is an nsifile var file = downloadlastdir.file; downloadlastdir.file = file; you can also set and retrieve this information on a site-by-site basis. ...
...And 3 more matches
FileUtils.jsm
the fileutils.jsm javascript code module offers utility routines dealing with files. ...
... javascript code module offers utility routines dealing with files. ...
...o use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/fileutils.jsm"); the file constructor if you have a
path to a file (or directory) you want to obtain an nsifile for, you can do so using the file constructor, like this: var f = new fileutils.file(my
path); method overview nsifile getfile(string key, array
patharray, bool followlinks); nsifile getdir(string key, array
patharray, bool shouldcreate, bool followlinks); nsifileoutputstream openfileoutputstream(nsifile file, int modeflags); nsifileoutputstream openatomicfileoutputstream(nsifile file, int modeflags); nsifileoutputstream opensafefileoutputstream(nsifile file, int modeflags); void closeatomicfileoutp...
...And 3 more matches
JavaScript OS.Constants
erfaces.nsiosfileconstantsservice). init(); from a chrome worker no initialization is required. module os.constants is always available for chrome workers. os.constants.sys constants related to system configuration. name the name of the operating system (e.g. "darwin"). debug set to true on debug build configurations, non-existent otherwise. ...
...s.nsiosfileconstantsservice). init(); from a chrome worker no initialization is required. module os.constants is always available for chrome workers. os.constants.sys constants related to system configuration. name the name of the operating system (e.g. "darwin"). debug set to true on debug build configurations, non-existent otherwise. os.constants.
path paths of well-known files and directories. libxul the
path to the file containing libxul. useful, for instance, to access the platform code from javascript in conjunction with js-ctypes. profiledir the
path to the current profile. homedir the
path to the user's home directory. winappdatadir the
path to the user's roaming application data directory. ...
... os.constants.libc constants for interacting with libc. ...
...And 3 more matches
L10n Checks
/users/akalla_aviary.pl/silme-patched/ $ cd silme-patched/ $ sudo python setup.py install or, if you're on windows: $ hg clone http://hg.mozilla.org/users/akalla_aviary.pl/silme-patched/ $ cd silme-patched/ $ python setup.py install running it mercurial source (source) mode l10n checks gathers the directories to compare from an ini file, usually found in $app/locales/l10n.ini. ...
... both the
path to the ini file and the parent directory of the localizations as first arguments, followed by the locale codes of the locales you want to compare. if you want to test the localization for de, run: check-l10n-completeness browser/locales/l10n.ini ../l10n/ de add-ons (xpi) mode l10n checks gathers the locales to compare from the chrome.manifest file inside the xpi file. you pass the
path to the xpi file (optionally) followed by the locale codes of the locales you want to compare. if you want to test the localization for de, run: check-l10n-completeness -i xpi my-extension.xpi de to check all locales in an extension: check-l10n-completeness -i xpi my-extension.xpi language packs (xpis) mode l10n checks can compare two locales found in different xpi files. ...
... the
path to the xpi file (optionally) followed by the locale codes of the locales you want to compare. if you want to test the localization for de, run: check-l10n-completeness -i xpi my-extension.xpi de to check all locales in an extension: check-l10n-completeness -i xpi my-extension.xpi language packs (xpis) mode l10n checks can compare two locales found in different xpi files. you pass both
paths to the xpi file and both
paths to the locales inside the files, e.g.: check-l10n-completeness -i xpis en-us-langpack.xpi my-langpack.xpi jar:chrome/en-us.jar!locale/ jar:chrome/my.jar!locale/my/ jar/zip file (jar) mode l10n checks can compare two locales found in different jar files. ...
...And 3 more matches
Dynamic Library Linking
unload and resolve symbols in dynamic libraries. 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 prstaticlinktable library linking functions the library linking functions are: pr_setlibrary
path pr_getlibrary
path 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. (this is admittedly an omission that should be fixed.) however, it is possible to look up symbols defined in the main executable...
...brary loading functions on some platforms, certain environment variables must be set at run time, and you may need to link your executable programs using special linker options. this section summarizes these platform idiosyncrasies. for more information, consult the man pages for ld and dlopen (or shl_load on hp-ux) for unix, and the loadlibrary documentation for win32. dynamic library search
path exporting symbols from the main executable program dynamic library search
path the dynamic library search
path is the list of directories in which to look for a dynamic library. each platform has its own standard directories in which to look for dynamic libraries, plus a customizable list of directories specified by an environment variable. on most unix systems, this environment variable i...
...ymbols from the main executable program dynamic library search
path the dynamic library search
path is the list of directories in which to look for a dynamic library. each platform has its own standard directories in which to look for dynamic libraries, plus a customizable list of directories specified by an environment variable. on most unix systems, this environment variable is ld_library_
path. these systems typically use dlopen to load a dynamic library. hp-ux uses shl_load to load dynamic libraries, and the environment variable specifying the dynamic library search
path is shlib_
path. moreover, the executable program must be linked with the +s option so that it will search for shared libraries in the directories specified by shlib_
path at run time. alternatively, you can enable the ...
...And 3 more matches
PR_GetLibraryName
it is suitable for use in the pr_loadlibrary call. ...
...it is suitable for use in the pr_loadlibrary call. ...
...it is suitable for use in the pr_loadlibrary call. ...
...And 3 more matches
NSS tools : certutil
address of a certificate to list. used with the -l command option. --extgeneric oid:critical-flag:filename[,oid:critical-flag:filename]... add one or multiple extensions that certutil cannot encode yet, by loading their encodings from external files. · oid (example): 1.2.3.4 · critical-flag: critical or not-critical · filename: full
path to a file containing an encoded extension -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -g keysize set a key size to use w...
...ficate, but they can also be generated independently using the -g command option. certutil -g -d [sql:]directory | -h tokenname -k key-type -g key-size [- y exponent-value] -q pqgfile|curve-name for example: $ certutil -g -h lunasa -k ec -g 256 -q sect193r2 listing certificates the -l command option lists all of the certificates listed in the certificate database. the
path to the directory (-d) is required. $ certutil -l -d sql:/home/my/sharednssdb certificate nickname trust attri butes ssl,s/mime, jar/xpi ca administrator of instance pki-ca1's example domain id u,u,u tps administrator's example domain id u,u,u google inter...
...l1h/rwcjn607+ctekh9jlmuqciqpjnoa+kq/6f7nhnrriuzasibzc30bz5a ni7q5n1usm3ewqlvxw== -----end certificate----- listing keys keys are the original material used to encrypt certificate data. the keys generated for certificates are stored separately, in the key database. to list all keys in the database, use the -k command option and the (required) -d argument to give the
path to the directory. $ certutil -k -d sql:/home/my/sharednssdb certutil: checking token "nss certificate db" in slot "nss user private key and certificate services " < 0> rsa 455a6673bde9375c2887ec8bf8016b3f9f35861d thawte freemail member's thawte consulting (pty) ltd. id < 1> rsa 40defeeb522ade11090eacebaaf1196a172127df example domain administrator cert < 2> ...
...And 3 more matches
TPS Bookmark Lists
a bookmark asset list is an object with one or more key-value pairs. each key is the full
path for the array of contents specified in the key's value. for example: var bookmarks_after_second_modify = { "menu": [ { uri: "http://www.getfirefox.com/", title: "get firefox" } ], "menu/foldera": [ { uri: "http://mozilla.com", title: "mozilla" }, ] }; this describes two bookmarks, one in the "menu" folder, and the other in the "folder1" subfolder of "menu". ...
...ray of contents specified in the key's value. for example: var bookmarks_after_second_modify = { "menu": [ { uri: "http://www.getfirefox.com/", title: "get firefox" } ], "menu/foldera": [ { uri: "http://mozilla.com", title: "mozilla" }, ] }; this describes two bookmarks, one in the "menu" folder, and the other in the "folder1" subfolder of "menu". all bookmark
paths must begin with one of the following: "menu": the normal bookmarks menu "toolbar": the bookmarks toolbar "tags": the tags folder "unfiled": the unfiled bookmarks folder "places": the places root folder ("menu", "toolbar", and "unfiled" are all children of this) sub-folders are preceded with forward slashes, so "menu/folder1" denotes that "folder1" is a sub-folder of "menu". tps does not suppor...
... title of the bookmark item expected to be found before this bookmark; used only in verify and modify actions. changes: an object containing new properties to be set for this bookmark when this asset list is used in a modify action. ...
...And 3 more matches
XPCOM glue
n gecko 6.0. use this when you have a custom application where you want to embed gecko to show webpages in your own window. i.e. this linkage strategy is used when an embedder needs to bootstrap xpcom by finding a compatible gre on disk and loading it. in order to use xpcom, the embedding application first needs to find where the xpcom runtime is located. this is typically done using gre_getgre
pathwithproperties. then, the code must call xpcomgluestartup, which will dynamically link against the xpcom runtime. only then can the embedding application initialize and use xpcom. embedding code which wishes to use only frozen symbols and cannot tolerate a load-time dependency on xpcom.dll should #define xpcom_glue 1 while compiling, and link against xpcomglue.lib. it should not link against xpco...
...m #defines are correct. ...
...es are correct. ...
...And 3 more matches
nsICookieManager2
nged in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsicookiemanager this interface is included in the services.jsm javascript code module. ...
...chingcookie(in nsicookie2 acookie, out unsigned long acountfromhost); obsolete since gecko 1.9 nsisimpleenumerator getcookiesfromhost(in autf8string ahost); void importcookies(in nsifile acookiefile); methods add() adds a cookie. nsicookieservice is the normal way to do this. this method is something of a back door. void add( in autf8string ahost, in autf8string a
path, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry ); parameters ahost the host or domain for which the cookie is set. presence of a leading dot indicates a domain cookie; otherwise, the cookie is treated as a non-domain cookie. see rfc2109 for details. the host string will be normalized to ascii or ace...
...ding dot indicates a domain cookie; otherwise, the cookie is treated as a non-domain cookie. see rfc2109 for details. the host string will be normalized to ascii or ace; any trailing dot will be stripped. to be a domain cookie, the host must have at least two subdomain parts (e.g. '.foo.com', not '.com'), otherwise an exception will be thrown. an empty string is acceptable (e.g. file:// uri's). a
path the
path within the domain for which the cookie is valid. aname the cookie name. avalue the cookie data. aissecure true if the cookie should only be sent over a secure connection. aishttponly true if the cookie should only be sent to, and can only be modified by, an http connection. aissession true if the cookie should exist for the current session only. aexpiry holds the expiration ...
...And 3 more matches
nsIScriptableIO
okies.txt"); from an xpcom component, however, you will need to get a reference as with other components: var scriptableio = components.classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profile", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewith
path(in astring afile
path); nsisupports newinputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize); nsisupports newoutputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuff...
...d as "foo.txt", the file reference generated will refer to a file named "foo.txt" on the user's desktop. note: the filename may only be the name of a file. if you need to select a file in a subdirectory, you should get a reference to the directory, then use the file's append() method to navigate through the directory hierarchy to the file you really want. ...
...rm-independent
path construction. you may specify an empty filename string if you wish to get a reference to the directory itself. nsifile getfile( in astring alocation, in astring afilename ); parameters alocation a location key identifying a known standard directory. the afilename parameter is treated as being local to this directory. afilename the relative
path of the file to generate a reference for. return value returns an nsifile object referencing the specified file location. exceptions thrown ns_error_invalid_arg alocation was null. getfilewith
path() returns a file reference using an absolute file
path to locate the file. note: you should avoid using this method, since file
paths are platform-dependent and non-portable. instead, yo...
...And 3 more matches
CanvasRenderingContext2D.fill() - Web APIs
the canvasrenderingcontext2d.fill() method of the canvas 2d api fills the current or given
path with the current fillstyle. syntax void ctx.fill([fillrule]); void ctx.fill(
path [, fillrule]); parameters fillrule the algorithm by which to determine if a point is inside or outside the filling region. possible values: "nonzero": the non-zero winding rule. default rule. "evenodd": the even-odd winding rule.
path a
path2d
path to fill. examples filling a rectangle this example fills a rectangle with the fill() method. ...
...the fill() method is then used to render the object to the canvas. a hole is left unfilled in the object's center by using the "evenodd" rule; by default (with the "nonzero" rule), the hole would also be filled. ...
...rule.
path a
path2d
path to fill. examples filling a rectangle this example fills a rectangle with the fill() method. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.rect(10, 10, 150, 100); ctx.fill(); result specifying a
path and a fillrule this example saves some intersecting lines to a
path2d object. the fill() method is then used to render the object to the canvas. a hole is left unfilled in the object's center by using the "evenodd" rule; by default (with the "nonzero" rule), the hole would also be filled. ...
...And 3 more matches
IDBObjectStore.createIndex() - Web APIs
nd that indexeddb indexes can contain any javascript data type; indexeddb uses the structured clone algorithm to serialize stored objects, which allows for storage of simple and complex objects. note that this method must be called only from a versionchange transaction mode callback. note: this feature is available in web workers. syntax var myidbindex = objectstore.createindex(indexname, key
path); var myidbindex = objectstore.createindex(indexname, key
path, objectparameters); parameters indexname the name of the index to create. note that it is possible to create an index with an empty name. key
path the key
path for the index to use. note that it is possible to create an index with an empty key
path, and also to pass in a sequence (array) as a key
path. objectparameters optional ...
...if false, it will add one single entry containing the array. locale currently firefox-only (43+), this allows you to specify a locale for the index. ...
...e-aware. return value an idbindex object: the newly created index. exceptions this method may raise a domexception of one of the following types: exception description constrainterror occurs if an index with the same name already exists in the database. index names are case-sensitive. ...
...And 3 more matches
src - CSS: Cascading Style Sheets
the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. ...
... the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. ...
... the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. ...
...And 3 more matches
Overview of CSS Shapes - CSS: Cascading Style Sheets
efore you could create your shape on the: border-box padding-box content-box margin-box in the example below you can change the value border-box to any of the other allowed values to see how the shape moves closer or further away from the box. to explore the box values in more detail see our guide covering shapes from box values. shapes from images an interesting way to generate your
path is to use an image with an alpha channel — the text will then wrap around the non-transparent parts of the image. this allows the overlay of wrapped content around an image, or the use of an image which is never displayed on the page purely as a method of creating a complex shape without needing to carefully map a polygon. note that images used in this way must be cors compatible, otherwise sh...
...f shape-image-threshold is 0.0 (which is the initial value) then the area must be fully transparent. if the value is 1.0 then it is fully opaque. values in between mean that you can set a semi-transparent area as the defining area of the shape. you can see the threshold in action if we use a gradient as the image on which to define our shape. in the example below, if you change the threshold the
path that the shape takes changes based on the level of opacity you have selected. we take a deeper look at creating shapes from images in the shapes from images guide. the shape-margin property the shape-margin property adds a margin to shape-outside. this will further shorten the line boxes of any content wrapping the shape, pushing it away from the shape itself. in the example below we have a...
...per look at creating shapes from images in the shapes from images guide. the shape-margin property the shape-margin property adds a margin to shape-outside. this will further shorten the line boxes of any content wrapping the shape, pushing it away from the shape itself. in the example below we have added a shape-margin to a basic shape. change the margin to push the text further away from the
path the shape would take by default. using generated content as the floated item in the examples above we have used images or a visible element to define the shape, meaning that you can see the shape on the page. instead, you might simply want to cause some text to flow along a non-rectangular invisible line. you can do this with shapes, however you will still need a floated item, which you can t...
...And 3 more matches
Cubic Bezier Generator - CSS: Cascading Style Sheets
vas element using the dom var canvas = document.getelementbyid('bezier'); // make sure we don't execute when canvas isn't supported if (canvas.getcontext) { // use getcontext to use the canvas for drawing var ctx = canvas.getcontext('2d'); // clear canvas ctx.clearrect(0, 0, canvas.width, canvas.height); // draw the rulers ctx.begin
path(); ctx.strokestyle = "black"; // draw the y axis ctx.moveto(cx(0), cy(0)); ctx.lineto(cx(1), cy(0)); ctx.textalign = "right"; for (var i = 0.1; i <= 1; i = i + 0.1) { ctx.moveto(-basic_scale_size + cx(0), ly(i)); if ((i == 0.5) || (i > 0.9)) { ctx.moveto(-2 * basic_scale_size + cx(0), ly(i)); ...
... + cx(0), ly(i)); if ((i == 0.5) || (i > 0.9)) { ctx.moveto(-2 * basic_scale_size + cx(0), ly(i)); ctx.filltext(math.round(i * 10) / 10, -3 * basic_scale_size + cx(0), cy(i) + 4); // limitation the constant 4 should be font size dependant } ctx.lineto(cx(0), ly(i)); } ctx.stroke(); ctx.close
path(); ctx.begin
path(); // draw the y axis label ctx.save(); ctx.rotate(-math.pi / 2); ctx.textalign = "left"; ctx.filltext("output (value ratio)", -cy(0), -3 * basic_scale_size + cx(0)); ctx.restore(); // draw the x axis ctx.moveto(cx(0), cy(0)); ctx.lineto(cx(0), cy(1)); ctx.textalign = "center"; for (...
... // limitation the constant 4 should be dependant of the font size } ctx.lineto(lx(i), cy(0)); } // draw the x axis label ctx.textalign = "left"; ctx.filltext("input (time duration ratio)", cx(0), 4 * basic_scale_size + cy(0)); // limitation the constant 4 should be dependant of the font size ctx.stroke(); ctx.close
path(); // draw the bézier curve ctx.begin
path(); ctx.moveto(cx(0), cy(0)); ctx.strokestyle = 'blue'; ctx.beziercurveto(cx(x1), cy(y1), cx(x2), cy(y2), cx(1), cy(1)); ctx.stroke(); ctx.close
path(); // draw the p2 point (with a line to p0) ctx.begin
path(); ctx.strokestyle = 'red'; ctx.moveto(cx(x1), cy(y1)); ...
...And 3 more matches
offset-distance - CSS: Cascading Style Sheets
the offset-distance css property specifies a position along an offset-
path for an element to be placed. syntax /* default value */ offset-distance: 0; /* the middle of the offset-
path */ offset-distance: 50%; /* a fixed length positioned along the
path */ offset-distance: 40px; <length-percentage> a length that specifies how far the element is along the
path (defined with offset-
path). 100% represents the total length of the
path (when the offset-
path is defined as a basic shape or
path()). ...
.../* a fixed length positioned along the
path */ offset-distance: 40px; <length-percentage> a length that specifies how far the element is along the
path (defined with offset-
path). 100% represents the total length of the
path (when the offset-
path is defined as a basic shape or
path()). formal definition initial value0applies totransformable elementsinheritednopercentagesrefer to the total
path lengthcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea length, percentage or calc(); formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples using offset-distance in an animation the motion aspect in css motion
path typically comes from animating the offset-distance property. if you want to animate an element along its...
...hcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea length, percentage or calc(); formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples using offset-distance in an animation the motion aspect in css motion
path typically comes from animating the offset-distance property. if you want to animate an element along its full
path, you would define its offset-
path and then set up an animation that takes the offset-distance from 0% to 100%. ...
...And 3 more matches
url() - CSS: Cascading Style Sheets
function can be passed as a parameter of another css functions, like the attr() function. depending on the property for which it is a value, the resource sought can be an image, font, or a stylesheet. the url() functional notation is the value for the <url> data type. ...
...example.com/images/myimg.jpg); url(data:image/png;base64,irxvb0…); url(myfont.woff); url(#idofsvg
path); /* associated properties */ background-image: url("https://mdn.mozillademos.org/files/16761/star.gif"); list-style-image: url('../images/bullet.jpg'); content: url("pdficon.jpg"); cursor: url(mycursor.cur); border-image-source: url(/media/diamonds.png); src: url('fantasticfont.woff'); offset-
path: url(#
path); mask-image: url("masks.svg#mask1"); /* properties with fallbacks */ cursor: url(pointer.cur), pointer; /* associated short-hand properties */ background: url('https://mdn.mozillademos.org/files/16761/star.gif') bottom right repeat-x blue; border-image: url("/media/diamonds.png") 30 fill / 30px / 30px space; /* as a parameter in another css function */ background-image: cross-fade(...
...ters are escaped, or if the address includes control characters above 0x7e. double quotes cannot occur inside double quotes and single quotes cannot occur inside single quotes unless escaped. the following are all valid and equivalent: <css_property>: url("https://example.com/image.png") <css_property>: url('https://example.com/image.png') <css_property>: url(https://example.com/image.png)
path references the id of an svg shape -- circle, ellipse, line,
path, polygon, polyline, or rect -- using the shape's geometry as the
path. <url-modifier> in the future, the url() function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the url string.this is not supported and not fully defined in the specification. formal syntax url...
...And 3 more matches
Performance fundamentals - Web Performance
for example, to paint an application's first frame that comprises visually some html and css to style that html: the html must be parsed the dom for that html must be constructed resources like images in that part of the dom have to be loaded and decoded the css styles mu...
...he second is when the application becomes interactive — for example, users are able to tap a button and the application responds the final event is full load — for example when all the user's albums have been listed in a music player the key to fast startup is to keep two things in mind: upp is all that matters, and there's a "critical
path" to each user-perceived event above. the critical
path is exactly and only the code that must run to produce the event. for example, to paint an application's first frame that comprises visually some html and css to style that html: the html must be parsed the dom for that html must be constructed resources like images in that part of the dom have to be loaded and decoded the css styles must be applied to that dom the styled document has to b...
... html must be parsed the dom for that html must be constructed resources like images in that part of the dom have to be loaded and decoded the css styles must be applied to that dom the styled document has to be reflowed nowhere in that list is "load the js file needed for an uncommon menu"; "fetch and decode the image for the high scores list", etc. those work items are not on the critical
path to painting the first frame. it seems obvious, but to reach a user-perceived startup event more quickly, the main "trick" is run only the code on the critical
path. shorten the critical
path by simplifying the scene. the web platform is highly dynamic. javascript is a dynamically-typed language, and the web platform allows loading code, html, css, images, and other resources dynamically. these ...
...And 3 more matches
SVG Presentation Attributes - SVG: Scalable Vector Graphics
svg presentation attributes are css properties that can be used as attributes on svg elements. ...
...aphic|alphabetic|hanging|mathematical|inherit; animatable: yes baseline-shift it allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. value: auto|baseline|super|sub|<percentage>|<length>|inherit; animatable: yes clip deprecated it defines what portion of an element is visible. value: auto|<shape()>|inherit; animatable: yes clip-
path it binds the element it is applied to with a given <clip
path> element. value: none|<funciri>|inherit; animatable: yes clip-rule it indicates how to determine what side of a
path is inside a shape in order to know how a <clip
path> should clip its target. value: nonezero|evenodd|inherit; animatable: yes color it provides a potential indirect value (currentcolor) for the fill, stroke, stop-co...
...ation of the background image. value: accumulate|new|inherit; animatable: no fill it defines the color of the inside of the graphical element it applies to. value: <paint>; animatable: yes fill-opacity it specifies the opacity of the color or the content the current object is filled with. value: <number>|<percentage>; animatable: yes fill-rule it indicates how to determine what side of a
path is inside a shape. value: nonzero|evenodd|inherit; animatable: yes filter it defines the filter effects defined by the <filter> element that shall be applied to its element. value: <funciri>|none|inherit; animatable: yes flood-color it indicates what color to use to flood the current filter primitive subregion defined through the <feflood> or <fedropshadow> element. value: <color>; animata...
...And 3 more matches
keyPoints - SVG: Scalable Vector Graphics
the keypoints attribute indicates the simple duration of an animation. ...
.... ...
... <
path d="m10,110 a120,120 -45 0,1 110 10 a120,120 -45 0,1 10,110" stroke="lightgrey" stroke-width="2" fill="none" id="motion
path"/> <circle cx="10" cy="110" r="3" fill="lightgrey"/> <circle cx="110" cy="10" r="3" fill="lightgrey"/> <circle r="5" fill="red"> <animatemotion dur="3s" repeatcount="indefinite" keypoints="0;0.5;1" keytimes="0;0.15;1" calcmode="linear"> <m
path xlink:href="#motion
path"/> </animatemotion> </circle> </svg> usage notes value <number> [; <number>]* ;? default value none animatable no <number> [; <number>] ;? ...
...And 3 more matches
requiredFeatures - SVG: Scalable Vector Graphics
uiredfeatures is used in other situations, it represents a simple switch on the given element whether to render the element or not. to detect availability of an svg feature from script, there is the (also deprecated) domimplementation.hasfeature() method. ...
...n element whether to render the element or not. to detect availability of an svg feature from script, there is the (also deprecated) domimplementation.hasfeature() method. ...
...ure from script, there is the (also deprecated) domimplementation.hasfeature() method. ...
...And 3 more matches
stroke-miterlimit - SVG: Scalable Vector Graphics
on attribute defining a limit on the ratio of the miter length to the stroke-width used to draw a miter join. when the limit is exceeded, the join is converted from a miter to a bevel. note: as a presentation attribute stroke-miterlimit can be used as a css property. ...
...iter length to the stroke-width used to draw a miter join. when the limit is exceeded, the join is converted from a miter to a bevel. note: as a presentation attribute stroke-miterlimit can be used as a css property. ...
...roke-miterlimit can be used as a css property. ...
...And 3 more matches
vector-effect - SVG: Scalable Vector Graphics
r effect to use when drawing an object. vector effects are applied before any of the other compositing operations, i.e. filters, masks and clips. note: as a presentation attribute, vector-effect can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following ten elements: <circle>, <ellipse>, <foreignobject>, <image>, <line>, <
path>, <polygon>, <polyline>, <rect>, <text>, <text
path> <tspan>, and <use> usage notes value none | non-scaling-stroke | non-scaling-size | non-rotation | fixed-position default value none animatable yes none this value specifies that no vector effect shall be applied, i.e. the default rendering behaviour is used which is to first fill the geometry of a...
... animatable yes none this value specifies that no vector effect shall be applied, i.e. the default rendering behaviour is used which is to first fill the geometry of a shape with a specified paint, then stroke the outline with a specified paint. non-scaling-stroke this value modifies the way an object is stroked. normally stroking involves calculating stroke outline of the shapeʼs
path in current user coordinate system and filling that outline with the stroke paint (color or gradient). the resulting visual effect of this value is that the stroke width is not dependant on the transformations of the element (including non-uniform scaling and shear transformations) and zoom level. non-scaling-size this value specifies a special user coordinate system used by the element and its ...
...oordinate system is fixed in spite of any transformation changes from a host coordinate space. however, it does not specify the suppression of rotation, skew and scaling. when this vector effect and the transform property are defined at the same time, that property is consumed for this effect. ...
...And 3 more matches
SVG element reference - SVG: Scalable Vector Graphics
« svg / svg attribute reference » svg drawings and images are created using a wide array of elements which are dedicated to the construction, drawing, and layout of vector images and diagrams. here you'll find reference documentation for each of the svg elements. ...
...nttransfer> <fecomposite> <feconvolvematrix> <fediffuselighting> <fedisplacementmap> <fedistantlight> <fedropshadow> <feflood> <fefunca> <fefuncb> <fefuncg> <fefuncr> <fegaussianblur> <feimage> <femerge> <femergenode> <femorphology> <feoffset> <fepointlight> <fespecularlighting> <fespotlight> <fetile> <feturbulence> <filter> <foreignobject> g <g> h <hatch> <hatch
path> i <image> l <line> <lineargradient> m <marker> <mask> <mesh> <meshgradient> <meshpatch> <meshrow> <metadata> <m
path> p <
path> <pattern> <polygon> <polyline> r <radialgradient> <rect> s <script> <set> <solidcolor> <stop> <style> <svg> <switch> <symbol> t <text> <text
path> <title> <tspan> u <unknown> <use> v <view> svg elements...
...<meshrow> <metadata> <m
path> p <
path> <pattern> <polygon> <polyline> r <radialgradient> <rect> s <script> <set> <solidcolor> <stop> <style> <svg> <switch> <symbol> t <text> <text
path> <title> <tspan> u <unknown> <use> v <view> svg elements by category animation elements <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <discard>, <m
path>, <set> basic shapes <circle>, <ellipse>, <line>, <polygon>, <polyline>, <rect> container elements <a>, <defs>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, <symbol>, <unknown> descriptive elements <desc>, <metadata>, <title> filter primitive elements <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedispla...
...And 3 more matches
Fills and Strokes - SVG: Scalable Vector Graphics
ne x1="40" x2="120" y1="20" y2="20" stroke="black" stroke-width="20" stroke-linecap="butt"/> <line x1="40" x2="120" y1="60" y2="60" stroke="black" stroke-width="20" stroke-linecap="square"/> <line x1="40" x2="120" y1="100" y2="100" stroke="black" stroke-width="20" stroke-linecap="round"/> </svg> the stroke-width property defines the width of this stroke. strokes are drawn centered around the
path. in the example above, the
path is shown in pink, and the stroke in black. the second attribute affecting strokes is the stroke-linecap property, demonstrated above. this controls the shape of the ends of lines. there are three possible values for stroke-linecap: butt closes the line off with a straight edge that's normal (at 90 degrees) to the direction of the stroke and crosses its end. s...
...te affecting strokes is the stroke-linecap property, demonstrated above. this controls the shape of the ends of lines. there are three possible values for stroke-linecap: butt closes the line off with a straight edge that's normal (at 90 degrees) to the direction of the stroke and crosses its end. square has essentially the same appearance, but stretches the stroke slightly beyond the actual
path. the distance that the stroke goes beyond the
path is half the stroke-width. round produces a rounded effect on the end of the stroke. the radius of this curve is also controlled by the stroke-width. use stroke-linejoin to control how the joint between two line segments is drawn. <?xml version="1.0" standalone="no"?> <svg width="160" height="280" xmlns="http://www.w3.org/2000/svg" version="...
...h to create a square corner where only one angle is used. round creates a rounded line segment. bevel creates a new angle to aid in the transition between the two segments. finally, you can also use dashed line types on a stroke by specifying the stroke-dasharray attribute. ...
...And 3 more matches
Modules - Archive of obsolete content
her than triggering another download. the module system is implemented using a loader object, which is actually provided as a module itself. it is defined in the module “toolkit/loader”: const { loader } = require('toolkit/loader') the loader constructor allows you to create your own custom loader objects. it takes a single argument, which is a named options object. for instance, the option
paths is used to specify a list of
paths to be used by the loader to resolve relative urls: let loader = loader({
paths: ["./": "http://www.foo.com/"] }); commonjs also defines the notion of a main module. the main module is always the first to be loaded, and differs from ordinary modules in two respects. firstly, since they do not have a requiring module. instead, the main module is loaded usin...
...this allows modules to check if they have been loaded as the main module: function main() { ... } if (require.main === module) main(); the cuddlefish loader the sdk uses its own internal loader, known as cuddlefish (because we like crazy names). ...
...ated using the loader constructor: let's take a look at some of the options used by cuddlefish to customize its behavior. the way module ids are resolved can be customized by passing a custom resolve function as an option. this function takes the id to be resolved and the requiring module as an argument, and returns the resolved id as its result. ...
...And 2 more matches
Module structure of the SDK - Archive of obsolete content
-ons. sdk modules the modules supplied by the sdk are divided into two sorts: high-level modules like panel and page-mod provide relatively simple, stable apis for the most common add-on development tasks. low-level modules like heritage and namespace provide more powerful functionality, and are typically less stable and more complex. ...
...le, stable apis for the most common add-on development tasks. low-level modules like heritage and namespace provide more powerful functionality, and are typically less stable and more complex. to use sdk modules, you can pass require() a complete
path, starting with "sdk", to the module you want to use. for high-level modules this is just sdk/<module_name>, and for low-level modules it is sdk/<
path_to_module>/<module_name>: // load the high-level "tabs" module var tabs = require("sdk/tabs"); // load the low-level "uuid" module var uuid = require('sdk/util/uuid'); the
path to specify for a low-level module is given along with the module name itself in the title of the module's documentation page (for example, system/environment). although the sdk repository in github includes copies of ...
...sed add-on consists of a single module named main.js, but you can factor your add-on's code into a collection of separate commonjs modules. each module is a separate file stored under your add-on's "lib" directory, and exports the objects you want to make available to other modules in your add-on. see the tutorial on creating reusable modules for more details. to import a local module, specify a
path relative to the importing module. for example, the following add-on contains an additional module directly under "lib", and other modules under subdirectories of "lib": my-addon lib main.js password-dialog.js secrets hash.js storage password-store.js to import modules into main: // main.js ...
...And 2 more matches
ui/frame - Archive of obsolete content
. it occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (hidpi) display. this toolbar might look something like: scripting frames to add scripts to frames, include them directly from the frame's html content, as with a normal web page: <script type="text/javascript" src="frame.js"></script> as usual, the
path to the script is relative to the html file's location. messages logged from a frame script using the console will not appear in the terminal when you run the add-on using jpm run. however, they will appear in the browser console. this issue is being tracked as bug 982385. communicating with frames you can exchange messages between the main add-on code and scripts loaded into the frame using ...
... name type url url, string a url pointing to the html file specifying the frame's content. the file must be bundled with the add-on under its "data" directory. ...
...l url, string a url pointing to the html file specifying the frame's content. the file must be bundled with the add-on under its "data" directory. ...
...And 2 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
usage what am i looking for? if you just start poking through the source code at random, you may not find much of anything. so let’s figure out where to start looking. let’s say we’ve found the contents of listing 7 in the source. we can guess from the name that this has something to do with handling files, but we’ve still got the following questions: what does nsilocalfile.initwith
path do? what arguments does it take? how is nsilocalfile.initwith
path actually implemented? let’s examine these questions one at a time. what does this do? what arguments does it take? first we’ll search for the component’s definition. type interface nsilocalfile (with a trailing space) in the search field and go. nearly all components inherit from nsisupports (fixme: why 'nearly' ?), so ...
...space) in the search field and go. nearly all components inherit from nsisupports (fixme: why 'nearly' ?), so adding a trailing space when you search serves as a delimiter on the inheritance position, and makes it easier to specify what you’re looking for (see figures 6, 7).4 this results in the file nsilocalfile.idl. let’s display it. every method includes explanatory comments. in initwith
path, the nsilocalfile object gets initialized, and any information already in it gets reset. also be aware of a potential problem when using
paths not representing entities.5 this requires a full
path as an argument. relative
paths will throw errors. this should help you understand the initwith
path specification. fixme: figure 6: searching without a trailing space fixme: figure 7: searching with ...
...use that as your search string. ...
...And 2 more matches
Connecting to Remote Content - Archive of obsolete content
tsbytagname("name")[0].firstchild.nodevalue); // => orange window.alert(totalelement.firstchild.nodevalue); // => 2 } }; using dom functions is good for simple xml documents, but dom manipulation code can become too complicated if the documents are more complex. ...
...ame("name")[0].firstchild.nodevalue); // => orange window.alert(totalelement.firstchild.nodevalue); // => 2 } }; using dom functions is good for simple xml documents, but dom manipulation code can become too complicated if the documents are more complex. ...
...child.nodevalue); // => orange window.alert(totalelement.firstchild.nodevalue); // => 2 } }; using dom functions is good for simple xml documents, but dom manipulation code can become too complicated if the documents are more complex. ...
...And 2 more matches
Using Dependent Libraries In Extension Components - Archive of obsolete content
es/dependent1.dll extension-directory/libraries/dependent2.dll extension-directory/libraries/component.dll extension-directory/components/interface1.xpt extension-directory/components/interface2.xpt extension-directory/components/bsmedberg_stub.dll extensions/stub/makefile.in # copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> depth = ../.. ...
... instead, we...
...rary) return ns_error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); nscstring
path; // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); rv = library->getnative
path(
path); if (ns_failed(rv)) return rv; //at this point, we would have used prlibrary *lib; library->load(&lib); //but we can't use that in os x. instead, we use nsaddimage. ...
...And 2 more matches
Creating a Microsummary - Archive of obsolete content
install the extension (restarting firefox to complete installation) then go ...
...m" version="1.0"> <output method="text"/> <template match="/"> </template> </transform> </template> </generator> including the download count to include the download count in the output of the xslt transform sheet, we need to add an xslt <value-of> element to the template whose select attribute contains an x
path expression that points to the node containing the count. x
path is a language for identifying nodes in html/xml documents. it also contains basic functions for manipulating those nodes and their content. the easiest way to get an x
path expression that points to the node in question is to use the x
path checker extension. install the extension (restarting firefox to complete installation) then go to the spread firefox home page, find the firefox download count...
...ating those nodes and their content. the easiest way to get an x
path expression that points to the node in question is to use the x
path checker extension. install the extension (restarting firefox to complete installation) then go to the spread firefox home page, find the firefox download count (a large number at the bottom of the right-hand column), context click on the number, and select view x
path from the context menu. x
path checker will open a new window. the new window will include an x
path field that contains this x
path expression pointing to the download count node: id('download-count'). ...
...And 2 more matches
patch - Archive of obsolete content
summary updates an existing component. method of install object syntax int patch ( string registryname, string xpisource
path, object localdirspec, string relativelocal
path); int patch ( string registryname, installversion version, string xpisource
path, object localdirspec, string relativelocal
path); int patch ( string registryname, string version, string xpisource
path, object localdirspec, string relativelocal
path); parameters the patch method has the following parameters: registryname the
pathname in the client version registry for the component that is to be patched.this parameter can be an absolute
pathname, such as /royalairways/royalsw/executable or a relative
pathname, such as executable. typically, absolute ...
... xpisource
path, object localdirspec, string relativelocal
path); parameters the patch method has the following parameters: registryname the
pathname in the client version registry for the component that is to be patched.this parameter can be an absolute
pathname, such as /royalairways/royalsw/executable or a relative
pathname, such as executable. typically, absolute
pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll. typically, relative
pathnames are relative to the main
pathname specified in the initinstall method. this parameter can also be null, in which case the xpisource
path parameter is used as a relative
pathname. ...
... typically, absolute
pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll. typically, relative
pathnames are relative to the main
pathname specified in the initinstall method. this parameter can also be null, in which case the xpisource
path parameter is used as a relative
pathname. note that the registry
pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517". ...
...And 2 more matches
XML Templates - Archive of obsolete content
when an xml source is desired, specify a querytype attribute on the root node of the template to the value xml. this indicates to the template builder that an xml source is being used as that the queries use syntax that is specific to xml. the datasources attribute should be set to the url of an xml document, either a local file or a remote web site. ...
...eople> <person name="napoleon bonaparte" gender="male"/> <person name="cleopatra" gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gender="male"/> <person name="laura secord" gender="female"/> </people> xml query syntax the query syntax is fairly simple for xml datasources. just place an expr attribute on the query element containing an x
path expression returns the set of results to output. here is an example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> the expr attribute is a very simple x
path expression which simply retrieves the person elements from within the datasource. as there are ...
...' so the value of the uri attribute for xml templates should always be the single question mark character as in this example. the label attribute has been set to a special value ?name. when a question mark character followed by a string appears in an attribute value, the label value is not directly, but instead the value of an attribute for the source xml is used. for each node generated by the x
path expression used in the query, the attribute on the generated xml node is taken and substituted for the question mark and following string. in the above example, the use of the ?name value, causes the name attribute on each result node to be used as the value of the label. you can see the name attributes in the original xml data above. this substitution occurs for any attribute within the action ...
...And 2 more matches
Visual JS GE - Game development
npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 setting up config.js you will find config.js in the server_instance folder: all node.js applications use the same folder — server_instance. some apps might need to have local storage, for instance, editor.js. ...
...stall nodemailer@0.7.0 setting up config.js you will find config.js in the server_instance folder: all node.js applications use the same folder — server_instance. some apps might need to have local storage, for instance, editor.js. ...
... setting up config.js you will find config.js in the server_instance folder: all node.js applications use the same folder — server_instance. some apps might need to have local storage, for instance, editor.js. ...
...And 2 more matches
Chrome registration
nifest" in the root of an extension, or theme, or xulrunner application. the plaintext chrome manifests are in a simple line-based format. each line is parsed individually; if the line is parsable the chrome registry takes the action identified by that line, otherwise the chrome registry ignores that line (and prints a warning message in the runtime error console). locale packagename localename
path/to/files skin packagename skinname
path/to/files note: the characters @ # ; : ? / are not allowed in the packagename. firefox 2, thunderbird 2, and seamonkey 1.1 will not find the chrome when packagename is mixed case. if the above example had a packagename of camelcasepackage, you would get an error message similar to "no chrome registered for chrome://camelcasepackage/
path/to/files". firef...
...hrome file provided by the application or xulrunner. in order to allow for this, the chrome registration manifest allows for "override" instructions: override chrome://package/type/original-uri.whatever new-resolved-uri [flags] note: overrides are not recursive (so overriding chrome://foo/content/bar/ with file:///home/john/blah/ will not usually do what you want or expect it to do). also, the
path inside overridden files is relative to the overridden
path, not the original one (this can be annoying and/or useful in css files, for example). note: there was a bug in gecko 1.8.1.5 (firefox 2.0.0.5) and earlier where you could not use a relative url for the new-resolved-uri parameter. you needed to provide an absolute url. see bug 323455. resource aliases can be created using the resour...
...les, for example). note: there was a bug in gecko 1.8.1.5 (firefox 2.0.0.5) and earlier where you could not use a relative url for the new-resolved-uri parameter. you needed to provide an absolute url. see bug 323455. resource aliases can be created using the resource instruction: resource aliasname uri/to/files/ [flags] this will create a mapping for resource://<aliasname>/ uris to the
path given. note: there are no security restrictions preventing web content from including content at resource: uris, so take care what you make visible there. manifest flags manifest lines can have multiple, space-delimited flags added at the end of the registration line. these flags mark special attributes of chrome in that package, or limit the conditions under which the line is used. applica...
...And 2 more matches
Command line options
mmand actions are case insensitive. command parameters, except profile names, are case insensitive. blank spaces ( ) separate commands and parameters. each message option follows the syntax field=value, for example: to=foo@nowhere.net subject=cool page attachment=www.mozilla.org attachment='file:///c:/test.txt' body=check this page or also in thunderbird 52 and newer: body=c:\
path\to\file.txt separate multiple message options by comma (,), for example: "to=foo@nowhere.net,subject=cool page" . comma separators must not follow or precede spaces ( ). to assign multiple values to a field, enclose the values in single quotes ('), for example: "to='foo@nowhere.net,foo@foo.de',subject=cool page" . using command line options command line options follow the command to sta...
...d remote commands. implies -new-instance. firefox -no-remote -p "another profile" note: since firefox 9, this does really mean what its name implies on all platforms, i.e. instances created with this parameter do not accept or send remote commands, see bug 650078. that means that such instances won't be re-used. also when using this argument a new instance is created in any case. -override /
path/to/override.ini load the specified override.ini file to override application.ini (browser/app/application.ini). this can be used to suppress the migration wizard at startup by loading the following override.ini. firefox only. [xre] enableprofilemigrator=0 -profilemanager start with profile manager. short form: -p without a profile name. -p "profile_name" bypass profile manager and launch ap...
...me. useful for dealing with multiple profiles. firefox -p "joel user" note: profile_name is case sensitive. if you don't specify a profile name then the profile manager is opened instead. you must use an upper case p on linux with versions older than 7.x, as there lower case invokes purify mode (memory and leak detection). other platforms accept both upper and lower case. -profile "profile_
path" start with the profile with the given
path. firefox, thunderbird and seamonkey2.x only. "profile_
path" can either be an absolute
path ("/
path/to/profile") or a relative
path ("
path/to/profile"). note: on mac os x specifying a relative
path is not supported anymore from firefox 4.0 and up due to a regression, see bug 673955. browser -browser start with the browser component. firefox and s...
...And 2 more matches
Debugging on Mac OS X
irefox processes of these builds. try builds use the developer.entitlements.xml file from the source tree while production builds use production.entitlements.xml. on macos 10.15+, downloaded try builds will not launch by default because notarization is required. to workaround this problem, remove the quarantine extended attribute from the downloaded nightly: $ xattr -r -d com.apple.quarantine /
path/to/nightly.app local builds local builds of mozilla-central do not enable hardened runtime and hence do not have debugging restrictions. as a result, some functionality will be permitted on local builds, but blocked on production builds which have hardened runtime enabled. bug 1522409 was filed to automate codesigning local builds to enable hardened runtime by default and eliminate this discrep...
...help us # without xcode providing that functionality.) # # the following works by setting a one-shot breakpoint to break on a function # that we know will both run early (which we want when we start first start the # app) and run frequently (which we want so that it will trigger asap if we # attach to an already running app). the breakpoint runs some commands to # figure out the object directory
path from the attached target and then # sources the .lldbinit from there. # # note: this scripts actions take a few seconds to complete, so the custom # formatters, commands etc. that are added may not be immediately available. # breakpoint set --name nsthread::processnextevent --thread-index 1 --auto-continue true --one-shot true breakpoint command add -s python # this script that we run does no...
... commands etc. that are added may not be immediately available. # breakpoint set --name nsthread::processnextevent --thread-index 1 --auto-continue true --one-shot true breakpoint command add -s python # this script that we run does not work if we try to use the global 'lldb' # object, since it is out of date at the time that the script runs (for # example, `lldb.target.executable.full
path` is empty). therefore we must # get the following objects from the 'frame' object. target = frame.getthread().getprocess().gettarget() debugger = target.getdebugger() # delete our breakpoint (not actually necessary with `--one-shot true`): target.breakpointdelete(bp_loc.getbreakpoint().getid()) # for completeness, find and delete the dummy breakpoint (the breakpoint ...
...And 2 more matches
Gmake vs. Pymake
to configure relatively, invoke configure or client.mk from your objdir. ...
... to configure relatively, invoke configure or client.mk from your objdir. ...
... to configure relatively, invoke configure or client.mk from your objdir. ...
...And 2 more matches
SVG Guidelines
est to use svg or a raster image format for any given image. the vector format svg and raster formats like png both have their place. when choosing whether or not to use svg it is best to understand the advantages and disadvantages of both. file size whether svg or a raster format will produce a smaller file for a given image depends very much on the image. for example, consider an image of a
path with a gradient fill. the size of an svg of this image will be the same regardless of the dimensions of the image. on the other hand the size of a raster file of the same image will likely vary tremendously depending on the dimensions of the image since the larger the dimensions the more pixel data the file needs to store. at very small dimensions (the extreme case being 1px x 1px) the raster fil...
...on some real examples seen in mozilla's code. ...
...e. basics two spaces indenting no useless whitespaces or line breaks (see below for more details) adding a license header use double quotes whitespace and line breaks whitespace in addition to trailing whitespace at the end of lines, there are a few more cases more specific to svgs: trailing whitespaces in attribute values (usually seen in
path definitions) excessive whitespace in
path or polygon points definition examples this
path: <
path d=" m5,5 l1,1z "> can be cut down to this: <
path d="m5,5 l1,1z"> similarly, this polygon: <polygon points=" 0,0 4,4 4,0 "/> can be cut down to this: <polygon points="0,0 4,4 4,0"/> line breaks you should only use line breaks for logical separation or if they help make the file readable. you should avoid line breaks betwee...
...And 2 more matches
Multiple Firefox profiles
fox with the package manager of your linux distribution: open a terminal emulator or your shell’s command prompt: alt-f2 if you use gnome shell or kde plasma, consult your desktop environment documentation for other environments. run firefox --new-instance --profilemanager. macos run the terminal application, which is found in applications/utilities. type or paste in the
path to firefox, followed by .app/contents/macos/firefox. for example, if firefox is installed in the recommended location, you would enter /applications/firefox.app/contents/macos/firefox. if you have the
path to your desired profile handy, enter a space character, followed by -profile followed by another space character, followed by the full
path to the profile folder you wish to launch into. thi...
...ager first. using the profiles windows if you want to have the profile manager to pop up each time you start firefox, so you can choose a profile, you will need to edit the "target" of the launch icon. to do this: right-click the icon and choose "properties". when the properties dialog box pops up, you should see a "target" text field that you can edit, and it should show the current file
path. after the closing quote, add -profilemanager. click ok. now whenever you double click that icon, the profile manager should appear, allowing you to choose which profile you'd like to use. if you want individual icons to launch specific profiles, you will need to edit the "target" of each icon. to do this: right-click the icon and choose "properties". when the properties dialog box pops ...
... icon, the profile manager should appear, allowing you to choose which profile you'd like to use. if you want individual icons to launch specific profiles, you will need to edit the "target" of each icon. to do this: right-click the icon and choose "properties". when the properties dialog box pops up, you should see a "target" text field that you can edit, and it should show the current file
path. to permanently set a specific profile, add -p profile_name to the target
path, but outside of the quotes, replacing "profile_name" with the actual profile name you chose. if you would also like to allow multiple instances of firefox to run at the same time, add -no-remote after the profile name. once you are all done, click ok. do this for each icon you'd like to have a specific profile for.
...And 2 more matches
Downloads.jsm
url: string containing the uri for the download source. isprivate: optional indicates whether the download originated from a private window. if omitted, the download is public. referrer: optional string containing the referrer uri of the download source. can be omitted or null if no referrer should be sent or the download source is not http. target: string containing the
path of the target file. alternatively, may be an nsifile, a downloadtarget object, or an object with the following properties:
path: string containing the
path of the target file. saver: optional string representing the class of the download operation. if omitted, defaults to "copy". alternatively, may be the serializable representation of a downloadsaver object. promise resolv...
...o a download object using the createdownload() function. since the download cannot be restarted, any partially downloaded data will not be kept in case the download fails. promise fetch( asource, atarget, object aoptions ); parameters asource string containing the uri for the download source. alternatively, may be an nsiuri or a downloadsource object. atarget string containing the
path of the target file. alternatively, may be an nsifile or a downloadtarget object. aoptions optional an optional object used to control the behavior of this function. you may pass an object with a subset of the following fields: isprivate: optional indicates whether the download originated from a private window. if omitted, the download is public. promise resolves to undefined when the...
...local file this example downloads an html file without showing progress, handling errors programmatically. components.utils.import("resource://gre/modules/downloads.jsm"); components.utils.import("resource://gre/modules/osfile.jsm") components.utils.import("resource://gre/modules/task.jsm"); task.spawn(function () { yield downloads.fetch("http://www.mozilla.org/", os.
path.join(os.constants.
path.tmpdir, "example-download.html")); console.log("example-download.html has been downloaded."); }).then(null, components.utils.reporterror); observing downloads this example logs a message every time a change occurs in one of the global download lists. to demonstrate the logging, a new download is started while a message box is bei...
...And 2 more matches
JNI.jsm
sig for the return value. not fully qualified name, same meaning as above row return '(' + (aparamsarr ? aparamsarr.join('') : '') + ')' + aret; } function fullyqualifiednameofclass(aclass) { // aclass is a string with l and ; arround it return aclass.substr(1, aclass - 2); } examples read java strings this example shows how to read java strings as javascript strings. ...
... : '') + ')' + aret; } function fullyqualifiednameofclass(aclass) { // aclass is a string with l and ; arround it return aclass.substr(1, aclass - 2); } examples read java strings this example shows how to read java strings as javascript strings. we will get
paths to special folders on fennec (firefox for android) into a javascript variable with readstring(). ...
...ad java strings this example shows how to read java strings as javascript strings. we will get
paths to special folders on fennec (firefox for android) into a javascript variable with readstring(). ...
...And 2 more matches
Sqlite.jsm
ed from chrome -- that is, from within the application itself or an add-on. before you can use this module, you need to import it into your scope: components.utils.import("resource://gre/modules/sqlite.jsm") obtaining a connection sqlite.jsm exports the sqlite symbol. this symbol is an object with a single function: openconnection. this function takes an object defining connection options:
path (required) the database file to open. this can be an absolute or relative
path. if a relative
path is given, it is interpreted as relative to the current profile's directory. if the
path does not exist, a new sqlite database will be created. the value typically ends with .sqlite. sharedmemorycache (optional) boolean indicating whether multiple connections to the database share the same memory ...
...lease note that this is not a timer on the idle service and this could fire while the application is active. openconnection(options) returns a promise that resolves to an opened connection instance or is rejected if an error occurred while opening the database. here is an example: components.utils.import("resource://gre/modules/sqlite.jsm"); try { const conn = await sqlite.openconnection({
path: "mydatabase.sqlite", sharedmemorycache: false }); // connection is the opened sqlite connection (see below for api). } catch (error) { // the connection could not be opened. error is an error describing what went wrong. } working with opened connections opened connections are what you will interface most with in sqlite.jsm. the following sections detail the api of an opened connection ins...
... the transaction will be forcibly rolled back. if statements are in progress at the time this function is called, they will be cancelled. callers should not attempt to use the connection after calling this method as the connection will be unusable. it is possible to automatically close the connection when the browser is closed with the shutdown hook: const conn = await sqlite.openconnection({
path: "mydatabase.sqlite", sharedmemorycache: false }); try { sqlite.shutdown.addblocker("my connection closing", async () => await conn.close()); } catch (e) { // it's too late to block shutdown, just close the connection. await conn.close(); throw e; } clone(readonly) this function returns a clone of the current connection-promise. these functions receive th...
...And 2 more matches
Localizing with Mercurial
ll not only install hg, but also all the tools required to build mozilla products on windows. trust us, you'll want this eventually. for a graphical interface, you may want to install tortoisehg, which integrates with your windows explorer shell. it also installs the command line utility. ...
... mozilla products on windows. trust us, you'll want this eventually. for a graphical interface, you may want to install tortoisehg, which integrates with your windows explorer shell. it also installs the command line utility. part of the command line hg install for windows involves making sure the hg executable is in the system's %
path% variable (tortoisehg doesn't need this step). use the add_
path.exe utility found in c:\mozilla-build\hg to do this. ...
...which integrates with your windows explorer shell. it also installs the command line utility. part of the command line hg install for windows involves making sure the hg executable is in the system's %
path% variable (tortoisehg doesn't need this step). use the add_
path.exe utility found in c:\mozilla-build\hg to do this. ps c:\users\your_id> cd c:\mozilla-build\hg ps c:\mozilla-build\hg> .\add_
path.exe /result . note the dot (".") at the end of the second command, which means the current directory. ...
...And 2 more matches
certutil
certificate, but they can also be generated independently using the -g command option. certutil -g -d [sql:]directory | -h tokenname -k key-type -g key-size [-y exponent-value] -q pqgfile|curve-name for example: $ certutil -g -h lunasa -k ec -g 256 -q sect193r2 listing certificates the -l command option lists all of the certificates listed in the certificate database. the
path to the directory (-d) is required. $ certutil -l -d sql:/home/my/sharednssdb certificate nickname trust attributes ssl,s/mime,jar/xpi ca administrator of instance pki-ca1's example domain id u,u,u tps administrator's example domain id u,u,u google internet autho...
...qyhcu u0ujll1h/rwcjn607+ctekh9jlmuqciqpjnoa+kq/6f7nhnrriuzasibzc30bz5a ni7q5n1usm3ewqlvxw== -----end certificate----- listing keys keys are the original material used to encrypt certificate data. the keys generated for certificates are stored separately, in the key database. to list all keys in the database, use the -k command option and the (required) -d argument to give the
path to the directory. $ certutil -k -d sql:/home/my/sharednssdb certutil: checking token "nss certificate db" in slot "nss user private key and certificate services " < 0> rsa 455a6673bde9375c2887ec8bf8016b3f9f35861d thawte freemail member's thawte consulting (pty) ltd. id < 1> rsa 40defeeb522ade11090eacebaaf1196a172127df example domain administrator cert < 2> rsa...
...n the -k key-type argument can search a specific type of key, like rsa, dsa, or ecc. listing security modules the devices that can be used to store certificates -- both internal databases and external devices like smart cards -- are recognized and used by loading security modules. the -u command option lists all of the security modules listed in the secmod.db database. the
path to the directory (-d) is required. $ certutil -u -d sql:/home/my/sharednssdb slot: nss user private key and certificate services token: nss certificate db slot: nss internal cryptographic services token: nss generic crypto services adding certificates to the database existing certificates or certificate requests can be added manually to the certificate database...
...And 2 more matches
SpiderMonkey Build Documentation
you can override this by passing options to the configure script: what it is where it gets put configure option executables, shell scripts /usr/local/bin --bindir libraries, data /usr/local/lib --libdir ...
...you can override this by passing options to the configure script: what it is where it gets put configure option executables, shell scripts /usr/local/bin --bindir libraries, data /usr/local/lib --libdir ...
... (e.g. mac os x 10.5), you can use the following: ar=ar cc="gcc -m64" cxx="g++ -m64" ../configure --target=x86_64-apple-darwin10.0.0 to build a 64-bit windows version, you can use the following: $src/configure --host=x86_64-pc-mingw32 --target=x86_64-pc-mingw32 note: you must have started your mozillabuild shell with the proper -x64.bat script in order for the 64-bit compilers to be in your
path. whatever compiler and flags you pass to configure are recorded in the generated makefile, so you don't need to specify them again until you re-run configure. building your application while "how to build your complete application" is clearly out of scope for this document, here are some tips that will help get you on your way: the spidermonkey developers frequently and deliberately change ...
...And 2 more matches
Shell global objects
troduction to the javascript shell and is probably not complete. see js/src/shell/js.cpp (around shell_functions) for more. this page lists variables and functions available on spidermonkey 53. there may be some difference between each versions. you can get the list of functions by help() function in js shell. variables scriptargs an array that contains arguments passed to js shell. script
path a string that is a
path of script. console an object that has following property: log evaluate and print expressions to stdout. this function is an alias of the print() function. timesaccessed returns a number that indicates how many times this variable is accessed perfmeasurement see perfmeasurement.jsm. shell only functions functions always available version([number]) ge...
...ep for dt seconds. compile(code) compiles a string to bytecode, potentially throwing. parsemodule(code) parses source text as a module and returns a module object. setmoduleresolvehook(function(module, specifier) {}) set the hostresolveimportedmodule hook to function. this hook is used to look up a previously loaded module object. it should be implemented by the module loader. getmoduleload
path() return any --module-load-
path argument passed to the shell. used by the module loader. parse(code) parses a string, potentially throwing. syntaxparse(code) check the syntax of a string, returning success value offthreadcompilescript(code[, options]) compile code on a helper thread. to wait for the compilation to finish and run the code, call runoffthreadscript. if present, options may ha...
... repeatedly getting the same value creates multiple distinct clones. line2pc([fun,] line) map line number to pc. pc2line(fun[, pc]) map pc to line number. nestedshell(shellargs...) execute the given code in a new js shell process, passing this nested shell the arguments passed to nestedshell. argv[0] of the nested shell will be argv[0] of the current shell (which is assumed to be the actual
path to the shell. arguments[0] (of the call to nestedshell) will be argv[1], arguments[1] will be argv[2], etc. assertfloat32(value, isfloat32) in ionmonkey only, asserts that value has (resp. hasn't) the mirtype::float32 if isfloat32 is true (resp. false). assertrecoveredonbailout(var) in ionmonkey only, asserts that variable has recoveredonbailout flag. withsourcehook(hook, fun) set this js r...
...And 2 more matches
Thread Sanitizer
o get yourself a clone of mozilla-central. ...
...he build configuration file .mozconfig with the following content in your mozilla-central directory: mk_add_options moz_objdir=@topsrcdir@/objdir-ff-tsan mk_add_options moz_make_flags=-j12 # enable llvm specific code and build workarounds ac_add_options --enable-thread-sanitizer # if clang is already in your $
path, then these can simply be: # export cc=clang # export cxx=clang++ export cc="/
path/to/clang" export cxx="/
path/to/clang++" # llvm-symbolizer displays much more complete backtraces when data races are detected. # if it's not already in your $
path, then uncomment this next line: #export llvm_symbolizer="/
path/to/llvm-symbolizer" # add tsan to our compiler flags export cflags="-fsanitize=thread -fpic -pie" export cxxflags="-fsanitize=thread -fpic -pie" # additionally, we need t...
...ow you start the build process using the regular make -f client.mk command. starting firefox after the build has completed, you can start firefox from the objdir as usual. building only the javascript shell if you want to build only the javascript shell instead of doing a full firefox build, the build script below will probably help you to do so. before using it, you must of course adjust the
path name for llvm_root to match your setup. once you have adjusted everything, execute this script in the js/src/ subdirectory and pass a directory name as the first parameter. the build will then be created in a new subdirectory with that name. #! /bin/sh if [ -z $1 ] ; then echo "usage: $0 <dirname>" elif [ -d $1 ] ; then echo "directory $1 already exists" else autoconf2.13 mkdir ...
...And 2 more matches
Creating the Component Code
mplementation has a separate cid. the interface also as an iid which is the same for both implementations. when specifying implementation a, the two required pieces of information are the cid of a and the iid of the interface that a supports. ...
...to unregister, all you have to do is pass the cid and the file which is passed into unregisterself. creating an instance of your component the example above uses a cid, but after the component is ...
...; samplefactory* factory = new samplefactory(); if (!factory) return ns_error_out_of_memory; nsresult rv = factory->queryinterface(aiid, result); if (ns_failed(rv)) { *result = nsnull; delete factory; } return rv; } //---------------------------------------- ns_imethodimp samplemodule::registerself(nsicomponentmanager *acompmgr, nsifile* a
path, const char* registrylocation, const char* componenttype) { nsicomponentregistrar* compreg = nsnull; nsresult rv = acompmgr->queryinterface(kicomponentregistrariid, (void**)&compreg); if (ns_failed(rv)) return rv; rv = compreg->registerfactorylocation(ksamplecid, "sample class", ...
...And 2 more matches
nsIFilePicker
} }); if your code is a component and window is not defined, you can get one using nsiwindowmediator. when selecting multiple files: .... fp.init(window, "dialog title", nsifilepicker.modeopenmultiple); .... var files = fp.
...picker;1"] .createinstance(nsifilepicker); fp.init(window, "dialog title", nsifilepicker.modeopen); fp.appendfilters(nsifilepicker.filterall | nsifilepicker.filtertext); fp.open(function (rv) { if (rv == nsifilepicker.returnok || rv == nsifilepicker.returnreplace) { var file = fp.file; // get the
path as string. note that you usually won't // need to work with the string
paths. var
path = fp.file.
path; // work with returned nsilocalfile... ...
...e that you usually won't // need to work with the string
paths. var
path = fp.file.
path; // work with returned nsilocalfile... } }); if your code is a component and window is not defined, you can get one using nsiwindowmediator. when selecting multiple files: .... fp.init(window, "dialog title", nsifilepicker.modeopenmultiple); .... ...
...And 2 more matches
nsIZipReader
der. then you can copy and paste this code in scratchpad to run it. ...
...y and paste this code in scratchpad to run it. ...
...n scratchpad to run it. ...
...And 2 more matches
Virtualenv
it is written by mozilla's own ian bicking. creating a virtualenv installs setuptools (or optionally distribute) into the virtual environment. it is recommended that you use virtualenv for installing anything other than system software that you are working on. you will obviate the need to have access to your system packages and you won't mess up your system packages with whatever code you install into the site-packages directory of the virtualenv. site-packages should mostly be for system-installed python and not python that you are installing as a user. ...
... subdirectory (or scripts on windows). ...
...ory (or scripts on windows). ...
...And 2 more matches
Plug-in Basics - Plugins
nds plug-ins, describes these rules, and the following section, checking plug-ins by mime type, describes how you can use javascript to locate plug-ins yourself and establish which ones are to be registered for which mime types. how gecko finds plug-ins when a gecko-based browser starts up, it checks certain directories for plug-ins, in this order: windows directory pointed to by moz_plugin_
path environment variable. %appdata%\mozilla\plugins, where %appdata% denotes per-user application data directory. plug-ins within toolkit bundles. profile directory\plugins, where profile directory is a user profile directory. directories pointed to by hkey_current_user\software\mozillaplugins\*\
path registry value, where * can be replaced by any name. directories pointed to by hkey_local_machin...
...data%\mozilla\plugins, where %appdata% denotes per-user application data directory. plug-ins within toolkit bundles. profile directory\plugins, where profile directory is a user profile directory. directories pointed to by hkey_current_user\software\mozillaplugins\*\
path registry value, where * can be replaced by any name. directories pointed to by hkey_local_machine\software\mozillaplugins\*\
path registry value, where * can be replaced by any name. mac os x ~/library/internet plug-ins. /library/internet plug-ins. /system/library/frameworks/javavm.framework/versions/current/resources. plug-ins within toolkit bundles. profile directory/plugins, where profile directory is a user profile directory. linux directory pointed to by moz_plugin_
path environment variable. for example: ...
...eplaced by any name. mac os x ~/library/internet plug-ins. /library/internet plug-ins. /system/library/frameworks/javavm.framework/versions/current/resources. plug-ins within toolkit bundles. profile directory/plugins, where profile directory is a user profile directory. linux directory pointed to by moz_plugin_
path environment variable. for example: #!/bin/bash export moz_plugin_
path=/usr/lib64/mozilla/plugins exec /usr/lib64/firefox/firefox profile directory/plugins, where profile directory is the directory of the current user profile. ~/.mozilla/plugins. /usr/lib/mozilla/plugins (the 64-bit firefox checks /usr/lib64/mozilla/plugins as well). /usr/lib64/firefox/plugins (for 64-bit firefox) note: firefox nightly checks a subset of these locations. also some linux dist...
...And 2 more matches
Streams - Plugins
. random-access mode: the plug-in calls the npn_requestread method to "pull" stream data. in general, this mode is more expensive, because the entire stream must be downloaded to a temporary file before use unless the stream comes from a local file or an http server that supports the byte-range extension to http. file mode: the browser saves the entire stream to a local file and passes the file
path to the plug-in instance through the npp_streamasfile method. use this feature only as a last resort; plug-ins should implement an incremental stream-based interface wherever possible. streams sent by the plug-in to the browser are like normal-mode streams produced by the browser, but in reverse. in normal-mode streams, the browser calls the plug-in to tell it when a stream is created and to pus...
...se transmission modes: np_normal: (default): the plug-in can process the data progressively as it arrives from the network or file system through a series of calls to npp_writeready and npp_write. np_asfileonly: this plug-in gets full random access to the data using platform-specific file operations. the browser saves stream data to a local file, and, when the stream is complete, delivers the
path of the file through a call to npp_streamasfile. np_asfile: this mode is like np_asfileonly except that data is delivered to the plug-in as it is saved to the file, through a series of calls to npp_write. you should use np_asfileonly whenever possible in preference to np_asfile, which is less efficient because it uses successive calls to npp_write to send the data. np_seek: the plug-in instance ...
...s, either through a list of npbyterange objects in a single call to npn_requestread or through multiple calls to npn_requestread. in this case, the browser can write individual ranges in any order, with any number of npp_writeready and npp_write calls. sending the stream in file mode if the stream is sent in file mode, the browser saves the entire stream to a local file and passes the full file
path to the plug-in instance through the npp_streamasfile method. use this feature only as a last resort; plug-ins should implement an incremental stream-based interface whenever possible. file mode is determined in npp_newstream by setting the mode np_asfileonly. this mode gives the plug-in full random access to the data with platform-specific file operations. the browser saves stream data to a loca...
...And 2 more matches
Dominators view - Firefox Developer Tools
to the dominators ui section. otherwise, you might want to review the article on dominators concepts. dominators ui to see the dominators view for a snapshot, select "dominators" in the "view" drop-down list. it looks something like this: the dominators view consists of two panels: the dominators tree panel shows you which nodes in the snapshot are retaining the most memory the retaining
paths panel (new in firefox 47) shows the 5 shortest retaining
paths for a single node. dominators tree panel the dominators tree tells you which objects in the snapshot are retaining the most memory. in the main part of the ui, the first row is labeled "gc roots". immediately underneath that is an entry for: every gc root node. in gecko, there is more than one memory graph, and therefore mor...
...the name of the function that allocated it, and the file, line number and character position of the exact spot where the function allocated it. clicking the file name will take you to that spot in the debugger. sometimes you'll see "(no stack available)" here. in particular, allocation stacks are currently only recorded for objects, not for arrays, strings, or internal structures. retaining
paths panel the retaining
paths panel is new in firefox 47. the retaining
paths panel shows you, for a given node, the 5 shortest
paths back from this node to a gc root. this enables you to see all the nodes that are keeping the given node from being garbage-collected. if you suspect that an object is being leaked, this will show you exactly which objects are holding a reference to it. to see the r...
...the retaining
paths panel is new in firefox 47. the retaining
paths panel shows you, for a given node, the 5 shortest
paths back from this node to a gc root. this enables you to see all the nodes that are keeping the given node from being garbage-collected. if you suspect that an object is being leaked, this will show you exactly which objects are holding a reference to it. to see the retaining
paths for a node, you have to select the node in the dominators tree panel: here, we've selected an object, and can see a single
path back to a gc root. the window gc root holds a reference to an htmldivelement object, and that holds a reference to an object, and so on. if you look in the dominators tree panel, you can trace the same
path there. if either of these references were removed, the item...
...And 2 more matches
Examine and edit HTML - Firefox Developer Tools
bar has its own keyboard shortcuts. searching the page inspector's search box matches all markup in the current document and in any frames. to start searching the markup, click in the search box to expand it or press ctrl + f , or cmd + f on a mac. there are three types of searches that are performed automatically depending on what you enter, a full text search, a css selector search, and an x
path search. full text search the full text search will always be executed, independently of what you enter. that allows you to find css selectors and x
path expressions occurring within the text. css selector search you can search elements by entering a css selector. as you type, an autocomplete popup shows any class or id attributes that match the current search term: press up and down to cyc...
...earch elements by entering a css selector. as you type, an autocomplete popup shows any class or id attributes that match the current search term: press up and down to cycle through suggestions, tab to choose the current suggestion, then enter to select the first node with that attribute. to cycle through matches, press enter. you can cycle backwards through matches using shift + enter. x
path search it is also possible to search via x
paths. this allows you to search for specific elements without the conflict of matching words within the text. for example, //a matches all <a> elements but not the letter "a" within the text content. furthermore it allows for some more advanced searches like finding elements that start with a specific text, for example. html tree the rest of the pan...
... copy attribute value edit attribute remove attribute break on ... ...
...And 2 more matches
CanvasRenderingContext2D.ellipse() - Web APIs
parameters x the x-axis (horizontal) coordinate of the ellipse's center. y the y-axis (vertical) coordinate of the ellipse's center. radiusx the ellipse's major-axis radius. must be non-negative. ...
... parameters x the x-axis (horizontal) coordinate of the ellipse's center. y the y-axis (vertical) coordinate of the ellipse's center. radiusx the ellipse's major-axis radius. must be non-negative. ...
... drawing a full ellipse this example draws an ellipse at an angle of π/4 radians (45°). to make a full ellipse, the arc begins at an angle of 0 radians (0°), and ends at an angle of 2π radians (360°). html <canvas id="canvas" width="200" height="200"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // draw the ellipse ctx.begin
path(); ctx.ellipse(100, 100, 50, 75, math.pi / 4, 0, 2 * math.pi); ctx.stroke(); // draw the ellipse's line of reflection ctx.begin
path(); ctx.setlinedash([5, 5]); ctx.moveto(0, 200); ctx.lineto(200, 0); ctx.stroke(); result various elliptical arcs this example creates three elliptical
paths with varying properties. html <canvas id="canvas"></canvas> javascript const canvas = document.get...
...And 2 more matches
CanvasRenderingContext2D.quadraticCurveTo() - Web APIs
syntax void ctx.quadraticcurveto(cpx, cpy, x, y); parameters cpx the x-axis coordinate of the control point. cpy the y-axis coordinate of the control point. x the x-axis coordinate of the end point. y the y-axis coordinate of the end point. ...
... syntax void ctx.quadraticcurveto(cpx, cpy, x, y); parameters cpx the x-axis coordinate of the control point. cpy the y-axis coordinate of the control point. x the x-axis coordinate of the end point. y the y-axis coordinate of the end point. ...
...axis coordinate of the control point. x the x-axis coordinate of the end point. y the y-axis coordinate of the end point. examples how quadraticcurveto works this example shows how a quadratic bézier curve is drawn. ...
...And 2 more matches
Compositing example - Web APIs
ctx.restore(); dd.appendchild(canvastodrawon); dd.appendchild(canvastodrawfrom); dd.appendchild(canvastodrawresult); dl.appendchild(dd); } }; utility functions the program relies on a number of utility functions. ...
...anvastodrawresult); dl.appendchild(dd); } }; utility functions the program relies on a number of utility functions. ...
...ctions. ...
...And 2 more matches
Using XMLHttpRequest - Web APIs
some manipulation and analysis are outlined in the following sections. analyzing and manipulating the responsexml property if you use xmlhttprequest to get the content of a remote xml document, the responsexml property will be a dom object containing a parsed xml document. this could prove difficult to manipulate and analyze. there are four primary ways of analyzing this xml document: using x
path to address (or point to) parts of it. manually parsing and serializing xml to strings or objects. using xmlserializer to serialize dom trees to strings or to files. regexp can be used if you always know the content of the xml document beforehand. you might want to remove line breaks, if you use regexp to scan with regard to line breaks. however, this method is a "last resort" since if the xml ...
...ader("last-modified")); /* a valid gmtstring date or null */ } var oreq = new xmlhttprequest(); oreq.open("head" /* use head if you only need the headers! ...
...*/ ifh...
...And 2 more matches
Web APIs
s_element_index_uint oes_fbo_render_mipmap oes_standard_derivatives oes_texture_float oes_texture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multiview2 offlineaudiocompletionevent offlineaudiocontext offscreencanvas orientationsensor oscillatornode overconstrainederror p pagetransitionevent paintworklet pannernode parentnode passwordcredential
path2d payererrors paymentaddress paymentcurrencyamount paymentdetailsbase paymentdetailsupdate paymentitem paymentmethodchangeevent paymentrequest paymentrequestevent paymentrequestupdateevent paymentresponse paymentvalidationerrors pbkdf2params performance performanceentry performanceeventtiming performanceframetiming performancelongtasktiming performancemark performancemeasure performancena...
...nimatecolorelement svganimateelement svganimatemotionelement svganimatetransformelement svganimatedangle svganimatedboolean svganimatedenumeration svganimatedinteger svganimatedlength svganimatedlengthlist svganimatednumber svganimatednumberlist svganimatedpoints svganimatedpreserveaspectratio svganimatedrect svganimatedstring svganimatedtransformlist svganimationelement svgcircleelement svgclip
pathelement svgcolorprofileelement svgcomponenttransferfunctionelement svgcursorelement svgdefselement svgdescelement svgelement svgellipseelement svgevent svgexternalresourcesrequired svgfeblendelement svgfecolormatrixelement svgfecomponenttransferelement svgfecompositeelement svgfeconvolvematrixelement svgfediffuselightingelement svgfedisplacementmapelement svgfedistantlightelement svgfedropshad...
...primitivestandardattributes svgfontelement svgfontfaceelement svgfontfaceformatelement svgfontfacenameelement svgfontfacesrcelement svgfontfaceurielement svgforeignobjectelement svggelement svggeometryelement svgglyphelement svgglyphrefelement svggradientelement svggraphicselement svghkernelement svgimageelement svglength svglengthlist svglineelement svglineargradientelement svgm
pathelement svgmaskelement svgmatrix svgmeshelement svgmetadataelement svgmissingglyphelement svgnumber svgnumberlist svg
pathelement svgpatternelement svgpoint svgpolygonelement svgpolylineelement svgpreserveaspectratio svgradialgradientelement svgrect svgrectelement svgrenderingintent svgsvgelement svgscriptelement svgsetelement svgsolidcolorelement svgstopelement svgstringlist svgstylable ...
...And 2 more matches
<input type="file"> - HTML: Hypertext Markup Language
chosen, the files can be uploaded to a server using form submission, or manipulated using javascript code and the file api. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a domstring representing the
path to the selected file. events change and input supported common attributes required additional attributes accept, capture, files, multiple idl attributes files and value dom interface htmlinputelement properties properties that apply only to elements of type file methods select() value a f...
...if the user selected multiple files, the value represents the first file in the list of files they selected. the other files can be identified using the input's htmlinputelement.files property. note: if multiple files are selected, the string represents the first selected file. javascript can access the other files through the input's files property. if no file is ye...
...epresents the first file in the list of files they selected. the other files can be identified using the input's htmlinputelement.files property. note: if multiple files are selected, the string represents the first selected file. javascript can access the other files through the input's files property. if no file is yet selected, the string is "" (empty). the string is prefixed with c:\fake
path\, to prevent malicious software from guessing the user's file structure. additional attributes in addition to the common attributes shared by all <input> elements, inputs of type file also support the following attributes: attribute description accept one or more unique file type specifiers describing file types to allow capture what source to use for ...
...And 2 more matches
Populating the page: how browsers work - Web Performance
why it's important for web performance optimization to include everything the browser needs to start rendering a page, or at least a template of the page - the css and html needed for the first render -- in the first 14 kilobytes. but before anything is rendered to the screen, the html, css, and javascript have to be parsed. building the dom tree we describe five steps in the critical rendering
path. the first step is processing the html markup and building the dom tree. html parsing involves tokenization and tree construction. html tokens include start and end tags, as well as attribute names and values. if the document is well-formed, parsing it is straightforward and faster. the parser parses tokenized input into the document, building up the document tree. the dom tree describes the co...
...ell. to ensure the script doesn't block the process, add the async attribute, or the defer attribute if javascript parsing and execution order is not important. waiting to obtain css doesn't block html parsing or downloading, but it does block javascript, because javascript is often used to query css properties’ impact on elements. building the cssom the second step in the critical rendering
path is processing css and building the cssom tree. the css object model is similar to the dom. the dom and cssom are both trees. they are independent data structures. the browser converts the css rules into a map of styles it can understand and work with. the browser goes through each rule set in the css, creating a tree of nodes with parent, child, and sibling relationships based on the css selector...
...ted in the parsing step are combined into a render tree which is then used to compute the layout of every visible element, which is then painted to the screen. in some cases, content can be promoted to their own layers and composited, improving performance by painting portions of the screen on the gpu instead of the cpu, freeing up the main thread. style the third step in the critical rendering
path is combining the dom and cssom into a render tree.the computed style tree, or render tree, construction starts with the root of the dom tree, traversing each visible node. tags that aren't going to be displayed, like the <head> and its children and any nodes with display: none, such as the script { display: none; } you will find in user agent stylesheets, are not included in the render tree as t...
...And 2 more matches
href - SVG: Scalable Vector Graphics
efines a link to a resource as a reference url. the exact meaning of that link depends on the context of each element using it. note: specifications before svg 2 defined an xlink:href attribute, which is now rendered obsolete by the href attribute. fifteen elements are using this attribute: <a>, <animate>, <animatemotion>, <animatetransform>, <discard>, <feimage>, <image>, <lineargradient>, <m
path>, <pattern>, <radialgradient>, <script>, <set>, <text
path>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a url reference. value <url> ...
...tp://www.w3.org/2000/svg"> <image href="/files/2917/fxlogo.png" x="0" y="0" height="100" width="100"/> </svg> lineargradient for <lineargradient>, href defines url referring to a template gradient element; to be valid, the reference must be to a different <lineargradient> or <radialgradient> element. value <url> default value none animatable yes m
path for <m
path>, href defines a url referring to the <
path> element or basic shape which defines the motion
path. value <url> default value none animatable no pattern for <pattern>, href defines a url referring to a different <pattern> element within the current svg document. any attributes which are defined on the referenced element which are not defined...
...gradient element; to be valid, the reference must be to a different <lineargradient> or <radialgradient> element. value <url> default value none animatable yes script for <script>, href defines a url referring to an external resource containing the script code. value <url> default value none animatable no text
path for <text
path>, href defines a url referring to the <
path> element or basic shape onto which the text will be rendered if no
path attribute is provided. on the <text
path> element, the href attribute is animatable. value <url> default value none animatable yes use for <use>, href defines a url referring to an element or fragment within an svg document ...
...And 2 more matches
xlink:href - SVG: Scalable Vector Graphics
meaning of that link depends on the context of each element using it. note: svg 2 removed the need for the xlink namespace, so instead of xlink:href you should use href. 22 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <m
path>, <pattern>, <radialgradient>, <script>, <set>, <text
path>, <tref>, and <use>} html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a xlink:href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> a for <a>, xlink:href defines the location of the referenced object. value <iri> default v...
...te), then this element inherits the gradient stop from the referenced element. inheritance can be indirect to an arbitrary level; thus, if the referenced element inherits attribute or gradient stops due to its own xlink:href attribute, then the current element can inherit those attributes or gradient stops. value <iri> default value none animatable yes m
path for <m
path>, xlink:href defines the reference to the <
path> element which defines the motion
path. value <iri> default value none animatable no pattern for <pattern>, xlink:href defines the reference to a different <pattern> element within the current svg document fragment. any attributes which are defined on the referenced element which are not defin...
...s due to its own xlink:href attribute, then the current element can inherit those attributes or gradient stops. value <iri> default value none animatable yes script for <script>, xlink:href defines a reference to an external resource containing the script code. value <iri> default value none animatable no text
path for <text
path>, xlink:href defines a reference to the <
path> element onto which the glyphs will be rendered. value <iri> default value none animatable yes use for <use>, xlink:href defines the location of the referenced object. value <iri> default value none animatable yes tref for <tref>, xlink:href define...
...And 2 more matches
<metadata> - SVG: Scalable Vector Graphics
et3"/> <connect:ends rdf:resource="#socket4"/> <connect:ends rdf:resource="#socket5"/> </rdf:description> </rdf:rdf> </metadata> <title>network</title> <desc>an example of a computer network based on a hub.</desc> <style> svg { /* default styles to be inherited */ fill: white; stroke: black; } text { fill: black; stroke: none; }
path { fill: none; } </style> <!-- define symbols used in the svg --> <defs> <!-- hubplug symbol. used by hub symbol --> <symbol id="hubplug"> <desc>a 10baset/100basetx socket</desc> <
path d="m0,10 h5 v-9 h12 v9 h5 v16 h-22 z"/> </symbol> <!-- hub symbol --> <symbol id="hub"> <desc>a typical 10baset/100basetx network hub</desc> <text x="0" y="15">hu...
... <title>socket 5</title> <use xlink:href="#hubplug"/> </g> </g> </symbol> <!-- computer symbol --> <symbol id="computer"> <desc>a common desktop pc</desc> <g id="monitorstand" transform="translate(40 121)"> <title>monitor stand</title> <desc>one of those cool swivelling monitor stands that sit under the monitor</desc> <
path d="m0,0 s 10 10 40 12"/> <
path d="m80,0 s 70 10 40 12"/> <
path d="m0,20 l 10 10 s 40 12 70 10 l 80 20z"/> </g> <g id="monitor"> <title>monitor</title> <desc>a very fancy monitor</desc> <rect width="160" height="120"/> <rect fill="lightgrey" width="138" height="95" x="11" y="12"/> </g> <g id="processor" transform="translate(0 ...
... <use xlink:href="#computer" transform="scale(0.5)"/> </g> <!-- use the same computer symbol. --> <g id="computerb" transform="translate(300 170)"> <title>computer b</title> <use xlink:href="#computer" transform="scale(0.5)"/> </g> <!-- draw cable a. ...
...And 2 more matches
Compiling from Rust to WebAssembly - WebAssembly
s you manage multiple versions of rust. by default, it installs the latest stable rust release, which you can use for general rust development. rustup installs rustc, the rust compiler, as well as cargo, rust's package manager, rust-std, rust's standard libraries, and some helpful docs — rust-docs. note: pay attention to the post-install note about needing cargo's bin directory in your system
path. this is added automatically, but you must restart your terminal for it to take effect. wasm-pack to build the package, we need an additional tool, wasm-pack. this helps compile the code to webassembly, as well as produce the right packaging for npm. to download and install it, enter the following command into your terminal: $ cargo install wasm-pack install node.js we are building an npm p...
... "serve": "webpack-dev-server" }, "dependencies": { "hello-wasm": "^0.1.0" }, "devdependencies": { "webpack": "^4.25.1", "webpack-cli": "^3.1.2", "webpack-dev-server": "^3.1.10" } } note that you need to fill in your own username, after the @, in the dependencies section. next, we need to configure webpack. ...
...pack-dev-server" }, "dependencies": { "hello-wasm": "^0.1.0" }, "devdependencies": { "webpack": "^4.25.1", "webpack-cli": "^3.1.2", "webpack-dev-server": "^3.1.10" } } note that you need to fill in your own username, after the @, in the dependencies section. next, we need to configure webpack. ...
...And 2 more matches
url - Archive of obsolete content
ve source urls into absolute ones. dataurl(uri) the dataurl constructor creates an object that represents a data: url, verifying that the provided string is a valid data: url in the process. parameters uri : string a string to be parsed as data url. if is not a valid uri, this constructor will throw an exception. functions tofilename(url) attempts to convert the given url to a native file
path. ...
...ng to be parsed as data url. if is not a valid uri, this constructor will throw an exception. functions tofilename(url) attempts to convert the given url to a native file
path. this function will automatically attempt to resolve non-file protocols, such as the resource: protocol, to their place on the file system. an exception is raised if the url can't be converted; otherwise, the native file
path is returned as a string. parameters url : string the url, as a string, to be converted. returns string : the converted native file
path as a string. fromfilename(
path) converts the given native file
path to a file: url. parameters
path : string the native file
path, as a string, to be converted. returns string : the converted url as a string. isvaliduri(uri) checks the validity of a...
...le=yes#top"); console.log(url.scheme); // https userpass the username:password part of the url, null if not present. host the host of the url, null if not present. for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.host); // developer.mozilla.org port the port number of the url, null if none was specified.
path the
path component of the url. contains everything after the host of the url. compare with
pathname. for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.
path); // /add-ons?example=true&visible=yes#top hostname the domain of the url, as a string. mirrors window.location.hostname. for example: var url = require("...
.../url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.
path); // /add-ons?example=true&visible=yes#top hostname the domain of the url, as a string. mirrors window.location.hostname. for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.hostname); // developer.mozilla.org
pathname an initial '/' followed by the
path of the url, as a string. compare with
path. mirrors window.location.
pathname. for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.
pathname); // /add-ons hash a '#' followed by the fragment identifier of the url, as a string. mirrors window.location.hash. for example: var ...
Canvas code snippets - Archive of obsolete content
{ if (typeof canvas === 'string') { canvas = document.getelementbyid(canvas); } if (!(this instanceof canvas2dcontext)) { return new canvas2dcontext(canvas); } this.context = this.ctx = canvas.getcontext('2d'); if (!canvas2dcontext.prototype.arc) { canvas2dcontext.setup.call(this, this.ctx); } } canvas2dcontext.setup = function() { var methods = ['arc', 'arcto', 'begin
path', 'beziercurveto', 'clearrect', 'clip', 'close
path', 'drawimage', 'fill', 'fillrect', 'filltext', 'lineto', 'moveto', 'quadraticcurveto', 'rect', 'restore', 'rotate', 'save', 'scale', 'settransform', 'stroke', 'strokerect', 'stroketext', 'transform', 'translate']; var gettermethods = ['createpattern', 'drawfocusring', 'ispointin
path', 'measuretext', // drawfocusring not currently s...
...operty name as a function (but without arguments) to get the value var strokestyle = canvas2dcontext(canvas) .strokestyle('rgb(50, 110, 210)') .strokestyle(); code usable only from privileged code these snippets are only useful from privileged code, such as extensions or privileged apps. ...
...these snippets are only useful from privileged code, such as extensions or privileged apps. saving a canvas image to a file the following function accepts a canvas object and a destination file
path string. the canvas is converted to a png file and saved to the specified location. the function returns a promise which resolves when the file has been completely saved. ...
... the file has been completely saved. function savecanvas(canvas,
path, type, options) { return task.spawn(function *() { var reader = new filereader; var blob = yield new promise(accept => canvas.toblob(accept, type, options)); reader.readasarraybuffer(blob); yield new promise(accept => { reader.onloadend = accept }); return yield os.file.writeatomic(
path, new uint8array(reader.result), { tmp
path:
path + '.tmp' }); }); } loading a remote page onto a canvas element the following class first creates a hidden iframe element and attaches a listener to the frame's load event. once the remote page has loaded, the remotepageloaded method fires. this method gets a reference to the iframe's window and draws t...
Enhanced Extension Installation - Archive of obsolete content
application>/extensions/ any location specified in a text file with a {guid} name placed in one of the above locations, useful for developing extensions at another location, e.g. a nfs home directory and simply placing a text "link" file in the applicable directory above that links to the location of the extension in its installed state at the other location. any location specified in a guid-to-
path registry key mapping, e.g. [hklm|hkcu]\software\mozilla\firefox\extensions given these goals, and the likelihood of future goals, such as potential for extensions to the xulrunner framework, common drop zones for xpis etc it makes sense to have the set of install locations be customizable. by default, the application knows about and maintains three install locations: app-profile a director...
...plication knows about and maintains three install locations: app-profile a directory-based install location for items living in the application profile extensions directory. app-global a directory-based install location for items living in the application global extensions directory. app-registry a registry-key based install location for items living at locations specified by a guid-to-
path value set within the registry at a predefined location. to implement this, we create an interface that the extension manager can ask for information about the location, such as what its name is, where its located on disk (if anywhere, in the case of registry based locations which have no root directory), for a list of item directories, for a directory of a particular item, for a subdirectory or...
... contains a list of active extension directories (i.e. directories to extensions that are enabled only), to be used by the xredirprovider during startup to locate components, preferences and chrome manifests. the format here is similar to firefox 1.0 except there is no longer a count value that needs to be kept in sync with the number of lines... the file is written simply as extension#=<absolute
path to item> and is read until there are no more numbers. the other difference is that since there is now only a single instance of this file in the profile location, the file
paths are now absolute. <profile>/extensions.rdf -visible items this file contains non-startup and compatibility metadata for extensions that are visible to the user, whether they are enabled or disabled. if an extension is ...
...n in this file. this replaces the individual extensions.rdf files at the old locations. <profile>/extensions-startup.manifest -all items this file contains a tab delimited set of lines, one per item. this is a list of all installed items, disabled or not, keyed first by install location name, then by guid. the following information is stored for each entry: the persistent descriptor of the
path where the item lives. the last modified time of that
path, used to detect out of process upgrades. optionally, an operation key that tells the startup system that there is an install operation pending that needs to be finalized, e.g. needs-install, needs-upgrade, needs-uninstall, needs-enable, needs-disable, needs-install when the extension manager starts, this dataset is read into two d...
Setting Up a Development Environment - Archive of obsolete content
ild firefox, and it is available for all operating systems. make is a default tool in most unix-based systems. it can be installed on mac os x as part of the xcode tools package, and on windows with cygwin. in cygwin installations you'll have to explicitly check the make and zip utilities from the long list of packages to download and install. also make sure that make is in the executable system
path. after setting up make, you should be able to open a command line window, run "make -ver", and get the installed version of make as output. we recommend you set up make in your system, since our examples come with all the necessary files to build and install the resulting xpi using this tool. it will save you some packaging time. or you can create an equivalent system using batch, ant or whateve...
...xtbox you should type this: bash -c "make" or replace "make" with "make clean" for the clean command. the "bash -c" part forces komodo to use bash, which for some reason can't be set properly as the default command shell. it isn't necessary to add this, but it's better so that it is consistent with the make command we'll see next. in the "start in" textbox you should choose %p (directory
path of active project). if you don't see this textbox, click on the "more" button. you also have the option to save the command, by clicking on the "add to toolbox" checkbox. to see the toolbox, click on view > tabs > toolbox, from the main menu. with that, you should now have a very easy way to build your xpi, by just double clicking on the created commands. we can make it even better. once you're ...
... testing and debugging your code, you'll find that constantly building and installing an xpi can be very tedious. this is the reason why we introduced "make install". this only works if your extension is already installed in a firefox profile. just like in the provided project, you need the add-on id and profile location set in the file makefile. we use this information to locate the installation
path of the extension and overwrite the installed files. if firefox is open at the time you run "make install", you'll have to restart it in order to see the changes. it's still better than installing the xpi all over again. you may need to alter the profile location in your makefile. in order to set the profile location to the right value, you should read the support article on profiles, at the mozi...
.... if you need to compile idls, go to the sdk page and download a compiled version for your system. also note any prerequisites you may need. if your system is not listed in the supported builds, you'll have to build the sdk yourself from the mozilla source. good luck with that. you should also set up your environment so that xpidl.exe (or just xpidl on other systems) is in the default executable
path, and also add a variable called gecko_sdk, that points to your sdk build: export gecko_sdk=/
path/to/your/sdk our build system should pick it up from there. to make it work in komodo in unix-based systems, we add the command to the .bash_login file in the home directory, and we modify the commands to this: bash -c ". ~/.bash_login; make" an example project with xpcom components is incl...
The Essentials of an Extension - Archive of obsolete content
es files. this division allows other developers to create themes that replace skins, and translators to create localizations in different languages, all of this without having to change your extension or your code. this gives firefox extensions a great deal of flexibility. chrome files are accessed through the chrome protocol. this is what a chrome uri looks like: chrome://packagename/section/
path/to/file so, for instance, if i want to access the file browseroverlay.xul in the extension, the chrome uri would be chrome://xulschoolhello/content/browseroverlay.xul. if you have too many files in the content and you want to organize them in subdirectories, there's nothing you need to change in chrome.manifest, all you need is to add the right
path after content in the uri. skin and locale ...
...firefox knows what locale to look for. here's an interesting experiment. ...
...e insertbefore or insertafter attributes because the ordering of string bundles doesn't make a difference. the element is completely invisible. if you don't include any of those ordering attributes in an overlay element, firefox will just append your element as the last child of the parent element. all you need for the string bundle is an id (to be able to fetch the element later) and the chrome
path to the properties file. and, of course, you need the properties file: xulschoolhello.greeting.label = hi! how are you? the whitespace around the equals sign is ignored. just like in install.rdf, comments can be added using the # character at the beginning of the line. empty lines are ignored as well. you will often want to include dynamic content as part of localized strings, like when you...
...ts and windows. forgetting to include this file in a xul window usually leads to interesting and often unwanted results. in our case we don't really need to include it, since we're overlaying the main browser xul file, and that file already includes this global css. at any rate it's better to always include it. this way it's harder to make the mistake of not including it. you can enter the chrome
path in the location bar and inspect the file if you're curious. this covers all of the files in the hello world extension. now you should have an idea of the basics involved in extension development, so now we'll jump right in and set up a development environment. but first, a little exercise. exercise make the following changes to the example extension: edit the welcome message that is display...
Signing an XPI - Archive of obsolete content
al folder. in my case it's c:\apps\nss-3.11.4\ get netscape portable runtime 1. download the latest netscape portable runtime from the mozilla ftp site: http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/. for windows you'll want the nspr-4.6.zip package in the v4.6/winnt5.0_opt.obj/ folder. 2. extract the contents of the archive file to a local folder. in my case it's c:\apps\nspr-4.6\ add
path add the nss tools bin/ and lib/, and the nspr lib/ directories to the system
path. you can either set this permanently via control panel->system properties->advanced->environment variables->system variables or do it each time you run the tools from the command-line (preferably using a batch file). windows contains its own version of some of these files (e.g. certutil.exe) in the system directory...
...he nspr lib/ directories to the system
path. you can either set this permanently via control panel->system properties->advanced->environment variables->system variables or do it each time you run the tools from the command-line (preferably using a batch file). windows contains its own version of some of these files (e.g. certutil.exe) in the system directory (\windows\system32\) so ensure the new
paths are first in the
path search list. c:\> set
path=c:\apps\nss-3.11.4\bin\;c:\apps\nss-3.11.4\lib\;c:\apps\nspr-4.6\lib\;%
path% an easier way is to copy everything from your new directories c:\apps\nss-3.11.4\ and c:\apps\nspr-4.6\ including sub directories to the same directory - fx c:\apps\codesigning\ - and then run every command from that. initialize the certificate database decide which ...
...nd in the certificate database: c:\projects\codesigning\> dir x509* 14/12/2005 15:13 1,031 x509.cacert 14/12/2005 15:13 798 x509.raw c:\projects\codesigning\> certutil -d . -l mytestcert u,u,cu prepare xpi file for signing create a new folder just for signing, copy your existing xpi into it, unzip* it (maintaining
paths), delete the xpi and return to the certificate-database folder. *assumes you have a zip utility available on your system
path. this example is using the cygwin bin/zip.exe tool. you can use a graphical zip tool provided it manages the internal sub-directory structure properly. an alternative is to use winrar. the 7-zip tool doesn't work when creating mozilla xpi signed archives because it sort...
... from the issuer; their web site will have a link somewhere to their root cas and public certificates. (certum public key page). i downloaded the certum root ca and certum level iii ca digital id for web and ssl/tls servers, copied the text and saved them to the files c:\projects\codesigning\certum root ca.cer and c:\projects\codesigning\certum level iii ca.cer. open a command prompt (ensure the
paths to the nss tools are set as described above) in the codesigning folder, install the issuer ca certificates, and check they have been added correctly. c:\projects\codesigning> certutil -a -n "certum root ca" -t "tc,tc,tc" -d . -i "certum root ca.cer" c:\projects\codesigning> certutil -a -n "certum level iii ca" -t "c,c,c" -d . -i "certum level iii ca.cer" c:\projects\codesigning> certutil -l -...
Java in Firefox Extensions - Archive of obsolete content
policyclass.newinstance(); policy.setouterpolicy(java.security.policy.getpolicy()); java.security.policy.setpolicy(policy); policy.addpermission(new java.security.allpermission()); for (var j=0; j < urls.length; j++) { policy.addurl(urls[j]); } }catch(e) { alert(e+'::'+e.linenumber); } } //get extension folder installation
path... (this works in firefox 3.x, for firefox 4.x use addonmanager.getaddonbyid) var extension
path = components.classes["@mozilla.org/extensions/manager;1"]. getservice(components.interfaces.nsiextensionmanager). getinstalllocation("test@yoursite"). // guid of extension getitemlocation("test@yoursite"); //the
path logic would work if we include em:unpack for ff...
...byid) var extension
path = components.classes["@mozilla.org/extensions/manager;1"]. getservice(components.interfaces.nsiextensionmanager). getinstalllocation("test@yoursite"). ...
...
path logic would work if we include em:unpack for ff 4.x, for ff 3.x since things are unpacked by default things work // get
path to the jar files (the following assumes your jars are within a // directory called "java" at the root of your extension's folder hierarchy) // you must add this utilities (classloader) jar to give your extension full privileges var extensionurl = "file:///" + extension
path.
path.replace(/\\/g,"/"); var classloaderjar
path = extensionurl + "/java/javafirefoxextensionutils.jar"; // add the
paths for all the other jar files that you will be using var myjar
path = extensionurl + "/java/testjava.jar"; // seems you don't actually have to replace the backslashes as they work as well var urlarray = []; // build a regular javascript array (liveconnect will auto-convert to a j...
...h = extensionurl + "/java/javafirefoxextensionutils.jar"; // add the
paths for all the other jar files that you will be using var myjar
path = extensionurl + "/java/testjava.jar"; // seems you don't actually have to replace the backslashes as they work as well var urlarray = []; // build a regular javascript array (liveconnect will auto-convert to a java array) urlarray[0] = new java.net.url(myjar
path); urlarray[1] = new java.net.url(classloaderjar
path); var cl = java.net.urlclassloader.newinstance(urlarray); //set security policies using the above policyadd() function policyadd(cl, urlarray); now you can begin using liveconnect, including referencing the classes in your jars. be aware that if you have added a namespace within your classes (via "package"), you will need to reference th...
Running Tamarin performance tests - Archive of obsolete content
the tamarin performance tests can be used to measure performance changes made to tamarin. to run performance tests on the android shell see 'testing the android shell' below. running the performance tests requires the following steps: set the avm environment variable to the
path of the avmshell executable. set the builtinabc environment variable to the
path of the builtin.abc. (in the tamarin-redux/generated directory) set the shellabc environment variable to the
path of the shell_toplevel.abc. (in tamarin-redux/generated directory) set the asc environment variable to the
path of the asc.jar compiler. you may download the latest asc.jar from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/...
...ell.sh where $tamarin_build_top is your main tamarin repo folder. note that avm needs to point to android_shell.sh which is a proxy for running the tests on the phone. the /android-public/android-vars.sh script has commented-out examples of the environment settings for running tests on the android avm shell. to recap the other environment settings: - set the builtinabc environment variable to the
path of the /generated/builtin.abc. - you may build the .abc files by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. - set the asc environment variable, as described above. - set the shellabc environm...
...uiltin.abc. - you may build the .abc files by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. - set the asc environment variable, as described above. ...
...adb supports ssh-like commands to an android device. adb automatically connects to a phone if connected by usb. adb shell "ls /" is a good test to see if connected. ...
windowsShortcut - Archive of obsolete content
summary creates a windows shortcut to the installed software. method of file object syntax int windowsshortcut( folderobject atarget, folderobject ashortcut
path, string adescription, folderobject aworking
path, string aparams, folderobject aicon, number aiconid); parameters the windowsshortcut method has the following parameters: atarget a filespecobject representing the absolute
path (including filename) to file that the shortcut will be created for. ashortcut
path a filespecobject representing the absolute
path (not including filename) to where the shortcut is to be created. adescription string description for the shortcut to be used as the shortcut name with a .lnk extension (do not include .lnk in the string). awo...
...can be either .ico, .dll, .exe, or any other binary file that contains icons. ...
...can be either .ico, .dll, .exe, or any other binary file that contains icons. ...
...can be either .ico, .dll, .exe, or any other binary file that contains icons. aiconid index of the icon from aicon to use for this shortcut. ...
execute - Archive of obsolete content
(ignored on mac os). see note below. blocking a boolean value that specifies whether the installation should wait for the execution of the file to finish before it resumes. default is false. ...
...(ignored on mac os). see note below. blocking a boolean value that specifies whether the installation should wait for the execution of the file to finish before it resumes. default is false. ...
...(ignored on mac os). see note below. blocking a boolean value that specifies whether the installation should wait for the execution of the file to finish before it resumes. default is false. ...
...(ignored on mac os). see note below. blocking a boolean value that specifies whether the installation should wait for the execution of the file to finish before it resumes. default is false. ...
Installer Script - Archive of obsolete content
logcomment(" required : " + spacerequired + " k"); 14. logcomment(" available: " + spaceavailable + " k"); 15. return(false); 16. } 17. return(true); 18. } 19. ...
... logcomment(" required : " + spacerequired + " k"); 14. logcomment(" available: " + spaceavailable + " k"); 15. return(false); 16. } 17. return(true); 18. } 19. ...
... logcomment(" required : " + spacerequired + " k"); 14. logcomment(" available: " + spaceavailable + " k"); 15. return(false); 16. } 17. return(true); 18. } 19. ...
... logcomment(" required : " + spacerequired + " k"); 14. logcomment(" available: " + spaceavailable + " k"); 15. return(false); 16. } 17. return(true); 18. } 19. var srdest = 17311; 20. var err = initinstall("netscape seamonkey", "browser", "6.0.0.2000110807"); 21. ...
Getting started with XULRunner - Archive of obsolete content
runner 2.0, the chrome.manifest is now used to register xpcom components in addition to its previous uses. part of this change means the /chrome/chrome.manifest is no longer considered the "root" manifest. xulrunner will not check that folder location for a root-level chrome.manifest. you need to move your existing chrome.manifest to the application root folder, remembering to update the relative
paths within the file. you could also just create a new application root-level manifest that includes the /chrome/chrome.manifest, which is what this tutorial will do. step 4: set up application.ini the application.ini file acts as the xulrunner entry point for your application. it specifies how your application intends to use the xulrunner platform as well as configure some information that xulrunn...
...t.getelementbyid("more-text").hidden = false; } for more information about xul see: xul. for information about mixing html elements into your xul read adding html elements. step 8: run the application the moment of truth. we need to get xulrunner to launch the bare-bones application. windows from a windows command prompt opened to the myapp folder, we should be able to execute this: c:\
path\to\xulrunner.exe application.ini of course, if you opted to install xulrunner then you could simply do %programfiles%\xulrunner.exe application.ini or on 64 bit systems %programfiles(x86)%\xulrunner.exe application.ini note: you can also install your application when you're finished debugging it. see xul application packaging for details. mac on the mac, before you can run a xulru...
... can also install your application when you're finished debugging it. see xul application packaging for details. mac on the mac, before you can run a xulrunner application with everything intact, you must install it using the --install-app xulrunner commandline flag. ...
...rameworks/xul.framework/xulrunner-bin --install-app /<
path>/<to>/myapp.zip once installed, you can run the application: /library/frameworks/xul.framework/xulrunner-bin "/applications/finkle/testapp.app/contents/resources/application.ini" you may run it without installing (but with the menu bar and dock icon missing) in os x by typing: /library/frameworks/xul.framework/xulrunner-bin "/<full
path>/testapp/application.ini" note: the full
path is required or a "error: couldn't parse application.ini."-message will be returned. this might also be simplified using a very simple shell script (i call mine "run.sh"): #!/bin/sh /library/frameworks/xul.framework/xulrunner-bin `pwd`/application.ini linux on ubuntu, you can run the application from a terminal. first change into the \myapp fo...
Building a Theme - Archive of obsolete content
folder in the location mentioned above. the files we will be needing from the browser/omni.ja archive are located under chrome/browser/skin/classic. copy the contents of the following directories to their respective folders. this gives us a base set of styles to work with. browser to chrome/browser/ communicator to chrome/communicator/ you should end up with this directory structure: <ext
path>/ /install.rdf /chrome.manifest /chrome/ browser/ communicator/ global/ mozapps/ after this, it would be a good idea to read the article setting up extension development environment and follow the directions there. it's especially important to install the dom inspector, which we'll be using in late...
...above, browser) which identifies the bundle of user interface components. thirdly, the type of data being requested. there are three types: content (xul, javascript, xbl bindings, etc. that form the structure and behavior of an application ui), locale (dtd, .properties files etc that contain strings for the ui's localization), and skin (css and images that form the theme of the ui) finally, the
path of a file to load. so, chrome://foo/skin/bar.png loads the file bar.png from the foo theme's skin section. when you load content using a chrome uri, firefox uses the chrome registry to translate these uris into the actual source files on disk (or in jar packages). create a chrome manifest the chrome manifest is the file that maps these chrome uris to your theme's files. for more informatio...
...e third column needs to match your theme's internalname value from the install manifest above. this maps skin directories to locations within your theme. for example, the line skin browser sample skin/browser/ means "when the user has the sample theme selected, use the directory browser/ to look up skins for the browser package." more concisely, this means that the url chrome://browser/skin/some/
path/file.css will look for a file browser/some/
path/file.css in your theme's root directory. save the file. test first, we need to tell firefox about your theme. during the development phase for firefox versions 2.0 and higher, you can point firefox to the folder where you are developing the theme, and it'll load it up every time you restart firefox. locate your profile folder and beneath it ...
...evelopment phase for firefox versions 2.0 and higher, you can point firefox to the folder where you are developing the theme, and it'll load it up every time you restart firefox. locate your profile folder and beneath it the profile you want to work with (e.g. firefox/profiles/<profile_id>.default/). open the extensions/ folder, creating it if need be. create a new text file and put the full
path to your development folder inside (e.g. c:\themes\my_theme\ or ~/themes/my_theme/). windows users should retain the os' slash direction, and everyone should remember to include a closing slash and remove any trailing spaces. save the file with the id of your theme as its name (e.g. sample@example.net). no file extension. now you should be ready to test your theme! start firefox. firefox will ...
What is a URL? - Learn web development
urls: https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.mozilla.org/search?q=url any of those urls can be typed into your browser's address bar to tell it to load the associated page (resource). a url is composed of different parts, some mandatory and others optional. let's see the most important parts using the following url: http://www.example.com:80/
path/to/myfile.html?key1=value1&key2=value2#somewhereinthedocument http is the protocol. the first part of the url indicates which protocol the browser must use. a protocol is a set method for exchanging or transferring data around a computer network. usually for websites it is the http protocol or its secured version, https. the web requires one of these two, but browsers also know how to handle...
..., it is possible to directly use an ip address, but because it is less convenient, it is not often used on the web. :80 is the port. it indicates the technical "gate" used to access the resources on the web server. it is usually omitted if the web server uses the standard ports of the http protocol (80 for http and 443 for https) to grant access to its resources. otherwise it is mandatory. /
path/to/myfile.html is the
path to the resource on the web server. in the early days of the web, a
path like this represented a physical file location on the web server. nowadays, it is mostly an abstraction handled by web servers without any physical reality. ?key1=value1&key2=value2 are extra parameters provided to the web server. those parameters are a list of key/value pairs separated with the ...
...tra parts and some extra rules regarding urls, but they are not relevant for regular users or web developers. don't worry about this, you don't need to know them to build and use fully functional urls. you might think of a url like a regular postal mail address: the protocol represents the postal service you want to use, the domain name is the city or town, and the port is like the zip code; the
path represents the building where your mail should be delivered; the parameters represent extra information such as the number of the apartment in the building; and, finally, the anchor represents the actual person to whom you've addressed your mail. how to use urls any url can be typed right inside the browser's address bar to get to the resource behind it. but this is only the tip of the iceberg!
...nusual port), but all the other parts of the url are necessary. when a url is used within a document, such as in an html page, things are a bit different. because the browser already has the document's own url, it can use this information to fill in the missing parts of any url available inside that document. we can differentiate between an absolute url and a relative url by looking only at the
path part of the url. if the
path part of the url starts with the "/" character, the browser will fetch that resource from the top root of the server, without reference to the context given by the current document. let's look at some examples to make this clearer. examples of absolute urls full url (the same as the one we used before) https://developer.mozilla.org/docs/learn implicit protoc...
Index - Learn web development
ut of learning web development, as well as further reading so you can find out more information about each sub-topic should you wish.. 14 common questions codingscripting, infrastructure, learn, web, webmechanics this section of the learning area is designed to provide answers to common questions that may come up, which are not necessarily part of the structured core learning
pathways (e.g. the html or css learning articles.) these articles are designed to work on their own. 15 how can we design for all types of users? accessibility, beginner, design, example, intro, mobile, needsactivelearning when you're building a website, one top issue to consider is universal design: accommodating all users regardless of disability, technical constraints, culture,...
... 34 what text editors are available? beginner, composing, guide, tools, text editor a website consists mostly of text files, so for a fun, pleasant development experience you should choose your text editor wisely. 35 front-end web developer beginner, css, front-end, html, javascript, learn, tools, web standards welcome to our front-end web developer learning
pathway! 36 getting started with the web beginner, css, design, guide, html, index, l10n:priority, publishing, theory it's a lot of work to create a professional website, so if you're new to web development, we encourage you to start small. you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there. 37 css ...
...ow big boxes are in your layout. 134 css first steps beginner, css, landing, learn, module, first steps css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your
path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. 135 getting started with css beginner, css, classes, elements, example, learn, selectors, syntax, state in this article we will take a simple html document and apply css to it, learning some practical things about the language along the way. ...
...w do you convince your clients and/or management to prioritize and invest in performance? in this section, we discuss creating a clear business-case to convince decision-makers to make the investment. 347 web performance resources best practices, website performance web performance is all about user experience and perceived performance. as we learned in the critical rendering
path document, linking css with a tradional link tag with rel="stylesheet" is synchronous and blocks rendering. optimize the rendering of your page by removing blocking css. 348 what is web performance? beginner, introduction, learn, performance, reference, tutorial, web performance web performance is all about making web sites fast, including making slow processes seem fast. does...
Embedding API for Accessibility
setcharpref("browser.selection.border", cssborderstylestring); /* is a selection border hard to implement? ...
... /* is a selection border hard to implement? ...
... setboolpref("browser.selection.use_system_colors", usesystemcolors); no content waiting alerts setcharpref("alert.audio.mail_waiting",
pathtosoundfile); setcharpref("alert.audio.background_image_waiting",
pathtosoundfile); setcharpref("alert.audio.popup_waiting",
pathtosoundfile); setcharpref("alert.audio.applet_waiting",
pathtosoundfile); setcharpref("alert.audio.script_waiting",
pathtosoundfile); setcharpref("alert.audio.redirect_waiting",
pathtosoundfile); setcharpref("alert.audio.refresh_waiting",
pathtosoundfile); setcharpref("alert.audio.plu...
... setcharpref("alert.audio.applet_waiting",
pathtosoundfile); setcharpref("alert.audio.script_waiting",
pathtosoundfile); setcharpref("alert.audio.redirect_waiting",
pathtosoundfile); setcharpref("alert.audio.refresh_waiting",
pathtosoundfile); setcharpref("alert.audio.plugin_content_waiting",
pathtosoundfile); setcharpref("alert.audio.video_waiting",
pathtosoundfile); setcharpref("alert.audio.audio_waiting",
pathtosoundfile); setcharpref("alert.audio.timed_event_waiting",
pathtosoundfile); /* these alerts will also be mirrored visually, either on the status bar or elsewhere */ no ...
Creating reftest-based unit tests
ss has false failures, it makes the harness not trustworthy and the harness will not be used. running reftest-based unit tests note: mach is a python2 script. if your use python3 as default you must edit the first line of mach. to run all the reftests, go to the directory where you save firefox's source code and run: ./mach reftest if you want to run a particular set of reftests, pass the
path as an argument: ./mach reftest
path/from/sourcedir/reftest.list and to run a single reftest just pass the
path to the test file (not the reference file): ./mach reftest
path/from/sourcedir/reftest-name.html there is no reftest equivalent to mach mochitest --keep-open, but temporarily adding the reftest-wait class to a test (or disabling the script that removes it) will keep it open longer. ...
...if you built a debug version of the browser, there can be a lot of extra console output. the reftest.list file can be named whatever you want, not necessa...
...if you built a debug version of the browser, there can be a lot of extra console output. the reftest.list file can be named whatever you want, not necessarily reftest.list (but it has to end with .list). more to do create more reftests. new ...
...st two files, spaces1.html and spaces2.html, are confirming only that a space (the character equal to 0x20 in ascii) creates the same visual construct as the html entity for a non-breaking space. the second pair of files, spaces3.html and spaces4.html, confirms that two regular spaces do not produce the same visual construct as two non-breaking spaces. when we run them, we see: $ ./mach reftest
path/to/reftest.txt 2>&1 | grep reftest reftest pass: file:///users/ray/mo/spaces1.html reftest pass: (!=) file:///users/ray/mo/spaces3.html $ fabulous! other comparisons note that it should also be possible to create a reftest that tests markup against an actual graphic image of the visual construct that should result. this is probably going to be a more fragile test, for the reasons described ab...
Simple Instantbird build
get the source, you can opt to add the progressextension to your mercurial.ini (for windows) or .hgrc (for *nix / mac) file. this will provide status feedback during the lengthy clone / download process. see: configure mercurial .hgrc file for progress extension. get the source note: on windows, you won't be able to build the instantbird source code if it's under a directory with spaces in the
path (e.g., don't use "documents and settings"). you can pick any other location, such as a new directory c:\instantbird-src. note: parts of the build process also have problems when the source code is in a directory where the
path is long (nested many levels deep). on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os ...
...having the source deep in a filesystem hierarchy can also cause problems with pymake builds on windows. ...
...file called '.mozconfig' at the root of your mozilla source tree, i.e. your comm-central repo. for example, to create a debug build instead of a release build, that file would contain: ac_add_options --enable-debug for more on configuration options, see the page configuring build options. note that if you use an moz_objdir it cannot be a sibling folder to your source directory. use an absolute
path to be sure! building instantbird what you need to do to build instantbird rather than firefox is: echo 'ac_add_options --enable-application=im' >> .mozconfig to start the build, cd into the comm-central subdirectory (created automatically by the hg clone command), and run: ./mozilla/mach build mach is our command-line tool to streamline common developer tasks. see the mach article for mor...
... that your next build is completely fresh. to do this you can use mach clobber checked the instantbird buildbot for known failures at the time you pulled the code? if the trunk is broken, you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction). checked to make sure that the
path in which you placed the source code has no spaces, and is not too long? have you searched the bug database for issues relating to your problem (e.g., platform-specific issues)? try asking in mozilla.dev.chat - don't forget to include details of what is in your mozconfig, and what the actual error is. references general build documentation comm-central simple thunderbird build ...
OS.File.Info
. instances of os.file.info may be obtained by: calling global method os.file.stat() either from the main thread or from a worker thread; calling instance method stat() of os.file either from the main thread or from a worker thread. ...
...her from the main thread or from a worker thread; calling instance method stat() of os.file either from the main thread or from a worker thread. ...
...a worker thread. ...
...egular file the following snippet uses the main thread api to determine (asynchronously) whether some
path is a regular file, or a directory, or a symbolic link: let promise = os.file.stat(some
path); promise.then( function onsuccess(info) { // |info| is an instance of |os.file.info| if (info.isdir) { // |some
path| represents a directory } else if (info.issymlink) { // |some
path| represents a symbolic link } else { // |some
path| represents a regular file } }, function onfailure(reason) { if (reason instanceof os.file.error && reason.becausenosuchfile) { // |some
path| does not represent anything } else { // some other error } } ) example: determining the owner of a file let promise = os.file.stat() promise.then( function on...
Webapps.jsm
pen web apps. ...
...ner: function(amsgnames, aapp, amm) removemessagelistener: function(amsgnames, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azip
path) _getappdir: function(aid) _writefile: function(a
path, adata) dogetlist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifesturl, aerro...
...ata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, anewapp) _getrequestchannel: function(afullpackage
path, aislocalfileinstall, aoldapp,) _senddownloadprogressevent: function(anewapp, aprogress) _getpackage: function(arequestchannel, aid, aoldapp, anewapp) _computefilehash: function(afile
path) _sendappliedevent: function(aapp) _openandreadpackage: function(azipfile, aoldapp, anewapp, aislocalfileinstall,) _openpackage: function(azipfile, aapp, aislocalfileinstall) _opensignedpackage: function(...
...t) getappbymanifesturl: function(amanifesturl) getfullappbymanifesturl: function(amanifesturl, aentrypoint, alang) getmanifestcspbylocalid: function(alocalid) getdefaultcspbylocalid: function(alocalid) getapplocalidbystoreid: function(astoreid) getappbylocalid: function(alocalid) getmanifesturlbylocalid: function(alocalid) getapplocalidbymanifesturl: function(amanifesturl) getcoreappsbase
path: function() getwebappsbase
path: function() _islaunchable: function(aapp) _notifycategoryandobservers: function(subject, topic, data, msg) registerbrowserelementparentforapp: function(amsg, amn) receiveappmessage: function(appid, message) _clearprivatedata: function(appid, browseronly, msg) _sendprogressevent: function() updatestatechanged: function appobs_update(aupdate, astate) applica...
Bootstrapping a new locale
asy_install compare-locales this will download and install the utility. clone the source code the next step is to download a copy of the source code to your local system, using mercurial. you will need to "hg clone" the existing release branch for mozilla so you have all the files locally for you to begin localization. make sure to have the directory where you intend to work as the current
path on your terminal. (you should "cd" to the directory before beginning.) in the terminal, type the following command: $ hg clone http://hg.mozilla.org/releases/mozilla-x.x.x/ where "x.x.x" is the existing release branch version. for instance, for firefox 3.6, we use mozilla-1.9.2. refer to l10n:branches for the list of all branches. if you are interested in localizing thunderbird 3, seamonke...
...we'll first navigate to the directory called "browser" by running the following commands one after the other from your command line: $ cd [ab-cd]/browser/chrome/browser to see what is contained in "browser" type $ ls and, you should see the following output from your terminal: aboutcerterror.dtd pageinfo.dtd aboutdialog.dtd pageinfo.propert...
...d/other-licenses/branding/firefox/ ab-cd/security/manager/ ab-cd/toolkit/ translating to start editing, you will need a text editing application. you can choose to use: notepad++ or notepad2 on windows, vim, gedit or kate on gnu/linux, textwrangler on mac os x. (read more about tools at l10n:tools.) after you have downloaded your editor of choice, type the following command in the same
path from above (~/ab-cd/browser/chrome/browser) $ edit ab-cd/browser/chrome/browser/aboutcerterror.dtd read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers. localization notes will look like this: <!-- localization notes... --> after the localization notes, you will see a list of <!entity> strings like the following: <!
... the following url into your browser: $ https://bitbucket.org/mozillal10n/ab-cd/overview/ (where ab-cd will be replaced by your locale code) at that main page of your newly created bit bucket repo, you'll see the hg commands, $ hg clone http://bitbucket.org/mozillal10n/ab-cd/ ... $ hg pull -u # to pull changes and update $ hg push # to push changes to this repo import existing data? $ cd /
path/to/existing/hg/repo/ $ hg push http://bitbucket.org/mozillal10n/ab-cd/ prefer ssh? $ hg clone ssh://hg@bitbucket.org/mozillal10n/ab-cd/ $ hg push ssh://hg@bitbucket.org/mozillal10n/ab-cd/ as you begin to move through your translations, you should "commit" the changes locally and "push" your work to this experimental respository. for instance, if you have finished translating all the .dtd and ...
Localizing extension descriptions
_id matches your extension id (<em:id> from install.rdf) and localized_description is the description of your extension that you want to appear in the given language): extensions.extension_id.description=localized_description if you do not currently have one, create a default preferences file. ...
...rom install.rdf) and localized_description is the description of your extension that you want to appear in the given language): extensions.extension_id.description=localized_description if you do not currently have one, create a default preferences file. ...
...ear in the given language): extensions.extension_id.description=localized_description if you do not currently have one, create a default preferences file. ...
...omepageurl localizable lists in cases where multiple values can exist, a numeric index is appended to the end of the preference name: extensions.extension_id.contributor.1=first_localized_contributor_name extensions.extension_id.contributor.2=second_localized_contributor_name extensions.extension_id.contributor.3=thrid_localized_contributor_name pref("extensions.extension_id.contributor.1", "
path_to_localization_file"); pref("extensions.extension_id.contributor.2", "
path_to_localization_file"); pref("extensions.extension_id.contributor.3", "
path_to_localization_file"); the following add-on metadata can be localized using this process: developer translator contributor ...
Build instructions
ead of symbolic links. these variables should be either undefined, or set to "1". results are undefined for variables set to "0". for windows, install the mozillabuild environment and microsoft visual studio 2010. ...
... build instructions for recent versions (mercurial) clone the nspr and nss repositories. ...
... build instructions for recent versions (mercurial) clone the nspr and nss repositories. ...
...th already configured, and execute these instructions from within that bash shell. for rhel-5, you need to use the new assembler. you can install the new assembler as root as follows: yum install binutils220 you can then use the new assembler by adding /usr/libexec/binutils220 to the beginning of your build
path. this can be done in sh or bash as follows: export
path=/usr/libexec/binutils220:$
path the following build instructions should work for all platforms (with some platform-specific changes as noted). build instructions for recent versions (mercurial) clone the nspr and nss repositories. hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss if you want to build a releases other than the tips of these repositories, then switch to the rele...
sslfnc.html
gmpserversidcache ssl_inheritmpserversidcache nss_init sets up configuration files and performs other tasks required to run network security services. database files are opened read-only. syntax #include "nss.h" secstatus nss_init(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the
pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description nss_init opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) in the specified directory. nss_ini...
... sets up configuration files and performs other tasks required to run network security services. unlike nss_init, nss_initreadwrite provides both read and write access to database files. syntax #include "nss.h" secstatus nss_initreadwrite(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the
pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description nss_initreadwrite opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) with both read and write p...
... values outside this range are replaced by the server default value of 100 seconds. ssl3_timeout the lifetime in seconds of an ssl3 session. the minimum timeout value is 5 seconds and the maximum is 24 hours. values outside this range are replaced by the server default value of 24 hours. directory a pointer to a string specifying the
pathname of the directory that will contain the session cache. if a null value is passed, the server default value is used: /tmp (unix) or \\temp (nt). returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to obtain error code. description if you are writing an application that will use ssl sockets that ...
... values outside this range are replaced by the server default value of 100 seconds. ssl3_timeout the lifetime in seconds of an ssl3 session. the minimum timeout value is 5 seconds and the maximum is 24 hours. values outside this range are replaced by the server default value of 24 hours. directory a pointer to a string specifying the
pathname of the directory that will contain the session cache. if a null value is passed, the server default value is used: /tmp (unix) or \\temp (nt). returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to obtain error code. description this function is identical to ssl_configserversessionidcache, exc...
Installing Pork
don't have to modify your standard system gcc. you can install gcc in the normal way in a special directory. build and install mcpp mcpp generates macro expansion comments that allow pork's elsa to undo macros, which is necessary in order to get exact position information. to tell mcpp which gcc installation to integrate itself with, place the selected gcc bin dir as the first element of your
path:
path=/bindir/of/my/gcc:$
path if you want to use a gcc that has binaries named something other than "gcc" and "g++", or you use "ccache" for you main gcc installation and want mcpp to override a separate installation, you need to pass the options "cc=gccxxx cxx=g++xxx" to "./configure". but don't give absolute
paths there: mcpp won't build right. instead, make sure the commands will be found on...
... svn co https://mcpp.svn.sourceforge.net/svnroot/mcpp/trunk mcpp cd mcpp ./configure --enable-replace-cpp make sudo make install note: if you followed the dehydra installation instructions for linux and compiled your own gcc, then you should not need to "sudo" make install. ...
...ceforge.net/svnroot/mcpp/trunk mcpp cd mcpp ./configure --enable-replace-cpp make sudo make install note: if you followed the dehydra installation instructions for linux and compiled your own gcc, then you should not need to "sudo" make install. if you run simply "make install" and see file permission errors, mcpp is likely trying to override your main gcc installation. make sure that (1) your "$
path" is correct; (2) you passed the correct "cc=..." and "cxx=..." to "./configure". install the pork stack pork is a set of tools written at mozilla for refactoring c++. pork's aim is to simply doing c/c++ refactoring through elsa. hg clone http://hg.mozilla.org/rewriting-and-analysis/pork/ cd pork hg clone http://hg.mozilla.org/rewriting-and-analysis/elsa ./configure make building mozilla wi...
.../null | sort | grep -e ' *#define *[a-za-z]+' \ + ${cxx} ${cppflags} -e -xc++ -dm /dev/null | sort | grep -e ' *#define *[a-za-z]+' \ > gxx${gcc_maj_ver}${gcc_min_ver}_predef_old.h fi if test ${host_system} = sys_cygwin; then if you don't do this, mcpp will get the wrong set of automatic definitions and you'll end up with an unpleasant hybrid x86-64/i686 build system. $ export
path=/builds/gcc-3.4.6-installed/bin:$
path $ export cppflags=-m32 $ cc=gcc34 cxx=g++34 cppflags=-m32 ldflags=-m32 ../src/configure --enable-replace-cpp --prefix=/builds/gcc-3.4.6-installed --target=i686-pc-linux $ make $ make install program_transform_name= ...
Running Parsemark
ee because they're non-mozilla js code. download the suite of parse tests from bug 548621 and decompress them. within js/src/tests, run python parsemark.py -h to see help documentation. ...
...n-mozilla js code. download the suite of parse tests from bug 548621 and decompress them. within js/src/tests, run python parsemark.py -h to see help documentation. generally you'll want to capture json results for your baseline and compare them to the results for the "current" version of your shell. ...
...and decompress them. within js/src/tests, run python parsemark.py -h to see help documentation. generally you'll want to capture json results for your baseline and compare them to the results for the "current" version of your shell. ...
... within js/src/tests, run python parsemark.py -h to see help documentation. generally you'll want to capture json results for your baseline and compare them to the results for the "current" version of your shell. ...
TPS Tests
so minutes after starting a full run of tps, as it will open and close a fairly large number of firefox windows. ...
...ows. ...
... cd into the tps folder cd testing/tps create the environment i suggest the
path to be outside of the mc source tree python create_venv.py --username=%email% --password=%password% %
path% note: if you are updating the tps environment and want to keep your existing config (eg, the existing username and password), you should instead execute: python create_venv.py --keep-config %
path% activate the environment source %
path%/bin/activate run some tests note that the testfile is not a
path, it should only be the filename from services/sync/tests/tps/ runtps --debug --testfile %test_file_name% --binary %firefox_binary_
path% additionally, omitting a --testfile parameter will cause it to run all tps tests listed in services/sync/tests/tps/all_tests.json ...
...in particular, it will set preferences from the "preferences" property, and so you can set the "identity.fxaccounts.autoconfig.uri" preference to point to any fxa server you want. for example, a (partial) tps config for testing against stage might look like: { // ... "fx_account": { "username": "foobar@restmail.net", "password": "hunter2" }, "preferences": { ...
A Web PKI x509 certificate primer
tail in rfc 5280. in general, x509 certificates bind a signature to a validity period, a public key, a subject, an issuer, and a set of extensions. the extensions define extra properties of the certificate such as extra attributes of the certificate or constraints on the use of the certificate. ...
...subject, an issuer, and a set of extensions. the extensions define extra properties of the certificate such as extra attributes of the certificate or constraints on the use of the certificate. in order for a certificate to be valid these three requirements must be met: there is a verification
path from the site certificate to a trusted certificate of the user agent (ie if you follow the issuer
path you will end on a self-signed certificate that is considered trusted by the browser). the attributes of the certificates in the verification
path have valid parameters for that verification (for example the validity period of all the certificates are valid for the time the verification is being done) revocation checks are considered ok for that particular validation. one issue that is not com...
...mes (such as dns names) are valid for this certificate. this allows for a certificate to be used for more than one fqdn, for example you can have a certificate that is valid for both a.example.com and b.example.com basic constraints this allows certificates to be asserted as issuing certificates (it is mandatory for ca certificates). it can also be used to express the maximum depth of the trust
path from the ca. key usage this extension is used to constrain the purpose for the key in the certificate. more than one key usage can be asserted. examples of key usages are: digitalsignature, keyencipherment, dataencipherment, keycertsign, and crlsign. for ca certificates the keycertsign bit must be set. extended key usages this is another bitfield to constrain the usages of the key of the cert...
... sec_error_invalid_algorithm a certificate has been signed with an unknown algorithm re-sign the certificate with a standardized certificate signing algorithm sec_error_invalid_time a time field in a certificate has an invalid value re-generate the certificate with valid encodings for time fields mozilla_pkix_error_key_pinning_failure sec_error_
path_len_constraint_invalid sec_error_unknown_critical_extension a certificate contains an extension marked as critical that is not handled by mozilla::pkix re-generate the certificate without the extension or with it not marked as critical sec_error_unknown_issuer either a missing intermediate or root certificate is necessary to verify the certificate import the ...
nsICookieManager
nsicookiemanager.idlscriptable please add a summary to this article. last changed in gecko 1.7 inherits from: nsisupports this interface is intended to be used as a service. it is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed via services.cookies method overview void remove(in autf8string ahost, in acstring aname, in autf8string a
path, in boolean ablocked, in jsval aoriginattributes); void removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list. the objects enumerated over are of type nsicookie. read only. methods remove() this method is called to remove an individual cookie from the co...
...nattributes); void removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list. the objects enumerated over are of type nsicookie. read only. methods remove() this method is called to remove an individual cookie from the cookie list, specified by host, name, and
path. if the cookie cannot be found, no exception is thrown. typically, the arguments to this method will be obtained directly from the desired nsicookie object. void remove( in autf8string ahost, in acstring aname, in autf8string a
path, in boolean ablocked, in jsval aoriginattributes ); parameters ahost the host or domain for which the cookie was set. see nsicookiemanager2.add() for ...
... ablocked indicates if cookies from this host should be permanently blocked. aoriginattributes the originattributes of this cookie. removeall() this method is called to remove all cookies from the cookie list. void removeall(); parameters none. ...
... ablocked indicates if cookies from this host should be permanently blocked. aoriginattributes the originattributes of this cookie. removeall() this method is called to remove all cookies from the cookie list. void removeall(); parameters none. ...
nsIInstallLocation
ck>. you can get the install location of a particular add-on using nsiextensionmanager interface: var il = components.classes["@mozilla.org/extensions/manager;1"] .getservice(components.interfaces.nsiextensionmanager) .getinstalllocation("add-on id") method overview astring getidforlocation(in nsifile file); nsifile getitemfile(in astring id, in astring
path); nsifile getitemlocation(in astring id); nsifile getstagefile(in astring id); boolean itemismanagedindependently(in astring id); void removefile(in nsifile file); nsifile stagefile(in nsifile file, in astring id); attributes attribute type description canaccess boolean whether or not the user can write to the install location with the current access privileges. this is diffe...
...ocations are being defined for your own application. constant value description priority_app_profile 0 priority_app_system_user 10 priority_xre_system_user 100 priority_app_system_global 1000 priority_xre_system_global 10000 methods getidforlocation() retrieves the guid for an item at the specified location. ...
... return value a file object at the requested location. the file does not necessarily have to exist. getitemlocation() gets the directory that contains an item. nsifile getitemlocation( in astring id ); parameters id the guid of the item. ...
... maintained by this install location. astring getidforlocation( in nsifile file ); parameters file the location where an item might live. return value the id for an item that might live at the location specified. getitemfile() gets a nsifile object for a file within an item's directory structure. nsifile getitemfile( in astring id, in astring
path ); parameters id the guid of the item.
path the
path to the file beneath an extension's directory. return value a file object at the requested location. the file does not necessarily have to exist. getitemlocation() gets the directory that contains an item. nsifile getitemlocation( in astring id ); parameters id the guid of the item. return value the location of the item. getstagefile() returns the most recently staged package (for e...
nsIMemoryMultiReporterCallback
xpcom/base/nsimemoryreporter.idlscriptable implement this interface to handle callbacks from nsimemorymultireporter instances. ...
... kind the value of the kind attribute. ...
... kind the value of the kind attribute. units the value of the units attribute. amount the value of the amount attribute. ...
... kind the value of the kind attribute. units the value of the units attribute. amount the value of the amount attribute. description the value of the description attribute. ...
nsIWebBrowserPersist
webbrowserpersist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adata
path, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsi...
...le. afile target local file. this may be a nsilocalfile object or an nsiuri object with a file scheme. savedocument() save the specified dom document to file and optionally all linked files (for example images, css, js & subframes). do not call this method until the document has finished loading! void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adata
path, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument document to save to file. some implementations of this interface may also support nsnull to imply the currently loaded document. afile target local file. this may be a nsilocalfile object or an nsiuri object with a file scheme or a scheme that supports uploading (for ...
...tcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument document to save to file. some implementations of this interface may also support nsnull to imply the currently loaded document. afile target local file. this may be a nsilocalfile object or an nsiuri object with a file scheme or a scheme that supports uploading (for example ftp). adata
path path to directory where uris linked to the document are saved or nsnull if no linked uris should be saved. this may be a nsilocalfile object or an nsiuri object with a file scheme. aoutputcontenttype the desired mime type format to save the document and all sub-documents into or nsnull to use the default behavior. aencodingflags flags to pass to the encoder. awrapcolumn for text documents,...
... function downloadfile(httploc, sourcewindow) { try { //new obj_uri object var obj_uri = components.classes["@mozilla.org/network/io-service;1"].getservice(components.interfaces.nsiioservice).newuri(httploc, null, null); //new file object var obj_targetfile = components.classes["@mozilla.org/file/local;1"].createinstance(components.interfaces.nsilocalfile); //set file with
path obj_targetfile.initwith
path("c:\\temp\\test.pdf"); //if file doesn't exist, create if(!obj_targetfile.exists()) { obj_targetfile.create(0x00,0644); } //new persistence object var obj_persist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"].createinstance(components.interfaces.nsiwebbrowserpersist); // with persist flags if desired ...
Thunderbird Configuration Files
files are plain text files you need to create in your profile folder and can be edited using a standard text editor, such as notepad on windows and gedit or kate on linux. locate your profile folder before the configuration files are presented, you should know how to find your profile folder, which is where thunderbird saves all your settings on your hard drive. ...
...to use it, click start > run... ...
..., where xxxxxxxx is a random string of 8 characters. just browse to c:\documents and settings\[user name]\application data\thunderbird\profiles\ on windows xp/2000 or c:\users\[user name]\appdata\roaming\thunderbird\profiles\ on windows vista, and the rest should be obvious. on windows 95/98/me, the
path is usually c:\windows\application data\thunderbird\profiles\xxxxxxxx.default\ on linux, the
path is usually ~/.thunderbird/xxxxxxxx.default/ on mac os x, the
path is usually ~/library/thunderbird/profiles/xxxxxxxx.default/ %appdata% is a shorthand for the application data
path on windows 2000/xp/vista. to use it, click start > run... (use the search box on vista), enter %appdata% and press enter. you will be taken to the "real" folder, which is normally c:\documents and settings\[user nam...
... windows 2000/xp/vista. to use it, click start > run... (use the search box on vista), enter %appdata% and press enter. you will be taken to the "real" folder, which is normally c:\documents and settings\[user name]\application data on windows xp/2000, c:\users\[user name]\appdata\roaming on windows vista. thunderbird is capable of handling more than one user and thus, more than one profile. the
path examples above refers to the default profile that is automatically created when you start thunderbird for the first time. you can manage any number of profiles by using the profile manager. userchrome.css this file sets the display rules for various elements in the thunderbird user interface and is located in the sub-folder called chrome in your profile folder. this folder does not exist by def...
Using the Mozilla symbol server
releases from 2.0.0.4. this allows debugging of those builds without forcing all users to download large debugging files. the server functions like microsoft's symbol server so the documentation there can be useful. note that because mozilla release builds are heavily optimized, debugging is not always easy. the debugger will not be able to show you the content of all variables and the execution
path can seem strange because of inlining, tail calls, and other compiler optimizations. the only workaround is to build an unoptimized local build. the official symbol server url for firefox is https://symbols.mozilla.org/. you cannot visit this url directly: you must add it to the symbol
path of your debugging tool. in the examples below, a local cache directory is used to avoid repeatedly fetching...
.... you cannot visit this url directly: you must add it to the symbol
path of your debugging tool. in the examples below, a local cache directory is used to avoid repeatedly fetching the pdb from the server. replace c:\users\bsmedberg\symbols with an appropriate cache directory on your machine. using the symbol server in microsoft visual c++ using the symbol server in windbg the windbg symbol
path is configured with a string value delimited with asterisk characters. ...
...o avoid repeatedly fetching the pdb from the server. replace c:\users\bsmedberg\symbols with an appropriate cache directory on your machine. using the symbol server in microsoft visual c++ using the symbol server in windbg the windbg symbol
path is configured with a string value delimited with asterisk characters. to use only the mozilla symbol server, add the following entry to your symbol
path (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols): srv*c:\symcache\*https://symbols.mozilla.org/ set this string as _nt_symbol_
path in the environment, using the windbg menus, or by typing the .sym
path command. if you would like to get symbols from microsoft's symbol server as well, you should list tha...
...ther 'darwin' (for mac) or 'linux'. the rest of values are based on the contents of the application.ini file under the [app] heading: for example, the thunderbird 3.1b2 release with name=thunderbird, version=3.1b2, buildid=20100430125415 would have a filename of "thunderbird-3.1b2-linux-20100430125415-symbols.txt" under the thunderbird directory at symbols.mozilla.org. its contents are a list of
paths to files, all relative to the directory the blah-symbols.txt file is found in. the source server in addition to symbols, mozilla also has a source server, letting you do source-level debugging and inspection on demand. troubleshooting: symbols will not download if symbols will not download no matter what you do, the problem may be that internet explorer has been set to the work offline mode.
Using the CSS Painting API - Web APIs
perties() { return ['--highcolour']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props) { /* set where to start the highlight & dimensions */ const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const highlightheight = size.height * 0.85; const color = props.get('--highcolour'); ctx.fillstyle = color; ctx.begin
path(); ctx.moveto( x, y ); ctx.lineto( blockwidth, y ); ctx.lineto( blockwidth + highlightheight, highlightheight ); ctx.lineto( x, highlightheight ); ctx.lineto( x, y ); ctx.close
path(); ctx.fill(); /* create the dashes */ for (let i = 0; i < 4; i++) { let start = i * 2; ctx.begin
path(); ctx.moveto( (blockwidth) + (start * 10) + 10, y ); ctx.lineto( (blockwidth) + (sta...
... i++) { let start = i * 2; ctx.begin
path(); ctx.moveto( (blockwidth) + (start * 10) + 10, y ); ctx.lineto( (blockwidth) + (start * 10) + 20, y ); ctx.lineto( (blockwidth) + (start * 10) + 20 + (highlightheight), highlightheight ); ctx.lineto( (blockwidth) + (start * 10) + 10 + (highlightheight), highlightheight ); ctx.lineto( (blockwidth) + (start * 10) + 10, y ); ctx.close
path(); ctx.fill(); } } // paint }); we can then create a little html that will accept this image as backgrounds: <h1 class="fancy">largest header</h1> <h3 class="fancy">medium size header</h3> <h6 class="fancy">smallest header</h6> we give each header a different value for the --highcolour custom property .fancy { background-image: paint(headerhighlight); } h1 { --highcolour: hsla(155, ...
...strokewidth ) { ctx.linewidth = strokewidth; } else { ctx.linewidth = 1.0; } // set the fill type if ( stroketype === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.strokestyle = colour; } else if ( stroketype === 'filled' ) { ctx.fillstyle = colour; ctx.strokestyle = colour; } else { ctx.fillstyle = 'none'; ctx.strokestyle = 'none'; } // block ctx.begin
path(); ctx.moveto( x, y ); ctx.lineto( blockwidth, y ); ctx.lineto( blockwidth + blockheight, blockheight ); ctx.lineto( x, blockheight ); ctx.lineto( x, y ); ctx.close
path(); ctx.fill(); ctx.stroke(); // dashes for (let i = 0; i < 4; i++) { let start = i * 2; ctx.begin
path(); ctx.moveto( blockwidth + (start * 10) + 10, y); ctx.lineto( blockwidth + (start * 10) + 20, y...
... // dashes for (let i = 0; i < 4; i++) { let start = i * 2; ctx.begin
path(); ctx.moveto( blockwidth + (start * 10) + 10, y); ctx.lineto( blockwidth + (start * 10) + 20, y); ctx.lineto( blockwidth + (start * 10) + 20 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10, y); ctx.close
path(); ctx.fill(); ctx.stroke(); } } // paint }); we can set different colors, stroke widths, and pick whether the background image should be filled or hollow: li { --boxcolor: hsla(155, 90%, 60%, 0.5); background-image: paint(hollowhighlights, stroke, 5px); } li:nth-of-type(3n) { --boxcolor: hsla(255, 90%, 60%, 0.5); background-image: paint(hollowhighlights, filled, 3px)...
CanvasRenderingContext2D.arc() - Web APIs
parameters x the horizontal coordinate of the arc's center. y the vertical coordinate of the arc's center. radius the arc's radius. must be positive. startangle the angle at which the arc starts in radians, measured from the positive x-axis. ...
... parameters x the horizontal coordinate of the arc's center. y the vertical coordinate of the arc's center. radius the arc's radius. must be positive. startangle the angle at which the arc starts in radians, measured from the positive x-axis. ...
...rcle this example draws a complete circle with the arc() method. html <canvas></canvas> javascript the arc is given an x-coordinate of 100, a y-coordinate of 75, and a radius of 50. to make a full circle, the arc begins at an angle of 0 radians (0°), and ends at an angle of 2π radians (360°). const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); ctx.begin
path(); ctx.arc(100, 75, 50, 0, 2 * math.pi); ctx.stroke(); result different shapes demonstrated this example draws various shapes to show what is possible with arc(). html <canvas width="150" height="200"></canvas> javascript const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); // draw shapes for (let i = 0; i <= 3; i++) { for (let j = 0; j <= 2; j++) ...
..., 75, 50, 0, 2 * math.pi); ctx.stroke(); result different shapes demonstrated this example draws various shapes to show what is possible with arc(). ...
CanvasRenderingContext2D.bezierCurveTo() - Web APIs
syntax void ctx.beziercurveto(cp1x, cp1y, cp2x, cp2y, x, y); parameters cp1x the x-axis coordinate of the first control point. cp1y the y-axis coordinate of the first control point. cp2x the x-axis coordinate of the second control point. cp2y the y-axis coordinate of the second control point. ...
...a cubic bézier curve is drawn. ...
... = canvas.getcontext('2d'); // define the points as {x, y} let start = { x: 50, y: 20 }; let cp1 = { x: 230, y: 30 }; let cp2 = { x: 150, y: 80 }; let end = { x: 250, y: 100 }; // cubic bézier curve ctx.begin
path(); ctx.moveto(start.x, start.y); ctx.beziercurveto(cp1.x, cp1.y, cp2.x, cp2.y, end.x, end.y); ctx.stroke(); // start and end points ctx.fillstyle = 'blue'; ctx.begin
path(); ctx.arc(start.x, start.y, 5, 0, 2 * math.pi); // start point ctx.arc(end.x, end.y, 5, 0, 2 * math.pi); // end point ctx.fill(); // control points ctx.fillstyle = 'red'; ctx.begin
path(); ctx.arc(cp1.x, cp1.y, 5, 0, 2 * math.pi); // control point one ctx.arc(cp2.x, cp2.y, 5, 0, 2 * math.pi); // control point two ctx.fill(); result in this example, the control points are red and the st...
...bézier curve this example draws a simple bézier curve using beziercurveto(). html <canvas id="canvas"></canvas> javascript the curve begins at the point specified by moveto(): (30, 30). the first control point is placed at (120, 160), and the second at (180, 10). the curve ends at (220, 140). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.begin
path(); ctx.moveto(30, 30); ctx.beziercurveto(120,160, 180,10, 220,140); ctx.stroke(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.beziercurveto' in that specification. living standard ...
CanvasRenderingContext2D.clearRect() - Web APIs
syntax void ctx.clearrect(x, y, width, height); the clearrect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)). ...
... syntax void ctx.clearrect(x, y, width, height); the clearrect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)). ...
...n top of a yellowish background. the clearrect() method then erases part of the canvas. html <canvas id="canvas"></canvas> javascript the cleared area is rectangular in shape, with its top-left corner at (10, 10). the cleared area has a width of 120 and a height of 100. ...
..."></canvas> javascript the cleared area is rectangular in shape, with its top-left corner at (10, 10). the cleared area has a width of 120 and a height of 100. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // draw yellow background ctx.begin
path(); ctx.fillstyle = '#ff6'; ctx.fillrect(0, 0, canvas.width, canvas.height); // draw blue triangle ctx.begin
path(); ctx.fillstyle = 'blue'; ctx.moveto(20, 20); ctx.lineto(180, 20); ctx.lineto(130, 130); ctx.close
path(); ctx.fill(); // clear part of the canvas ctx.clearrect(10, 10, 120, 100); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.clearrect' in that specification. living standard ...
CanvasRenderingContext2D.clip() - Web APIs
the canvasrenderingcontext2d.clip() method of the canvas 2d api turns the current or given
path into the current clipping region. it replaces any previous clipping region. in the image below, the red outline represents a clipping region shaped like a star. only those parts of the checkerboard pattern that are within the clipping region get drawn. note: be aware that the clipping region is only constructed from shapes added to the
path. it doesn't work with shape primitives drawn directly to the canvas, such as fillrect(). instead, you'd have to use rect() to add a rectangular shape to the
path before calling clip(). ...
...e checkerboard pattern that are within the clipping region get drawn. note: be aware that the clipping region is only constructed from shapes added to the
path. it doesn't work with shape primitives drawn directly to the canvas, such as fillrect(). instead, you'd have to use rect() to add a rectangular shape to the
path before calling clip(). syntax void ctx.clip([fillrule]); void ctx.clip(
path [, fillrule]); parameters fillrule the algorithm by which to determine if a point is inside or outside the clipping region. possible values: "nonzero": the non-zero winding rule. default rule. "evenodd": the even-odd winding rule.
path a
path2d
path to use as the clipping region. examples a simple clipping region this example uses the clip() method to create a clipping regio...
...ording to the shape of a circular arc. two rectangles are then drawn; only those parts within the clipping region are rendered. html <canvas id="canvas"></canvas> javascript the clipping region is a full circle, with its center at (100, 75), and a radius of 50. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create circular clipping region ctx.begin
path(); ctx.arc(100, 75, 50, 0, math.pi * 2); ctx.clip(); // draw stuff that gets clipped ctx.fillstyle = 'blue'; ctx.fillrect(0, 0, canvas.width, canvas.height); ctx.fillstyle = 'orange'; ctx.fillrect(0, 0, 100, 100); result specifying a
path and a fillrule this example saves two rectangles to a
path2d object, which is then made the current clipping region using the clip() method. the "evenodd...
...o rectangles to a
path2d object, which is then made the current clipping region using the clip() method. the "evenodd" rule creates a hole where the clipping rectangles intersect; by default (with the "nonzero" rule), there would be no hole. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create clipping
path let region = new
path2d(); region.rect(80, 10, 20, 130); region.rect(40, 50, 100, 50); ctx.clip(region, "evenodd"); // draw stuff that gets clipped ctx.fillstyle = 'blue'; ctx.fillrect(0, 0, canvas.width, canvas.height); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.clip' in that specification. ...
CanvasRenderingContext2D.lineJoin - Web APIs
l triangular area between the common endpoint of connected segments, and the separate outside rectangular corners of each segment. "miter" connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additional lozenge-shaped area. this setting is affected by the miterlimit property. default value. ...
...nnected segments, and the separate outside rectangular corners of each segment. "miter" connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additional lozenge-shaped area. this setting is affected by the miterlimit property. default value. examples changing the joins in a
path this example applies rounded line joins to a
path. ...
... of filling an additional lozenge-shaped area. this setting is affected by the miterlimit property. default value. examples changing the joins in a
path this example applies rounded line joins to a
path. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.linewidth = 20; ctx.linejoin = 'round'; ctx.begin
path(); ctx.moveto(20, 20); ctx.lineto(190, 100); ctx.lineto(280, 20); ctx.lineto(280, 150); ctx.stroke(); result comparison of line joins the example below draws three different
paths, demonstrating each of the three linejoin options. <canvas id="canvas" width="150" height="150"></canvas> var ctx = document.getelementbyid('canvas').getcontext('2d'); var linejoin = ['round', 'bevel', 'miter'...
...lt comparison of line joins the example below draws three different
paths, demonstrating each of the three linejoin options. <canvas id="canvas" width="150" height="150"></canvas> var ctx = document.getelementbyid('canvas').getcontext('2d'); var linejoin = ['round', 'bevel', 'miter']; ctx.linewidth = 10; for (let i = 0; i < linejoin.length; i++) { ctx.linejoin = linejoin[i]; ctx.begin
path(); ctx.moveto(-5, 5 + i * 40); ctx.lineto(35, 45 + i * 40); ctx.lineto(75, 5 + i * 40); ctx.lineto(115, 45 + i * 40); ctx.lineto(155, 5 + i * 40); ctx.stroke(); } screenshotlive sample specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.linejoin' in that specification. living standard ...
CanvasRenderingContext2D.rect() - Web APIs
parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. ...
... parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. ...
... parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. ...
...ied by width and height. parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. positive values are down, and negative are up. examples drawing a rectangle this example creates a rectangular
path using the rect() method. the
path is then rendered using the fill() method. html <canvas id="canvas"></canvas> javascript the rectangle's corner is located at (10, 20). it has a width of 150 and a height of 100. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.rect(10, 20, 150, 100); ctx.fill(); result specifications specification ...
Document.cookie - Web APIs
e by this. write a new cookie document.cookie = newcookie; in the code above, newcookie is a string of form key=value. note that you can only set/update a single cookie at a time using this method. consider also that: any of the following cookie attribute values can optionally follow the key-value pair, specifying the cookie to set/update, and preceded by a semi-colon separator: ;
path=
path (e.g., '/', '/mydir') if not specified, defaults to the current
path of the current document location. note: prior to gecko 6.0,
paths with quotes were treated as if the quotes were part of the string, instead of as if they were delimiters surrounding the actual
path string. this has been fixed. ;domain=domain (e.g., 'example.com' or 'subdomain.example.com'). if not specified, th...
...espace (which are disallowed in cookie values). some user agent implementations support the following cookie prefixes: __secure- signals to the browser that it should only include the cookie in requests transmitted over a secure channel. __host- signals to the browser that in addition to the restriction to only use the cookie from a secure origin, the scope of the cookie is limited to a
path attribute passed down by the server. if the server omits the
path attribute the "directory" of the request uri is used. it also signals that the domain attribute must not be present, which prevents the cookie from being sent to other domains. for chrome the
path attribute must always be the origin. the dash is considered part of the prefix. these flags are only settable with the secure a...
...the only way to protect the cookie is by using a different domain or subdomain, due to the same origin policy. cookies are ...
...on(item) { return item.indexof('reader=1') >= 0 })) { console.log('the cookie "reader" has "1" for value') } //es2016 if (document.cookie.split(';').some((item) => item.includes('reader=1'))) { console.log('the cookie "reader" has "1" for value') } security it is important to note that the
path attribute does not protect against unauthorized reading of the cookie from a different
path. it can be easily bypassed using the dom, for example by creating a hidden <iframe> element with the
path of the cookie, then accessing this iframe's contentdocument.cookie property. the only way to protect the cookie is by using a different domain or subdomain, due to the same origin policy. cookies are often used in web application to identify a user and their authenticated session. so stealin...
Document.createNSResolver() - Web APIs
creates an x
pathnsresolver which resolves namespaces with respect to the definitions in scope for a specified node. syntax nsresolver = document.creatensresolver(node); parameters node is the node to be used as a context for namespace resolution. return value nsresolver is an x
pathnsresolver object. notes adapts any dom node to resolve namespaces so that an x
path expression can be easily evaluated relative to the context of the node where it appeared within the document. this adapter works like the dom level 3 method lookupnamespaceuri on nodes in resolving the namespaceuri from a given prefix using the current information available in the node's hierarchy at the time lookupnamespaceuri is called. also correctly resolves the implicit xml prefix. ...
...h expression can be easily evaluated relative to the context of the node where it appeared within the document. this adapter works like the dom level 3 method lookupnamespaceuri on nodes in resolving the namespaceuri from a given prefix using the current information available in the node's hierarchy at the time lookupnamespaceuri is called. also correctly resolves the implicit xml prefix. note, x
path defines qnames without prefix to match only elements in the null namespace. there is no way in x
path to pick up the default namespace as applied to a regular element reference (e.g., p[@id='_myid'] for xmlns='http://www.w3.org/1999/xhtml'). to match default elements in a non-null namespace, you either have to refer to a particular element using a form such as *namespace-uri()=http://www.w3.org/19...
...e. there is no way in x
path to pick up the default namespace as applied to a regular element reference (e.g., p[@id='_myid'] for xmlns='http://www.w3.org/1999/xhtml'). to match default elements in a non-null namespace, you either have to refer to a particular element using a form such as *namespace-uri()=http://www.w3.org/1999/xhtml and name()=p[@id='_myid'] (this approach works well for dynamic x
path expressions where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace. read more on how to create a user defined namespace resolver if you wish to take the latter approach. creatensresolver was introduced in dom level 3. ...
...(this approach works well for dynamic x
path expressions where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace. read more on how to create a user defined namespace resolver if you wish to take the latter approach. creatensresolver was introduced in dom level 3. see also document.evaluate introduction to using x
path in javascript specifications specification status comment document object model (dom) level 3 x
path specificationthe definition of 'document.creatensresolver' in that specification. recommendation ...
Document.lastModified - Web APIs
omparing the modification dates of documents. ...
...ication dates of documents. ...
...(see: bug 4363 – document.lastmodified returns date in utc time, but should return it in local time) if you want to know whether an external page has changed, please read this paragra...
...(see: bug 4363 – document.lastmodified returns date in utc time, but should return it in local time) if you want to know whether an external page has changed, please read this paragraph about the xmlht...
Event.composed - Web APIs
touch/mouseover/copy/paste, etc.). most other types of events are not composed, and so will return false. for example, this includes synthetic events that are created without their composed option wil set to true. propagation only occurs if the bubbles property is also true. however, capturing only composed events are also handled at host as if they were in at_target phase. ...
... will return false. for example, this includes synthetic events that are created without their composed option wil set to true. propagation only occurs if the bubbles property is also true. however, capturing only composed events are also handled at host as if they were in at_target phase. you can determine the
path the event will follow through the shadow root to the dom root by calling composed
path(). if this value is false, the shadow root will be the last node to be offered the event. examples in our composed-composed-
path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between th...
... .appendchild(pelem); } }); we then insert one of each element into our page: <open-shadow text="i have an open shadow root"></open-shadow> <closed-shadow text="i have a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log(e.composed); console.log(e.composed
path()); }); when you click on the <open-shadow> element and then the <closed-shadow> element, you'll notice two things. the composed property returns true beause the click event is always able to propagate across shadow boundaries. you'll notice a difference in the value of composed
path for the two elements. the <open-shadow> element's composed
path is this: array [ p, shadowroot, open-shadow...
... you'll notice two things. the composed property returns true beause the click event is always able to propagate across shadow boundaries. you'll notice a difference in the value of composed
path for the two elements. the <open-shadow> element's composed
path is this: array [ p, shadowroot, open-shadow, body, html, htmldocument https://mdn.github.io/web-components-examples/composed-composed-
path/, window ] whereas the <closed-shadow> element's composed
path is a follows: array [ closed-shadow, body, html, htmldocument https://mdn.github.io/web-components-examples/composed-composed-
path/, window ] in the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary. specifications specification ...
FileSystemEntry - Web APIs
the filesystementry interface of the file and directory entries api represents a single in a file system. the entry can be a file or a directory (directories are represented by the directoryentry interface). it includes methods for working with files—including copying, moving, removing, and reading files—as well as information about a file it points to—including the file name and its
path from the root to the entry. because this is a non-standard api, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it. check the browser compatibility section for details. basic concepts you don't create filesystementry objects directly. instead, you will receive ...
...esystem(temporary, 1024*1024 /*1mb*/, function(fs) { fs.root.getfile('log.txt', {}, function(fileentry) { fileentry.remove(function() { console.log('file removed.'); }, onerror); }, onerror); }, onerror); properties this interface provides the following properties. filesystem read only a filesystem object representing the file system in which the entry is located. full
path read only a usvstring object which provides the full, absolute
path from the file system's root to the entry; it can also be thought of as a
path which is relative to the root directory, prepended with a "/" character. isdirectory read only a boolean which is true if the entry represents a directory; otherwise, it's false. isfile read only a boolean which is true if the entry represents a...
... methods this interface defines the following methods. copyto() copies the file or directory to a new location on the file system. getmetadata() obtains metadata about the file, such as its modification date and size. getparent() returns a filesystemdirectoryentry representing the entry's parent directory. ...
... ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yesfull
path experimentalchrome full support 8edge full support 79firefox full support 50ie no support noopera no support nosafari full support ...
FileSystemEntrySync - Web APIs
the filesystementrysync interface of the file and directory entries api represents an entry in a file system; it can be either a fileentrysync or directoryentry. it includes methods for working with files—including copying, moving, removing, and reading files—as well as information about the file it points to—including the file name and its
path from the root to the entry. warning: this api was never accepted and never became standardized. various browsers implement pieces of the file and directory entries api (otherwise known as the file system api) but you should try to avoid using it. basic concepts the filesystementrysync interface includes methods that you would expect for manipulating files and directories, but it also include a really handy method for getting a url...
... filesystementrysync copyto(in directoryentrysync parent, optional domstring newname) raises (fileexception); domstring tourl(); void remove() raises (fileexception); directoryentrysync getparent(); attributes attribute type description filesystem readonly filesystemsync the file system where the entry resides. full
path readonly domstring the full absolute
path from the root to the entry. an absolute
path is a relative
path from the root directory, prepended with a '/'. isdirectory readonly boolean true if filesystementrysync is a directory. isfile readonly boolean true if the filesystementrysync is a file. name readonly domstring the name of the ...
... methods getmetadata() look up metadata about this entry. ...
...ces that directory. [todo: what if the directory is not empty? ] [todo: verify ] this is the same method for renaming files. you can keep it in the same location and then define the newname parameter. you cannot do the following: move a directory inside itself or to any child at any depth move an entry into its parent if a name different from its current one isn't provided move a file to a
path occupied by a directory or move a directory to a
path occupied by a file move any element to a
path occupied by a directory that is not empty. filesystementrysync moveto ( in directoryentrysync parent, optional domstring newname ) raises (fileexception); parameters parent the directory to which to move the entry. newname the new name of the entry. if you do not specify a name, the bro...
FileSystemFlags.create - Web APIs
nary is used to indicate whether or not the file should be created if it's missing. filesystemflags is only used when calling filesystemdirectoryentry.getfile() or filesystemdirectoryentry.getdirectory(). syntax filesystemflags.create = booleanvalue values the table below describes the result of each possible combination of these flags depending on whether or not the target file or directory
path already exists. option values file/directory condition result create exclusive false n/a[1]
path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. ...
... option values file/directory condition result create exclusive false n/a[1]
path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. false n/a[1]
path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided). ...
...n whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. false n/a[1]
path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided). true false
path exists the existing file or directory is removed and replaced with a new one, then the successcallback is called with a filesystemfileentry or a filesystemdirectoryentry, as appropriate. true false
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. true tru...
...ts the existing file or directory is removed and replaced with a new one, then the successcallback is called with a filesystemfileentry or a filesystemdirectoryentry, as appropriate. true false
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. true true
path exists the errorcallback is called with an appropriate error, such as fileerror.
path_exists_err. true true
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. specifications sp...
FileSystemFlags.exclusive - Web APIs
e whether or not it's acceptable to require that the file not already exist when the reference to it is created by calling filesystemdirectoryentry.getfile() or filesystemdirectoryentry.getdirectory(). syntax filesystemflags.exclusive = booleanvalue values the table below describes the result of each possible combination of these flags depending on whether or not the target file or directory
path already exists. option values file/directory condition result create exclusive false n/a[1]
path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. ...
... option values file/directory condition result create exclusive false n/a[1]
path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. false n/a[1]
path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided). ...
...n whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. false n/a[1]
path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided). true false
path exists the existing file or directory is removed and replaced with a new one, then the successcallback is called with a filesystemfileentry or a filesystemdirectoryentry, as appropriate. true false
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. true tru...
...ts the existing file or directory is removed and replaced with a new one, then the successcallback is called with a filesystemfileentry or a filesystemdirectoryentry, as appropriate. true false
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. true true
path exists the errorcallback is called with an appropriate error, such as fileerror.
path_exists_err. true true
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. specifications sp...
FileSystemFlags - Web APIs
directory must already exist. exclusive optional if true, and the create option is also true, the file must not exist prior to issuing the call. instead, it must be possible for it to be created newly at call time. the default is false. values and results the table below describes the result of each possible combination of these flags depending on whether or not the target file or directory
path already exists. option values file/directory condition result create exclusive false n/a[1]
path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. ...
... option values file/directory condition result create exclusive false n/a[1]
path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. false n/a[1]
path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided). ...
...n whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called. false n/a[1]
path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was provided). true false
path exists the existing file or directory is removed and replaced with a new one, then the successcallback is called with a filesystemfileentry or a filesystemdirectoryentry, as appropriate. true false
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. true tru...
...ts the existing file or directory is removed and replaced with a new one, then the successcallback is called with a filesystemfileentry or a filesystemdirectoryentry, as appropriate. true false
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. true true
path exists the errorcallback is called with an appropriate error, such as fileerror.
path_exists_err. true true
path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. specifications sp...
Basic concepts - Web APIs
et to true in about:config. object store the mechanism by which data is stored in the database. the object store persistently holds records, which are key-value pairs. records within an object store are sorted according to the keys in an ascending order. every object store must have a name that is unique within its database. the object store can optionally have a key generator and a key
path. if the object store has a key
path, it is using in-line keys; otherwise, it is using out-of-line keys. for the reference documentation on object store, see idbobjectstore. version when a database is first created, its version is the integer 1. each database has one version at a time; a database can't exist in multiple versions at once. the only way to change the version is by opening it wi...
...ated. alternatively, you can also look up records in an object store using the key. to learn more on using indexes, see using indexeddb. for the reference documentation on index, see idbkeyrange. key and value key a data value by which stored values are organized and retrieved in the object store. the object store can derive the key from one of three sources: a key generator, a key
path, or an explicitly specified value. the key must be of a data type that has a number that is greater than the one before it. each record in an object store must have a key that is unique within the same store, so you cannot have multiple records with the same key in a given object store. a key can be one of the following types: string, date, float, a binary blob, and array. for arrays, the key c...
...w keys in an ordered sequence. if an object store does not have a key generator, then the application must provide keys for records being stored. generators are not shared between stores. this is more a browser implementation detail, because in web development, you don't really create or access key generators. in-line key a key that is stored as part of the stored value. it is found using a key
path. ...
...ored. generators are not shared between stores. this is more a browser implementation detail, because in web development, you don't really create or access key generators. in-line key a key that is stored as part of the stored value. it is found using a key
path. an in-line key can be generated using a generator. after the key has been generated, it can then be stored in the value using the key
path or it can also be used as a key. out-of-line key a key that is stored separately from the value being stored. key
path defines where the browser should extract the key from in the object store or index. a valid key
path can include one of the following: an empty string, a javascript identifier, or multiple javascript identifiers separated by periods or an array containing any of those. it can...
Location - Web APIs
it relates to. both the document and window interface have such a linked location, accessible via document.location and window.location respectively. ...
...th the document and window interface have such a linked location, accessible via document.location and window.location respectively. ...
...rent origin than the associated document. location.protocol is a usvstring containing the protocol scheme of the url, including the final ':'. location.host is a usvstring containing the host, that is the hostname, a ':', and the port of the url. location.hostname is a usvstring containing the domain of the url. location.port is a usvstring containing the port number of the url. location.
pathname is a usvstring containing an initial '/' followed by the
path of the url. location.search is a usvstring containing a '?' followed by the parameters or "querystring" of the url. modern browsers provide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring. location.hash is a usvstring containing a '#' followed by the fragment identifier of ...
... living standard ...
SVGGeometryElement - Web APIs
the svggeometryelement interface represents svg elements whose rendering is defined by geometry with an equivalent
path, and which can be filled and stroked. this includes
paths and the basic shapes. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="m...
... methods this interface also inherits metho...
..." stroke-width="2px" /><text x="171" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggeometryelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: the
pathlength property and the gettotallength() and getpointatlength() methods were originally part of the svg
pathelement interface. in svg 2 they were moved to this interface. properties this interface also inherits properties from its parent, svggraphicselement. svggeometryelement.
pathlength read only this property reflects the
pathlength attribute. methods this interface also inherits methods from its parent, svggraphicselement. svggeometryelement.ispointinfill() determines whether a given p...
...ed to be within the fill. svggeometryelement.ispointinstroke() determines whether a given point is within the stroke shape of an element. normal hit testing rules apply; the value of the pointer-events property on the element determines whether a point is considered to be within the stroke. svggeometryelement.gettotallength() returns the user agent's computed value for the total length of the
path in user units. svggeometryelement.getpointatlength() returns the point at a given distance along the
path. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svggeometryelement' in that specification. candidate recommendation initial definition ...
offset-position - CSS: Cascading Style Sheets
the offset-position css property defines the initial position of the offset-
path. syntax /* keyword values */ offset-position: auto; offset-position: top; offset-position: bottom; offset-position: left; offset-position: right; offset-position: center; /* <percentage> values */ offset-position: 25% 75%; /* <length> values */ offset-position: 0 0; offset-position: 1cm 2cm; offset-position: 10ch 8em; /* edge offsets values */ offset-position: bottom 10px right 20px; offset-position: right 3em bottom 10px; offset-position: bottom 10px right; offset-position: top right 10px; /* global values */ offset-position: inherit; offset-position: initial; offset-position: unset; values auto the initial position is the position of the box specified by the position property. <position> ...
...on> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? ...
...[ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? ...
...demo"></div> #motion-demo { offset-
path:
path('m20,20 c20,100 200,0 200,100'); offset-position: left top; animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } specifications specification status comment motion
path module level 1the definition of 'offset-position' in that specification. working draft initial definition ...
HTTP Index - HTTP
ttp guide, http, needsupdate, needsupdate(http/3) http (hypertext transfer protocol) is the underlying protocol of the world wide web. http has evolved from an early protocol to exchange files in a semi-trusted laboratory environment, to the modern maze of the internet, now carrying images, videos in high resolution and 3d. 8 identifying resources on the web domain, http,
path, scheme, syntax, uri, url, url syntax, web, fragment, port, query, resources the target of an http request is called a "resource", whose nature isn't defined further; it can be a document, a photo, or anything else. each resource is identified by a uniform resource identifier (uri) used throughout http for identifying resources. 9 mime types (iana media types) content-type, g...
...nd whether user agent can indicate support for sessions supporting spatial tracking via navigator.xr.issessionsupported() and devicechange event on navigator.xr object. 153 forwarded http, http header, reference, request header, header the forwarded header contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the
path of the request. 154 from http, reference, header the from request header contains an internet email address for a human user who controls the requesting user agent. 155 host http, reference, header the host request header specifies the domain name of the server (for virtual hosting), and (optionally) the tcp port number on which the server is listening. ...
...ation http, http header, reference, response header the location response header indicates the url to redirect a page to. it only provides a meaning when served with a 3xx (redirection) or 201 (created) status response. 167 origin http, reference, request header, header, origin the origin request header indicates where a fetch originates from. it doesn't include any
path information, but only the server name. it is sent with cors requests, as well as with post requests. it is similar to the referer header, but, unlike this header, it doesn't disclose the whole
path. 168 pragma caching, deprecated, http, header, request the pragma http/1.0 general header is an implementation-specific header that may have various effects along the request-respo...
...e of the body of the request is indicated by the content-type header. 214 put http, http method, reference, request method the http put request method creates a new resource or replaces a representation of the target resource with the request payload. 215 trace http, reference, trace method the http trace method performs a message loop-back test along the
path to the target resource, providing a useful debugging mechanism. 216 http resources and specifications guide, http http was first specified in the early 1990s. designed with extensibility in mind, it has seen numerous additions over the years; this lead to its specification being scattered through numerous specification documents (in the midst of experimental abandoned extensi...
Proxy Auto-Configuration (PAC) file - HTTP
iguration (pac) file is a javascript function that determines whether web browser requests (http, https, and ftp) go directly to the destination or are forwarded to a web proxy server. the javascript function contained in the pac file defines the function: function findproxyforurl(url, host) { // ... } syntax function findproxyforurl(url, host) parameters url the url being accessed. ...
... host the hostname extracted from the url. ...
... host the hostname extracted from the url. this is only for convenience; it is the same string as between :// and the first : or / after that. ...
... host the hostname extracted from the url. this is only for convenience; it is the same string as between :// and the first : or / after that. the port number is not included in this parameter. ...
JavaScript modules - JavaScript
orted some features out of your module, you need to import them into your script to be able to use them. ...
...r module, you need to import them into your script to be able to use them. ...
...eportarea, reportperimeter } from './modules/square.js'; you use the import statement, followed by a comma-separated list of the features you want to import wrapped in curly braces, followed by the keyword from, followed by the
path to the module file — a
path relative to the site root, which for our basic-modules example would be /js-examples/modules/basic-modules. however, we've written the
path a bit differently — we are using the dot (.) syntax to mean "the current location", followed by the
path beyond that to the file we are trying to find. this is much better than writing out the entire relative
path each time, as it is shorter, and it makes the url portable — the example will still work if you move it to a different location in the site hierarchy. so for example: /js-examples...
...ding the newest part of the javascript modules functionality to be available in browsers is dynamic module loading. this allows you to dynamically load modules only when they are needed, rather than having to load everything up front. this has some obvious performance advantages; let's read on and see how it works. this new functionality allows you to call import() as a function, passing it the
path to the module as a parameter. it returns a promise, which fulfills with a module object (see creating a module object) giving you access to that object's exports, e.g. import('./modules/mymodule.js') .then((module) => { // do something with the module. }); let's look at an example. in the dynamic-module-imports directory we've got another example based on our classes example. this time ...
Web Performance
and frame rateanimation on the web can be done via svg, javascript, including <canvas> and webgl, css animation, <video>, animated gifs and even animated pngs and other image types. ...
... the web can be done via svg, javascript, including <canvas> and webgl, css animation, <video>, animated gifs and even animated pngs and other image types. the performance cost of animating a css property can vary from one property to another, and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate.critical rendering
paththe critical rendering
path is the sequence of steps the browser goes through to convert the html, css, and javascript into pixels on the screen. optimizing the critical render
path improves render performance.the critical rendering
path includes the document object model (dom), css object model (cssom), render tree and layout.css and javascript animation performancebrowsers are able to optimize rendering flows. in summary,...
...imize rendering flows. in summary, we should always try to create our animations using css transitions/animations where possible. if your animations are really complex, you may have to rely on javascript-based animations instead.lazy loadinglazy loading is a strategy to identify resources as non-blocking (non-critical) and load these only when needed. it is a way of shorten the critical rendering
path length, what would translate into improved page load times. navigation and resource timingsnavigation timings are metrics measuring a browser's document navigation events. resource timings are detailed network timing measurements regarding the loading of an application's resources.optimizing startup performanceregardless of platform, it's always a good idea to start up as quickly as possible.
...mpt to resolve domain names before resources get requested. this could be a file loaded later or link target a user tries to follow. beginner's tutorials the mdn web performance learning area contains modern, up-to-date tutorials covering performance essentials. start here if you are a newcomer to performance: web performance: brief overview overview of the web performance learning
path. start your journey here. what is web performance? this article starts the module off with a good look at what performance actually is — this includes the tools, metrics, apis, networks, and groups of people we need to consider when thinking about performance, and how we can make performance part of our web development workflow. how do users perceive performance? more important than how f...
display - SVG: Scalable Vector Graphics
s means that any child of an element with display="none" will never be rendered even if the child has a value for display other than none. when the display attribute is set to none, then the given element does not become part of the rendering tree. it has implications for the <tspan>, <tref>, and <altglyph> elements, event processing, for bounding box calculations and for calculation of clipping
paths: if display is set to none on a <tspan>, <tref>, or <altglyph> element, then the text string is ignored for the purposes of text layout. regarding events, if display is set to none, the element receives no events. the geometry of a graphics element with display set to none is not included in bounding box and clipping
paths calculations. the display attribute only affects the direct render...
.... regarding events, if display is set to none, the element receives no events. the geometry of a graphics element with display set to none is not included in bounding box and clipping
paths calculations. the display attribute only affects the direct rendering of a given element, whereas it does not prevent elements from being referenced by other elements. for example, setting it to none on a <
path> element will prevent that element from getting rendered directly onto the canvas, but the <
path> element can still be referenced by a <text
path> element; furthermore, its geometry will be used in text-on-a-
path processing even if the <
path> has a display value of none. this attribute also affects direct rendering into offscreen canvases, such as occurs with masks or clip
paths. thus, setting di...
... note: as a presentation attribute, display can be used as a css property. see css display for further information. as a presentation attribute, it can be applied to any element. ...
... note: as a presentation attribute, display can be used as a css property. see css display for further information. as a presentation attribute, it can be applied to any element. ...
dominant-baseline - SVG: Scalable Vector Graphics
or the desired baseline, then the browser may use heuristics to determine the position of the desired baseline. note: as a presentation attribute, dominant-baseline can be used as a css property. see css dominant-baseline for further information. ...
...s dominant-baseline for further information. ...
... if this property occurs on a <text> element, then the computed value depends on the value of the writing-mode attribute. if the writing-mode is horizontal, then the value of the dominant-baseline component is alphabetic. otherwise, if the writing-mode is vertical, then the value of the dominant-baseline component is central. if this property occurs on a <tspan>, <tref>, <altglyph>, or <text
path> element, then the dominant-baseline and the baseline-table components remain the same as those of the parent text content element. if the computed baseline-shift value actually shifts the baseline, then the baseline-table font-size component is set to the value of the font-size attribute on the element on which the dominant-baseline attribute occurs, otherwise the baseline-table font-size rema...
...which baseline-table to use from the baseline-tables in the font is browser dependent. the baseline-table font-size is changed to the value of the font-size attribute on this element. text-top this value uses the top of the em box as the baseline. ...
orient - SVG: Scalable Vector Graphics
ribute indicates how a marker is rotated when it is placed at its position on the shape. ...
...viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="arrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="auto-start-reverse"> <
path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <marker id="dataarrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="-65deg"> <
path d="m 0 0 l 10 5 l 0 10 z" fill="red" /> </marker> </defs> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="url(#dataarrow)" marker-mid="url(#dataarrow)" marker-end="url(#dataarrow)" /> </svg> usage no...
...which points outwards...
...which points outwards from both ends. <angle> this value indicates that the marker is oriented such that the specified angle is that measured between the shape's positive x-axis and the marker's positive x-axis. note: for example, if a value of 45 is given, then the marker's positive x-axis would be pointing down and right in the shape's coordinate system. ...
startOffset - SVG: Scalable Vector Graphics
the startoffset attribute defines an offset from the start of the
path for the initial current text position along the
path after converting the
path to the <text
path> element's coordinate system. only one element is using this attribute: <text
path> html,body,svg { height:100% } <svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <
path id="
path1" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <
path id="
path2" fill="none" stroke="red" d="m130,90 q210,90 210,45 q210,10 170,10 q130,10 130,40 q130,70 165,70 q190,70 195,50" /> <text> <text
path href="#
path1" startoffset="0"> quick brown fox jumps over the lazy dog. ...
...org/2000/svg"> <
path id="
path1" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <
path id="
path2" fill="none" stroke="red" d="m130,90 q210,90 210,45 q210,10 170,10 q130,10 130,40 q130,70 165,70 q190,70 195,50" /> <text> <text
path href="#
path1" startoffset="0"> quick brown fox jumps over the lazy dog. </text
path> </text> <text> <text
path href="#
path2" startoffset="40"> quick brown fox jumps over the lazy dog. ...
...q70,70 75,50" /> <
path id="
path2" fill="none" stroke="red" d="m130,90 q210,90 210,45 q210,10 170,10 q130,10 130,40 q130,70 165,70 q190,70 195,50" /> <text> <text
path href="#
path1" startoffset="0"> quick brown fox jumps over the lazy dog. </text
path> </text> <text> <text
path href="#
path2" startoffset="40"> quick brown fox jumps over the lazy dog. </text
path> </text> </svg> usage notes value <length-percentage> | <number> default value 0 animatable yes <length-percentage> a length represents a distance along the
path measured in the current user coordinate system for the <text
path> element. if a percentage is given, then the start offset represents a percentage distance along the entire
path. t...
... value <length-percentage> | <number> default value 0 animatable yes <length-percentage> a length represents a distance along the
path measured in the current user coordinate system for the <text
path> element. if a percentage is given, then the start offset represents a percentage distance along the entire
path. thus, 0% indicates the start point of the
path and 100% indicates the end point of the
path. <number> this value indicates a distance along the
path measured in the current user coordinate system for the <text
path> element. note: negative values and values larger than the
path length (e.g. 150%) are allowed. specifications specification status comment scalable vector graphics (svg) 2the definition of 'sta...
stroke-dashoffset - SVG: Scalable Vector Graphics
the stroke-dashoffset attribute is a presentation attribute defining an offset on the rendering of the associated dash array. note: as a presentation attribute stroke-dashoffset can be used as a css property. ...
...ttribute is a presentation attribute defining an offset on the rendering of the associated dash array. note: as a presentation attribute stroke-dashoffset can be used as a css property. ...
... browser compatibility the compatibili...
... browser compatibility the compatibility table on this page is generated from structured data. ...
text-anchor - SVG: Scalable Vector Graphics
has an initial current text position, which represents the point in the user coordinate system resulting from (depending on context) application of the x and y attributes on the <text> element, any x or y attribute values on a <tspan>, <tref> or <altglyph> element assigned explicitly to the first rendered character in a text chunk, or determination of the initial current text position for a <text
path> element. note: as a presentation attribute, text-anchor can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <text
path>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- materialisation of anchors --...
...ment. note: as a presentation attribute, text-anchor can be used as a css property. ...
...alue of rtl (typical for arabic and hebrew), the right side of the text is rendered at the initial text position. for an element with a vertical primary text direction (often typical for asian text), the top side of the text is rendered at the initial text position. middle the rendered characters are aligned such that the middle of the text string is at the current text position. ...
...de of the text is rendered at the initial text position. middle the rendered characters are aligned such that the middle of the text string is at the current text position. (for text on a
path, conceptually the text string is first laid out in a straight line. the midpoint between the start of the text string and the end of the text string is determined. then, the text string is mapped onto the
path with this midpoint placed at the current text position.) end the rendered characters are shifted such that the end of the resulting rendered text (final current text position before applying the text-anchor property) is at the initial current text position. for an element with a direction property value of ltr (typical for most european languages), the right side of the text is rendered at the ...
SVG Attribute reference - SVG: Scalable Vector Graphics
rence documentation to help you learn which elements support them and how they work. ...
...ion to help you learn which elements support them and how they work. ...
...djust letter-spacing lighting-color limitingconeangle local m marker-end marker-mid marker-start markerheight markerunits markerwidth mask maskcontentunits maskunits mathematical max media method min mode n name numoctaves o offset opacity operator order orient orientation origin overflow overline-position overline-thickness p panose-1 paint-order
path pathlength patterncontentunits patterntransform patternunits ping pointer-events points pointsatx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r r radius referrerpolicy refx refy rel rendering-intent repeatcount repeatdur requiredextensions requiredfeatures restart result rotate rx ry s scale seed shape-rendering slope spacing spe...
...e attributes class, style conditional processing attributes externalresourcesrequired, requiredextensions, requiredfeatures, systemlanguage. xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate presentation attributes note that all svg presentation attributes can be used as css properties. ...
<animateMotion> - SVG: Scalable Vector Graphics
the svg <animatemotion> element let define how an element moves along a motion
path. note: to reuse an existing
path, it will be necessary to use an <m
path> element inside the <animatemotion> element instead of the
path attribute. ...
... the svg <animatemotion> element let define how an element moves along a motion
path. note: to reuse an existing
path, it will be necessary to use an <m
path> element inside the <animatemotion> element instead of the
path attribute. ...
...ent inside the <animatemotion> element instead of the
path attribute. html,body,svg { height:100%; margin: 0; padding: 0; display:block; } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <
path fill="none" stroke="lightgrey" d="m20,50 c20,-50 180,150 180,50 c180-50 20,150 20,50 z" /> <circle r="5" fill="red"> <animatemotion dur="10s" repeatcount="indefinite"
path="m20,50 c20,-50 180,150 180,50 c180-50 20,150 20,50 z" /> </circle> </svg> usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements<m
path> attributes keypoints this attribute indicate, in the range [0,1], how far is the object along the
path for each keytimes associated values. value type: <number>*; default val...
...80,50 c180-50 20,150 20,50 z" /> </circle> </svg> usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements<m
path> attributes keypoints this attribute indicate, in the range [0,1], how far is the object along the
path for each keytimes associated values. value type: <number>*; default value: none; animatable: no
path this attribute defines the
path of the motion, using the same syntax as the d attribute. value type: <string>; default value: none; animatable: no rotate this attribute defines a rotation applied to the elment animated along a
path, usually to make it pointing in the direction of the animation. value type: <number>|auto|auto-reverse; default value: 0; animatable: no note: for <animatemoti...
<marker> - SVG: Scalable Vector Graphics
the <marker> element defines the graphic that is to be used for drawing arrowheads or polymarkers on a given <
path>, <line>, <polyline> or <polygon> element. markers are attached to shapes using the marker-start, marker-mid, and marker-end properties. ...
...> element. markers are attached to shapes using the marker-start, marker-mid, and marker-end properties. ...
...: yes viewbox this attribute defines the bound of the svg viewport for the current svg fragment. ...
... working draft scalable vector graphics (svg) 2the definition of '<marker>' in that spe...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
tely follow <svg:use> cascading rules (bug 265894). doesn't deliver events to a svgelementinstance tree (bug 265895). conditional processing module switch implemented. image module image implemented. style module style implemented. shape module
path implemented. svg
pathelement interface unimplemented attributes: normalized
pathseglist, animatednormalized
pathseglist rect implemented. circle implemented. line implemented. ellipse implemented. polyline ...
...s: direction, unicode-bidi, font-variant, text-decoration svgtspanelement recently implemented bindings: selectsubstring recently implemented attributes: textlength, lengthadjust tref this feature, present in early draft of the spec, has been removed from it and is therefor not implemented (bug 273171). text
path implemented. recently implemented bindings: selectsubstring altglyph implemented as tspans, no font features as of gecko 2.0 (bug 456286, bug 571808). altglyphdef not implemented. altglyphitem not implemented. glyphref not implemented. ...
...or profile module color-profile not implemented (bug 427713). gradient module lineargradient implemented. radialgradient implemented. stop implemented. pattern module pattern implemented. clip module clip
path implemented. mask module mask implemented. filter module filter implemented. of the pseudo-inputs, sourcegraphic, sourcealpha, fillpaint and strokepaint are implemented. use of an unimplemented pseudo-input or filter element will cause the filter to be ignored and the referring graphic to b...
... scripting module script implemented. animation module animate implemented set implemented animatemotion implemented animatetransform implemented animatecolor not implemented (bug 436296). m
path implemented font module font not implemented (bug 119490). font-face not implemented. glyph not implemented. missing-glyph not implemented. hkern not implemented. vkern not implemented...
Basic shapes - SVG: Scalable Vector Graphics
rectangle the <rect> element draws a rectangle on the screen. there are 6 basic attributes that control the position and shape of the rectangles on screen. the one on the right has its rx and ry parameters set, giving it...
...a list of points. each number must be separated by a space, comma, eol, or a line feed character. each point must contain two numbers: an x coordinate and a y coordinate. so, the list (0,0), (1,1), and (2,2) would be written as 0, 0 1, 1 2, 2. polygon a <polygon> is similar to a <polyline>, in that it is composed of straight line segments connecting a list of points. for polygons though, the
path automatically connects the last point with the first, creating a closed shape. note: a rectangle is a type of polygon, so a polygon can be used to create a <rect/> element in cases where you need a little more flexibility. <polygon points="50, 160 55, 180 70, 180 60, 190 65, 205 50, 195 35, 205 40, 190 30, 180 45, 180"/> points a list of points, each number separated by a space, comma, eo...
...ttle more flexibility. <polygon points="50, 160 55, 180 70, 180 60, 190 65, 205 50, 195 35, 205 40, 190 30, 180 45, 180"/> points a list of points, each number separated by a space, comma, eol, or a line feed character. each point must contain two numbers: an x coordinate and a y coordinate. so, the list (0,0), (1,1), and (2,2) would be written as 0, 0 1, 1 2, 2. the drawing then closes the
path, so a final straight line would be drawn from (2,2) to (0,0).
path a <
path> is the most general shape that can be used in svg. using a
path element, you can draw rectangles (with or without rounded corners), circles, ellipses, polylines, and polygons. basically any of the other types of shapes, bezier curves, quadratic curves, and many more. for this reason, the next section in this tutorial ...
...ht line would be drawn from (2,2) to (0,0).
path a <
path> is the most general shape that can be used in svg. using a
path element, you can draw rectangles (with or without rounded corners), circles, ellipses, polylines, and polygons. basically any of the other types of shapes, bezier curves, quadratic curves, and many more. for this reason, the next section in this tutorial will be focused on
paths. but for now, note that there is a single parameter used to control its shape. <
path d="m20,230 q40,205 50,230 t90,230" fill="none" stroke="blue" stroke-width="5"/> d a list of points and other information about how to draw the
path. see the
paths section for more information. « previousnext » ...
Clipping and masking - SVG: Scalable Vector Graphics
s case, any half-transparent effects are not possible, it's an all-or-nothing approach. masking on the other hand allows soft edges by taking transparency and grey values of the mask into account. creating clips we create the above mentioned semicircle based on a circle element: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <clip
path id="cut-off-bottom"> <rect x="0" y="0" width="200" height="100" /> </clip
path> </defs> <circle cx="100" cy="100" r="100" clip-
path="url(#cut-off-bottom)" /> </svg> centered at (100,100) a circle with radius 100 is painted. the attribute clip-
path references a <clip
path> element with a single rect element. this rectangular on its own would paint the upper half of the canvas black.
...> <rect x="0" y="0" width="200" height="100" /> </clip
path> </defs> <circle cx="100" cy="100" r="100" clip-
path="url(#cut-off-bottom)" /> </svg> centered at (100,100) a circle with radius 100 is painted. the attribute clip-
path references a <clip
path> element with a single rect element. this rectangular on its own would paint the upper half of the canvas black. note, that the clip
path element is usually placed in a defs section. the rect will not be painted, however. instead its pixel data will be used to determine, which pixels of the circle "make it" to the final rendering. ...
...color, opacity and such have no effect as long as they don't let parts vanish completely. ...
...d in a defs section. the rect will not be painted, however. instead its pixel data will be used to determine, which pixels of the circle "make it" to the final rendering. since the rectangle covers only the upper half of the circle, the lower half of the circle will vanish: screenshotlive sample we now have a semicircle without having to deal with arcs in
path elements. for the clipping, every
path inside the clip
path is inspected and evaluated together with its stroke properties and transformation. then every part of the target lying in a transparent area of the resulting clip
path's content will not be rendered. color, opacity and such have no effect as long as they don't let parts vanish completely. masking the effect of masking is most impressively presented with a gradient. if you wan...
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
namespace declaration a pseudo-attribute required to identify the document as an xslt stylesheet. typically this is xmlns:xsl="http://www.w3.org/1999/xsl/transform". syntax <xsl:stylesheet version="number" xmlns:xsl="http://www.w3.org/1999/xsl/transform" id="name" extension-element-prefixes="list-of-names" exclude-result-prefixes="list-of-names"> entire stylesheet </xsl:stylesheet> required attributes version specifies the version of xslt required by this stylesheet. ...
...equired by this stylesheet. optional attributes exclude-result-prefixes specifies any namespace used in this document that should not be sent to the output document. the list is whitespace separated. extension-element-prefixes specifies a space-separated list of any namespace prefixes for extension elements in this document. default-collation specifies the default collation used by all x
path expressions appearing in attributes or text value templates that have the element as an ancestor, unless overridden by another default-collation attribute on an inner element. it also determines the collation used by certain xslt constructs (such as <xsl:key> and xsl:for-each-group) within its scope. default-mode defines the default value for the mode attribute of all <xsl:template> and <xsl:ap...
... this is most often used when the stylesheet is embedded in another xml document. input-type-annotations specifies whether type annotations are stripped from the element so the same results are produced whether the source documents have been validated against a schema or not. use-when determines whether the element and all the nodes that have it as ancestor are excluded from the stylesheet. x
path-default-namespace specifies the namespace that will be used if the element name is unprefixed or an unprefixed type name within an x
path expression. type required outermost element of stylesheet. specifications specification status comment xslt 3.0the definition of '<xsl:stylesheet>' in that specification. recommendation added the attributes default-mode, e...
...ent name is unprefixed or an unprefixed type name within an x
path expression. type required outermost element of stylesheet. specifications specification status comment xslt 3.0the definition of '<xsl:stylesheet>' in that specification. recommendation added the attributes default-mode, expand-text, and use-when. xslt 2.0 added the attributes x
path-default-namespace, default-validation, default-collation, and input-type-annotations and made all attributes except version optional. xslt 1.0 initial definition ...
An Overview - XSLT: Extensible Stylesheet Language Transformations
n should be manipulated in this specific way and end up in this specific position in the result tree. the particulars of how this is to be accomplished are left up to the processor. because the order of execution of the stylesheet cannot be guaranteed, xslt does not support any functionality that produces side-effects. in this it is like lisp or scheme. ...
...rder of execution of the stylesheet cannot be guaranteed, xslt does not support any functionality that produces side-effects. in this it is like lisp or scheme. locations on the tree are specified using x
path, another w3c recommendation. transformations depend on the processor's being able to pinpoint individual nodes on the tree. to facilitate this, the w3c decided to use a separate language, x
path, which also has uses outside the xslt context. as its name implies, x
path defines a "
path" the processor must take through the tree to arrive at the desired node. this
path consists of x
path-specific expressions to be evaluated, expressions which may include a number of conditions to be matched, a way of associating nodes, and/or an indication of directionality within the tree. a fuller descripti...
... potential conflicts in template matching are resolved by using a set of cascading precedence rules. ...
... is to include a processing instruction in the xml document itself. for example, if the stylesheet is called inventory.xsl and resides in the same directory as the xml document, the processing instruction in the xml document would look like this: <?xml-stylesheet type="text/xml" href="inventory.xsl"?> this must be placed in the prolog section of the xml document. to learn more about xslt and x
path, see the for further reading section at the end of this article. ...
XSLT: Extensible Stylesheet Language Transformations
although the process is referred to as "transformation," the original document is not changed; rather, a new xml document is created based on the content of an existing document. then, the new document may be serialized (output) by the processor in standard xml syntax or in another format, such as html or plain text. xslt is most often used to convert data between different xml schemas or to convert xml data into web pages or pdf documents. documentation xslt element reference reference. ...
...e mozilla javascript interface to xsl transformations this document describes the javascript interface to the xslt processing engine in mozilla 1.2 and up. specifying parameters using processing instructions firefox allows stylesheet parameters to be specified when using the <?xml-stylesheet?> processing instruction. this is done using the <?xslt-param?> pi described in this document. ...
...ssing instruction. this is done using the <?xslt-param?> pi described in this document. xslt & x
path tutorial the topxml xslt tutorial introduces you to the basics of xslt concepts, syntax, and programming. xslt tutorial this w3schools tutorial teaches the reader how to use xslt to transform xml documents into other formats, like xhtml. what is xslt? ...
...introduction to xslt and x
path assumes no prior knowledge of the technologies and guides the reader through background, context, structure, concepts and introductory terminology. common xslt errors this article lists some common problems using xslt in firefox. xslt 2.0 (new) view all... community view mozilla forums... ...
cfx to jpm - Archive of obsolete content
olve the argument to require(). in most respects this is the same as the old cfx logic. however there are a few differences, because old compatibility shims have been removed. requiring local modules suppose your add-on is structured into separate modules: my-addon lib main.js utils.js when you want to use the "utils" module in "main.js", you should use a
path relative to "main.js", and prefix the
path with "./" to indicate that it's a relative
path: var utils = require("./utils"); however, with cfx you are also allowed to omit the "./": var utils = require("utils"); // this will not work with jpm! this second form will not work with jpm. requiring modules from test code similarly, suppose you've written some tests for your add-on: my-addon ...
...m. requiring modules from test code similarly, suppose you've written some tests for your add-on: my-addon lib my-addon.js test test-my-addon-js with cfx, code inside "test-my-addon.js" can import "my-addon.js" using a statement like this: var my_addon = require("my-addon"); // this will not work with jpm! with jpm, you must specify the
path to "my-addon" explicitly, using a relative
path: var my_addon = require("../lib/my-addon"); third-party modules the sdk has always supported third-party modules: developers can write their own modules that extend the sdk's apis or add new apis, and other add-on developers can make use of these modules in the same way that they use the sdk's built-in modules. in jpm the old way to use third-p...
...add "fennec" there. there is a known bug in simple options handling which may require the workaround described in https://bug635044.bugzilla.mozilla.org/show_bug.cgi?id=1243467 commands and command options permanently removed commands jpm has dropped support for all the "internal" cfx commands. 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. instead of using --force-mobile, explicitly add fennec to engines section of your pack...
Developing for Firefox Mobile - Archive of obsolete content
the correct version of the android sdk for your device using the android sdk, install the android platform tools next, attach the device to the development machine via usb. now open up a command shell. android platform tools will have installed adb in the "platform-tools" directory under the directory in which you installed the android sdk. make sure the "platform-tools" directory is in your
path. then type: adb devices you should see some output like: list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has found your device and you can get started. running add-ons on android you can develop your add-on as normal, as long as you restrict yourself to the supported modules. when you need to run the add-on, first ensure that ...
...he long hex string will be different.) if you do, then adb has found your device and you can get started. running add-ons on android you can develop your add-on as normal, as long as you restrict yourself to the supported modules. when you need to run the add-on, first ensure that firefox is not running on the device. ...
...gcat prints adb's log, so you can filter the debug output after running the add-on. for example, on mac os x or linux you can use a command like the one below to filter only the lines of console output: adb logcat | grep console you can experiment with different filter strings on adb logcat to focus in on the lines relevant to you. running jpm-mobile test is identical: jpm-mobile test --adb /
path/to/adb packaging mobile add-ons to package a mobile add-on as an xpi, use the command: jpm xpi actually installing the xpi on the device is a little tricky. the easiest way is probably to copy the signed xpi somewhere on the device: adb push my-addon.xpi /mnt/sdcard/ then open firefox mobile and type this into the address bar: file:///mnt/sdcard/my-addon.xpi the browser should open th...
Notes on HTML Reflow - Archive of obsolete content
e same frame to the queue. a caller may also cancel a reflow command that is in the queue; e.g., if the target frame is destroyed. dispatch. the presentation shell processes the reflow queue by removing a single reflow command from the queue and dispatching it to its target frame. (but cf. ...
...
path is built from the target frame to the root frame and stored in the reflow command. a reflow state object is created with a reflow reason of incremental, the reflow command is stored in the state, and the reflow method of the root frame is invoked. processing. the root frame notes the incremental reflow reason specified in the reflow state, and inspects the
path contained within the reflow command object. specifically, it extracts the next frame along the
path from the reflow command object, creates its own reflow state, also with an incremental reason, and invokes the reflow method of the next frame. the incremental reflow proceeds recursively through the frame hierarchy. ...
...in order to correctly dispatch the reflow to the child frame, the frame may need to perform some state recovery ; for example, a block frame will traverse its line list to recover the space occupied by floated frames. ...
Dehydra Function Reference - Archive of obsolete content
see the dehydra object reference for details on the available object properties. process_type(type) dehydra calls this for each class, struct, enum, union, and typedef declaration. process_type is called after process_function is called for all the member functions. type is a type object representing the type that was declared. ...
...cular location, the location will be printed first. msg is a string to output to customize the location info printed set this._loc before calling print() include(file [, namespace]) include a javascript file into a namespace. file is a string representing the file to include optional: namespace is an object to include the file into. the default namespace is this the directories in sys.include_
path are searched for the file, and the current working directory is searched last. includes are guarded so a file is only included once and subsequent include calls are ignored. this is accomplished by recording every included file into the _includedarray in the current namespace. include example include("map.js") // includes map.js into toplevel var map = {} include("map.js", map) // includes map.js...
...rred from the last process_type or process_function. _print(msg, ...) the low level function called by print(). it does not print the location. read_file(filename) read a file a return it as a string. write_file(filename, data) write a string to a file. builtin objects sys this.sys is a container for miscellaneous properties exposes by dehydra sys.gcc_version is a gcc version string sys.include_
path exposes the search
path used by include(). the default value is the following directories: the directory of the dehydra script being processed the libs directory next to the gcc_dehydra.so plugin user script may add additional directories sys.aux_base_name exposes the base filename part of the file being compiled sys.frontend exposes the compiler frontend (e.g. "gnu c" or "gnu c++") arguments...
Style System Overview - Archive of obsolete content
ich is the interface through which layout accesses the style data for a given element, points to one rule node. we create one style context per frame, since frames point to style contexts rather than the other way around. style contexts own their parents, since inheritance operates through style context parents (ugly when we have multiple frames per content node). there is one rule node on the
path from the root rule node to the style context's rule node for each rule that the element matches. style context api the style context api allows data to be obtained through a set of structs (see nsstylestruct.h). a struct for a style context can be obtained through nsistylecontext::getstyledata. nsiframe::getstyledata does the same thing for the frame's mstylecontext member, and the global :...
...en percentage units are used in a way that is handled by the style code (rather than reflow). if the data are exactly the same as those of the parent, we copy the struct to the child style context and set a bit saying that it doesn't own the struct. (the context tree can be deep.) each rule node has a per-struct set of “none bits” that say that the rule node's set of rules (the rules on the
path to the root) specify nothing non-inherited for the struct. style data cached in rule tree if the data struct doesn't depend on the parent style context in any ways (inheritance, perhaps by omission; percentages and ems when computed), we can cache it in the rule tree. when we compute a data struct, we cache it as high as possible in the rule tree -- on the lowest of the rule nodes on the pa...
... default or a start struct as the basis for the computation. a start struct is a cached struct in the rule tree that we can just copy and add to. if the computation in compute*data used any data from the parent style context, we cache the struct on the style context. otherwise, we cache the struct in the rule tree, on the first rule node that contributed any data, and mark dependent bits on the
path up to that rule node. managing style contexts style contexts must (in most cases) be created before frames are constructed, to determine what frame to create. parent style context determines inheritance; it should always be the content parent. [design flaw in frame/sc relationship] three functions for creating style contexts on nsistyleset, wrapped by similarly named ones on nsiprescontext...
jspage - Archive of obsolete content
h($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); }break;case"hash":b=new hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var browser=$merge({engine:{name:"unknown",version:0},platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].tolowercase()},features:{x
path:!!(document.evaluate),air:!!(window.runtime),query:!!(document.queryselector)},plugins:{},engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getelementsbyclassname)?950:925)); },trident:function(){return(!window.activexobject)?false:((window.xmlhttprequest)?((document.queryselectorall)?6:5):4);},webkit:function(){return(navigator.taintenabled)?false:(...
...te),air:!!(window.runtime),query:!!(document.queryselector)},plugins:{},engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getelementsbyclassname)?950:925)); },trident:function(){return(!window.activexobject)?false:((window.xmlhttprequest)?((document.queryselectorall)?6:5):4);},webkit:function(){return(navigator.taintenabled)?false:((browser.features.x
path)?((browser.features.query)?525:420):419); },gecko:function(){return(!document.getboxobjectfor&&window.mozinnerscreenx==null)?false:((document.getelementsbyclassname)?19:18);}}},browser||{});browser.platform[browser.platform.name]=true; browser.detect=function(){for(var b in this.engines){var a=this.engines[b]();if(a){this.engine={name:b,version:a};this.engine[b]=this.engine[b+a]=true; break;}}ret...
... null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; }return eval("("+string+")");}});native.implement([hash,array,string,number],{tojson:function(){return json.encode(this);}});var cookie=new class({implements:options,options:{
path:false,domain:false,duration:false,secure:false,document:document},initialize:function(b,a){this.key=b; this.setoptions(a);},write:function(b){b=encodeuricomponent(b);if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.
path){b+=";
path="+this.options.
path; }if(this.options.duration){var a=new date();a.settime(a.gettime()+this.options.duration*24*60*60*1000);b+="; expires="+...
Microsummary XML grammar reference - Archive of obsolete content
fox should update microsummaries generated by the generator. the element can be used to specify both an absolute update interval and a series of conditional intervals based on the content of the page being summarized. attributes: interval (optional) an absolute interval of time, in minutes, that must elapse between updates. child elements: <condition> (optional) an x
path boolean expression along with a conditional interval of time, in minutes, that must elapse between updates if the expression evaluates to true. the interval attribute defines an absolute interval in minutes. its value must be a number greater than or equal to 1. fractional values (e.g. 5.5 minutes) are permitted, although they probably aren't useful. the <update> element may contain any number o...
...ctional values (e.g. 5.5 minutes) are permitted, although they probably aren't useful. the <update> element may contain any number of <condition> child elements. firefox determines which interval to apply to a microsummary generated by a generator according to the following rules: firefox processes each <condition> child element in document order. for each one, firefox evaluates the element's x
path boolean expression against the page being summarized. if the expression evaluates to true, firefox applies that element's interval and stops processing child elements. thus, the first matching <condition> determines the update interval. if there are no <condition> child elements, or if none of their expressions evaluate to true, firefox applies the value of the <update> element's interval attri...
...ox checks for expired microsummaries every 15 seconds, it is possible for a microsummary update to begin up to 15 seconds later than its interval indicates; firefox respects the browser cache when updating microsummaries, so it will not reload a page to update its microsummary if the cache contains a fresh copy of the page. the <condition> element the optional <condition> element specifies an x
path boolean expression along with a conditional interval of time, in minutes, that must elapse between updates if the expression evaluates to true when evaluated against the page being summarized. it must be a child of the <update> element. attributes: expression (required) an x
path boolean expression to be evaluated against the page being summarized. interval (required) ...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
many browsers, such as internet explorer, also support pre-w3c ...
...many browsers, such as internet explorer, also support pre-w3c apis and have ne...
...l document. void setrequestheader (string headername, string headervalue) sets an http request header for use in the http request. has to be called after open() is called. string status the status code of the http response. xslt differences mozilla supports xsl transformations (xslt) 1.0. it also allows javascript to perform xslt transformations and allows running x
path on a document. mozilla requires that you send the xml and xslt files with an xml mimetype (text/xml or application/xml). this is the most common reason why xslt won't run in mozilla but will in internet explorer. mozilla is strict in that way. internet explorer 5.0 and 5.5 supported xslt's working draft, which is substantially different than the final 1.0 recommendation. the easiest way to dist...
URIs and URLs - Archive of obsolete content
ric form of an url. simply speaking it's scheme and non-scheme, separated by a colon, like "about". nsiurl inherits from nsiuri and represents access to typical urls with schemes like "http", "ftp", ... nssimpleuri one implementation of nsiuri is nssimpleuri which is the basis for protocols like "about". nssimpleuri contains setters and getters for the uri and the components of an uri: scheme and
path (non-scheme). there are no pre written urlparsers for simple uris, because of it's simple structure. nsstandardurl the most important implementation of nsiurl is nsstandardurl which is the basis for protocols like http, ftp, ... these schemes support a hierarchical naming system, where the hierarchy of the name is denoted by a "/" delimiter separating the components in the
path. nsstandardurl als...
...l is nsstandardurl which is the basis for protocols like http, ftp, ... these schemes support a hierarchical naming system, where the hierarchy of the name is denoted by a "/" delimiter separating the components in the
path. nsstandardurl also contains the facilities to parse these typ of urls, to break the specification of the url "spec" down into the most basic segments. the spec consists of pre
path and
path. the pre
path consists of scheme and authority. the authority consists of prehost, host and port. the prehost consists of username and password. the
path consists of directory, filename, param, query and ref. the filename consists of filebasename and fileextension. if the spec is completly broken down, it consists of: scheme, username, password, host, port, directory, filebasename, fileex...
...lebasename, fileextension, param, query and ref. together these segments form the url spec with the following syntax: scheme://username:password@host:port/directory/filebasename.fileextension;param?query#ref for performance reasons the complete spec is stored in escaped form in the nsstandardurl object with pointers (position and length) to each basic segment and for the more global segments like
path and prehost for example. necko provides pre written urlparsers for schemes based on hierachical naming systems. escaping to be able to parse an url safely it is sometimes necessary to "escape" certain characters, to hide them from the parser. an escaped character is encoded as a character triplet, consisting of the percent character "%" followed by the two hexadecimal digits representing the oct...
diskSpaceAvailable - Archive of obsolete content
returns a double number representing the amount of space, in bytes, on the queried drive. ...
... returns a double number representing the amount of space, in bytes, on the queried drive. ...
... returns a double number representing the amount of space, in bytes, on the queried drive. ...
registerChrome - Archive of obsolete content
skin is used to register skins, locale is used to register language packs. package, a third possibility is the equivalent of skin and/or locale, and ensures that everything in the xpi is registered. one final option for the switch parameter is delayed_chrome, which registers the switch only after a relaunch of the browser. ...
... the switch parameter is delayed_chrome, which registers the switch only after a relaunch of the browser. note that you can combine switches as in the example below. srcdir srcdir is a filespecobject representing the source destination of the installation. filespecobjects like that required by this function are created using the getfolder method on the install object. xpi
path xpi
path is the
path within the xpi in where the contents.rdf file defining the chrome is located. for example, "locale/mylocale/aim," points to the locale/mylocale/aim subdirectory of the same xpi file in which the installation script is located. returns an integer error code. for a list of possible values, see return codes. in some situations the method may return other errors. in a few...
...error. description when the third parameter is omitted (pointing to a specific location within the xpi file), this function is being used in a somewhat deprecated way. in this case, registerchrome is supporting the old format of installation archives, in which the manifest.rdf file was always located at the highest level of the installation archive. in this case, registerchrome does not require a
path inside the archive, as it does now in order to locate the more flexible contents.rdf format of installation archives. note that you can also look in the installed-chrome.txt file in the chrome directory to see how and where the registerchrome function has registered your package with the chrome registry. example example assumes your xpi file is in plugins folder and rdf file is in resources subfo...
Uploading and Downloading Files - Archive of obsolete content
ing the xmlhttprequest object. this is a common technique for uploading files as it is compatible with existing servers and formdata interface makes that task fairly simple. a formdata object will automatically generate request data with mime type multipart/form-data that existing servers can process. to add a file field to the data you use a file object that an extension can construct from file
path. ...
...servers and formdata interface makes that task fairly simple. a formdata object will automatically generate request data with mime type multipart/form-data that existing servers can process. to add a file field to the data you use a file object that an extension can construct from file
path. the formdata object can then simply be passed to xmlhttprequest: function upload(posturl, fieldname, file
path) { var formdata = new formdata(); formdata.append(fieldname, new file(file
path)); var req = new xmlhttprequest(); req.open("post", posturl); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation. this is simpler but it doesn't allow sending additional data and web servers usually ne...
...; var req = new xmlhttprequest(); req.open("post", posturl); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation. this is simpler but it doesn't allow sending additional data and web servers usually need special configuration to support put operations. function uploadput(posturl, file
path) { var req = new xmlhttprequest(); req.open("put", posturl); req.setrequestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(file
path)); } in this example, a new input stream is created for a file, and is passed to the xmlhttprequest's send method. fetch upload please refer to uploading a file section inside th...
window - Archive of obsolete content
tle bar check this page on window icons. to add a favicon to the address bar and browser tab (ie dialog is not a popup) then use the following code snippet to use the html namespace and link. <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <!-- icon from chrome --> <html:link rel="icon" href="chrome://myextension/content/
path/to/favicon.png"/> <!-- from a remote site --> <html:link rel="icon" href="http://www.mozilla.org/favicon.ico"/> since firefox 3.6 the above listed code does not work correctly - it produces the following message: "warning: xul box for box element contained an inline link child, forcing all its children to be wrapped in a block". if this code is placed between window tags it messes up all other...
...l box for box element contained an inline link child, forcing all its children to be wrapped in a block". ...
... placed between window tags it messes up all other controls on the window. if it is placed between box tags, window controls are rendered fine, but still there is this error message. ...
Debugging a XULRunner Application - Archive of obsolete content
forget to change these preferences back to their defaults when you've finished debugging; leaving them as-is can significantly harm performance and usability. see: preference reference for more information about these preferences. console to enable a console on windows, start xulrunner with the -console argument. note that -console goes after the application.ini argument: e.g. xulrunner.exe /
path/to/application.ini -console to output text to the console, use dump("my text here\n");. this will only work if the pref pref("browser.dom.window.dump.enabled", true) is enabled. to output dump calls instead to a file, set browser.dom.window.dump.file to the file destination where the log should be created and restart the application. if you would like the console messages to appear in the con...
...nder redirector-master\gecko\console redirector\bin\release copy all the dll's and the exe to wherever you want. then run console redirector.exe /? javascript console to enable the js console, start xulrunner with the -jsconsole argument. note: if you are not using the stub executable to launch the application, the -jsconsole argument is after the application.ini argument: e.g. xulrunner.exe /
path/to/application.ini -jsconsole by default the js console only shows errors from web content. to show errors in chrome javascript, the pref pref("javascript.options.showinconsole", true) must be set. to log js errors to disk, set the environment variable xre_console_log to the
path to the filename. i.e. export xre_console_log=/
path/to/logfile or set xre_console_log=c:\
path\to\logfile. to output ...
...and you should be able to point the debugger to your app. happy debugging :) venkman follow these instructions to install venkman into your xulrunner application (xulrunner 1.9 and late...
Gecko Compatibility Handbook - Archive of obsolete content
d by doctype. standards mode layout has been specified by the doctype. change the doctype to request quirks mode layout instead. more info clicking a link results in a 404-page not found but works in internet explorer the link may use an invalid form of a relative url. change relative urls from http://directory/... to directory/.... or use absolute
paths in urls such as http://example.com/directory/... verify that all hyperlinks use forward slashes (/) clicking on a link displays a "download" or displays html code instead of rendering the page correctly, but works as expected in internet explorer the web server has incorrectly specified the mime type for the content. internet explorer tries to guess the mime type of doc...
...ly. due to the common nature of this error by web authors, netscape 6.2 began treating css class attributes as case-insensitive in quirks mode only. if you are invoking standards mode, you should still code your css to be consistent with respect to case. incorrect relative urls a relative url is one which refers to the same web server where a web page is hosted. a relative url that refers to a
path relative to the directory where a web page is located looks like
path/file.html. relative urls that refer to a
path relative to the web server's root directory look like /
path/file.html. older browsers supported the invalid use of http://
path/ for urls relative to a web server's root directory but gecko browsers do not. to correctly specify a web page relative to a web server's root directory, u...
... invalid use of spaces in name attributes (such as image maps) many authors seem to be infected by a penchant to use spaces in names. a name or id attribute in html 4.01 may not legally contain spaces. this can cause problems with gecko-based browsers, especially in image maps. ...
Using SSH to connect to CVS - Archive of obsolete content
ake a moment, followed by a prompt for a passphrase. once you have entered a passphrase, ssh-keygen will create two files, ~/.ssh/id_dsa and ~/.ssh/id_dsa.pub do not sendid_dsa. do file a server operations bug in bugzilla and attach yourid_dsa.pub to the bug. setting up cvs to use ssh in your system's environment, make sure thatcvs_rsh is set to whatever your ssh binary is called; a full
path is not necessary if ssh is already in your
path. replace pserver with ext in your cvsroot environment variable. if you wish to keep your previous pserver trees, you'll need to update the root files in each cvs subdirectory in your tree. this can be done using a unix-style find and perl: find . -name root -exec perl -p -i -e "s/pserver/ext/" {} \; dealing with firewalls do not attempt to perf...
...xit x windows in "~/.xinitrc" add "ssh-add". this will bring up a graphic box just after login, and before the desktop loads, asking for your passphrase. the passphrase will be held for the length of the x session, and be passed on to all child shells. ms-dos command prompt cygwin for /f "tokens=1,2,3* delims=; " %%a in ('ssh-agent -c') do if "%%a"=="setenv" set %%b=%%c set home=/cygdrive/c/
path/to/your/cygwin/home/directory ssh-add ~/.ssh/id_dsa start /b /wait cmd.exe ssh-agent -k exit essentially both sets of commands do the same thing. first ssh-agent is called and its output is evaluated in the current environment. this sets environment variables that let cvs know how to find and use the agent. your private key is then added to ssh-agent using ssh-add at which point you will be pro...
...only work in versions of windows based on nt (nt/2000/xp). if you're building on win9x/winme you'll need to find an alternative solution. if you're typing the commands directly (as opposed to storing them in a batch file that you call), you'll need to replace the occurances of "%%" in the first line with "%". finally, note that ssh-add needs the environment variable home to be set with the cygwin
path to your cygwin home directory. mozillabuild if you're using mozillabuild, ssh-agent should be started when you run the start-msvc???.bat file. you should be prompted to enter your passphrase. mozillabuild 1.2 contains a bug that will stop ssh-agent from automatically starting with msys. to fix this, apply this diff to c:\mozilla-build\msys\etc\profile.d\profile-sshagent.sh. ...
LiveConnect Overview - Archive of obsolete content
package called redwood to contain various java classes that it implements. to create an instance of the helloworld class in redwood, you access the constructor of the class as follows: var red = new packages.redwood.helloworld(); you can also access classes in the default package (that is, classes that don't explicitly name a package). for example, if the helloworld class is directly in the class
path and not in a package, you can access it as follows: var red = new packages.helloworld(); the liveconnect java, sun, and netscape objects provide shortcuts for commonly used java packages. for example, you can use the following: var mystring = new java.lang.string("hello world"); instead of the longer version: var mystring = new packages.java.lang.string("hello world"); working with java arrays...
...s directory beneath the navigator directory. more recently, the classes have been distributed with sun's java runtime; initially in the file "jaws.jar" in the "jre/lib" directory of the runtime distribution (for jre 1.3), then in "plugin.jar" in the same location (jre 1.4 and up). using the liveconnect classes with the jdk to access the liveconnect classes, place the .jar or .zip file in the class
path of the jdk compiler in either of the following ways: create a class
path environment variable to specify the
path and name of .jar or .zip file. specify the location of .jar or .zip file when you compile by using the -class
path command line parameter. you can specify an environment variable in windows nt by double-clicking the system icon in the control panel and creating a user environment va...
...r in either of the following ways: create a class
path environment variable to specify the
path and name of .jar or .zip file. specify the location of .jar or .zip file when you compile by using the -class
path command line parameter. you can specify an environment variable in windows nt by double-clicking the system icon in the control panel and creating a user environment variable called class
path with a value similar to the following: c:\program files\java\jre1.4.1\lib\plugin.jar see the sun jdk documentation for more information about class
path. note: because java is a strongly typed language and javascript is weakly typed, the javascript runtime engine converts argument values into the appropriate data types for the other language when you use liveconnect. see data type conversions for...
Using the DOM File API in chrome code - Extensions
if you want to use the dom file api in chrome code, you can do so without restriction. in fact, you get one bonus feature: you can create file objects specifying the
path of the file on the user's computer. this only works from privileged code, so web content can't do it. this protects users from the inherent security risks associated with allowing web content free access to the contents of their disks. if you pass a
path to the file constructor from unprivileged code (such as web content), an exception will be thrown. scope availability in the jsm scope file is available without needing to do anything special. ...
...g web content free access to the contents of their disks. if you pass a
path to the file constructor from unprivileged code (such as web content), an exception will be thrown. scope availability in the jsm scope file is available without needing to do anything special. in bootstrap scope, this must be imported in like so: cu.importglobalproperties( [ "file" ] ) accessing a file by hard-coded
pathname to reference a file by its
path, you can simply use a string literal: var file = file.createfromfilename("
path/to/some/file"); cross platform note: however using hard-coded
paths raises cross platform issues since it uses a platform-dependent
path separator (here "/"). ...
... "file" ] ) accessing a file by hard-coded
pathname to reference a file by its
path, you can simply use a string literal: var file = file.createfromfilename("
path/to/some/file"); cross platform note: however using hard-coded
paths raises cross platform issues since it uses a platform-dependent
path separator (here "/"). in the xul/mozilla platform there isn't sadly an equivalent to java file.
pathseparator (the system-dependent
path-separator character). so the good practice is to avoid trying to determine and to use the
path separator at all. instead, use the nsifile::append() method as explained in the next section. accessing files in a special directory you can also use the directory service to obtain and build the
path to a file to access. for example, let's say your add-on needs to ...
bootstrap.js - Extensions
executed in a privileged sandbox, which is cached until the extension is shut down. for more information, see bootstrapped extensions. the example below contains the required methods in vsdoc format. ...
... nsifile install
path /// nsiuri resourceuri /// /// reason types: /// app_startup /// addon_enable /// addon_install /// addon_upgrade /// addon_downgrade } function shutdown(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile install
path /// nsiuri resourceuri /// /// reason types: /// app_shutdown /// addon_disable /// addon_uninstall /// addon_upgrade /// addon_downgrade } function install(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile install
path /// ns...
...string id /// string version /// nsifile install
path /// nsiuri resourceuri /// /// reason types: /// addon_install /// addon_upgrade /// addon_downgrade } function uninstall(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile install
path /// nsiuri resourceuri /// /// reason types: /// addon_uninstall /// addon_upgrade /// addon_downgrade } ...
Audio for Web games - Game development
we need to make sure they start at the correct point that other tracks might be playing at, so they sync up. ...
...w audiocontext(); now let's select all the <li> elements; later we can harness these elements to give us access to the track file
path and each individual play button. const trackels = document.queryselectorall('li'); we want to make sure each file has loaded and been decoded into a buffer before we use it, so let's create an async function to allow us to do this: async function getfile(file
path) { const response = await fetch(file
path); const arraybuffer = await response.arraybuffer(); const audiobuffer = await audioctx.decodeaudiodata(arraybuffer); return audiobuffer; } we can then use the await operator when calling this function, which ensures that we can run subsequent code when it has finished executing. let's create another async function to set up the sample — we can...
...aybuffer); return audiobuffer; } we can then use the await operator when calling this function, which ensures that we can run subsequent code when it has finished executing. let's create another async function to set up the sample — we can combine the two async functions in a nice promise pattern to perform further actions when each file is loaded and buffered: async function loadfile(file
path) { const track = await getfile(file
path); return track; } let's also create a playtrack() function, which we can call once a file has been fetched. we need an offset here, so if we have started one file playing, we have a record of how far through to start another file. start() takes two optional parameters. the first is when to commence playback and the second is where, which is our offse...
Tiles and tilemaps overview - Game development
y are constructed by small images or image fragments multiple times. this set of articles covers the basics of creating tile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) besides the performance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a
path-finding graph, or handling collisions) or to create a level editor. some popular games that use this technique are super mario bros, pacman, zelda: link's awakening, starcraft, and sim city 2000. think about any game that uses regularly repeating squares of background, and you'll probably find it uses tilemaps. the tile atlas the most efficient way to store the tile images is in an atlas or sp...
...clude: tile size: the size of each tile in pixels across / pixels down. image atlas: the image atlas that will be used (one or many.) map dimensions: the dimensions of the map, either in tiles across / tiles down, or pixels across / pixels down. visual grid: includes indices showing what type of tile should be placed on each position in the grid. logic grid: this can be a collision grid, a
path-finding grid, etc., depending on the type of game. note: for the visual grid, a special value (usually a negative number, 0 or null) is needed to represent empty tiles. square tiles square-based tilemaps are the most simple implementation. a more generic case would be rectangular-based tilemaps — instead of square — but they are far less common. square tiles allow for two perspectives: ...
...logic grid since tilemaps are an actual grid of visual tiles, it is common to create a mapping between this visual grid and a logic grid. the most common case is to use this logic grid to handle collisions, but other uses are possible as well: character spawning points, detecting whether some elements are placed together in the right way to trigger a certain action (like in tetris or bejeweled),
path-finding algorithms, etc. note: you can take a look at our demo that shows how to use a logic grid to handle collisions. isometric tilemaps isometric tilemaps create the illusion of a 3d environment, and are extremely popular in 2d simulation, strategy or rpg games. some of these games include simcity 2000, pharaoh or final fantasy tactics. the below image shows an example of an atlas for an ...
Build the brick field - Game development
e used for collision detection purposes later. brick drawing logic now let's create a function to loop through all the bricks in the array and draw them on the screen. our code might look like this: function drawbricks() { for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { bricks[c][r].x = 0; bricks[c][r].y = 0; ctx.begin
path(); ctx.rect(0, 0, brickwidth, brickheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.close
path(); } } } again, we're looping through the rows and columns to set the x and y position of each brick, and we're also painting a brick on the canvas — size brickwidth x brickheight — with each loop iteration. the problem is that we're pai...
...add ...
...add the following just above the drawball() call: drawbricks(); compare your code at this point, the game has got a little more interesting again : ex...
Create the Canvas and draw on it - Game development
"); here we're storing a reference to the <canvas> element to the canvas variable. then we're creating the ctx variable to store the 2d rendering context — the actual tool we can use to paint on the canvas. let's see an example piece of code that prints a red square on the canvas. add this below your previous lines of javascript, then load your index.html in a browser to try it out. ctx.begin
path(); ctx.rect(20, 40, 50, 50); ctx.fillstyle = "#ff0000"; ctx.fill(); ctx.close
path(); all the instructions are between the begin
path() and close
path() methods. we are defining a rectangle using rect(): the first two values specify the coordinates of the top left corner of the rectangle on the canvas, while the second two specify the width and height of the rectangle. in our case the rectangle is ...
...and 40 pixels from the top side, and is 50 pixels wide and 50 pixels high, which makes it a perfect square. the fillstyle property stores a color that will be used by the fill() method to paint the square, in our case, red. we're not limited to rectangles — here's a piece of code for printing out a green circle. try adding this to the bottom of your javascript, saving and refreshing: ctx.begin
path(); ctx.arc(240, 160, 20, 0, math.pi*2, false); ctx.fillstyle = "green"; ctx.fill(); ctx.close
path(); as you can see we're using the begin
path() and close
path() methods again. between them, the most important part of the code above is the arc() method. it takes six parameters: x and y coordinates of the arc's center arc radius start angle and end angle (what angle to start and finish drawing...
...s optional. the fillstyle property looks different than before. this is because, just as with css, color can be specified as a hexadecimal value, a color keyword, the rgba() function, or any of the other available color methods. instead of using fill() and filling the shapes with colors, we can use stroke() to only colour the outer stroke. try adding this code to your javascript too: ctx.begin
path(); ctx.rect(160, 10, 100, 40); ctx.strokestyle = "rgba(0, 0, 255, 0.5)"; ctx.stroke(); ctx.close
path(); the code above prints a blue-stroked empty rectangle. thanks to the alpha channel in the rgba() function, the blue color is semi transparent. compare your code here's the full source code of the first lesson, running live in a jsfiddle: exercise: try changing the size and color of the gi...
Plug-in Development Overview - Gecko Plugin API Reference
e plug-in can select one of these transmission modes: normal mode: the browser sends the stream data sequentially to the plug-in as the data becomes available. random-access mode: the browser allows the plug-in to request specific ranges of bytes from anywhere in the stream. this mode requires server support. file mode: the browser saves the data to a local file in cache and passes that file
path to the plug-in. streams produced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse. in the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it,...
...indows installation using the registry on windows, plug-ins should be installed to a plug-in-specific directory such as c:\program files\plugin name\nppluginname.dll. ...
... using the registry on windows, plug-ins should be installed to a plug-in-specific directory such as c:\program files\plugin name\nppluginname.dll. ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
er. 56 css object model (cssom) css, cssom, dom, glossary, web performance the css object model (cssom) is a map of all css selectors and relevant properties for each selector in the form of a tree, with a root node, sibling, descendant, child, and other relationship. the cssom is very similar to the document object model (dom). both of them are part of the critical rendering
path which is a series of steps that must happen to properly render a website. 57 css pixel css, css pixel, glossary, height, length, pixel, size, unit, width the css pixel—denoted in css with the suffix px—is a unit of length which roughly corresponds to the width or height of a single dot that can be comfortably seen by the human eye without strain, but is otherwise as small...
...nt downloads of assets exceeding that limit, domain sharding splits content across multiple subdomains. when multiple domains are used to serve multiple assets, browsers are able to download more resources simultaneously, resulting in a faster page load time and improved user experience. 121 dominator codingscripting, glossary in graph theory, node a dominates node b if every
path from the root node to b passes through a. 122 dynamic programming language codingscripting, glossary a dynamic programming language is a programming language in which operations otherwise done at compile-time can be done at run-time. for example, in javascript it is possible to change the type of a variable or add new properties or methods to an object while the program is ru...
...s between xml and xml or other documents. some its behaviors are left to the implementation to determine how to handle. 511 xml codingscripting, glossary, xml, l10n:priority extensible markup language (xml) is a generic markup language specified by the w3c. the information technology (it) industry uses many languages based on xml as data-description languages. 512 x
path codingscripting, glossary, xml, x
path x
path is a query language that can access sections and content in an xml document. 513 xquery codingscripting, glossary, xml, xquery xquery is a computer language for updating, retrieving, and calculating data in xml databases. 514 xslt codingscripting, glossary, xml, xslt extensible stylesheet language tran...
How do you set up a local testing server? - Learn web development
arn how to set up a local testing server. local files vs. remote files throughout most of the learning area, we tell you to just open your examples directly in a browser — this can be done by double clicking the html file, dragging and dropping it into the browser window, or choosing file > open... and navigating to the html file. there are many ways to achieve this. if the web address
path starts with file:// followed by the
path to the file on your local hard drive, a local file is being used. in contrast, if you view one of our examples hosted on github (or an example on some other remote server), the web address will start with http:// or https://, to show that the file has been received via http. the problem with testing local files some examples won't run if you open them as...
...windows user, you can get an installer from the python homepage and follow the instructions to install it: go to python.org under the download section, click the link for python "3.xxx". at the bottom of the page, choose the windows x86 executable installer and download it. when it has downloaded, run it. on the first installer page, make sure you check the "add python 3.xxx to
path" checkbox. click install, then click close when the installation has finished. open your command prompt (windows)/ terminal (macos/ linux). to check python is installed, enter the following command: python -v # or you might have the py command available, # in which case try py -v this should return a version number. if this is ok, navigate to the directory that your example ...
...ng pip3 install flask. ...
Dealing with files - Learn web development
eing the file names, because windows has an option called hide extensions for known file types turned on by default. generally, you can turn this off by going to windows explorer, selecting the folder options... option, unchecking the hide extensions for known file types check box, then clicking ok. for more specific information covering your version of windows, you can search on the web. file
paths to make files talk to one another, you have to provide a file
path between them — basically a route, so one file knows where another one is. to demonstrate this, we will insert a little bit of html into our index.html file, and make it display the image you chose in the article "what will your website look like?" copy the image you chose earlier into your images folder. open up your index...
...>my test page</title> </head> <body> <img src="" alt="my test image"> </body> </html> the line <img src="" alt="my test image"> is the html code that inserts an image into the page. we need to tell the html where the image is. the image is inside the images directory, which is in the same directory as index.html. to walk down the file structure from index.html to our image, the file
path we'd need is images/your-image-filename. for example, our image is called firefox-icon.png, so the file
path is images/firefox-icon.png. insert the file
path into your html code between the double quote marks of the src="" code. save your html file, then load it in your web browser (double-click the file). you should see your new webpage displaying your image! some general rules for file p...
...subdirectory/my-image.jpg. to link to a target file in the directory above the invoking html file, write two dots. ...
Creating hyperlinks - Learn web development
nto a link, even block-level elements. if you have an image you want to make into a link, use the <a> element and reference the image file with the <img> element. <a href="https://www.mozilla.org/"> <img src="mozilla-image.png" alt="mozilla logo that links to the mozilla homepage"> </a> note: you'll find out more about using images on the web in a future article. ...
...nto a link, use the <a> element and reference the image file with the <img> element. <a href="https://www.mozilla.org/"> <img src="mozilla-image.png" alt="mozilla logo that links to the mozilla homepage"> </a> note: you'll find out more about using images on the web in a future article. a quick primer on urls and
paths to fully understand link targets, you need to understand urls and file
paths. this section gives you the information you need to achieve this. a url, or uniform resource locator is simply a string of text that defines where something is located on the web. for example, mozilla's english homepage is located at https://www.mozilla.org/. urls use
paths to find files.
paths specify where the file you're interested in is located in the filesystem. let's look at an example o...
...project-brief.pdf, you'd have to go up a directory level, then back down into the pdf directory. to go up a directory, use two dots — .. — so the url you would use is ../pdfs/project-brief.pdf: <p>a link to my <a href="../pdfs/project-brief.pdf">project brief</a>.</p> note: you can combine multiple instances of these features into complex urls, if needed, for example: ../../../complex/
path/to/my/file.html. document fragments it's possible to link to a specific part of an html document, known as a document fragment, rather than just to the top of the document. to do this you first have to assign an id attribute to the element you want to link to. it normally makes sense to link to a specific heading, so this would look something like the following: <h2 id="mailing_address">maili...
Looping code - Learn web development
t ctx = canvas.getcontext('2d'); let width = document.documentelement.clientwidth; let height = document.documentelement.clientheight; canvas.width = width; canvas.height = height; function random(number) { return math.floor(math.random()*number); } function draw() { ctx.clearrect(0,0,width,height); for (let i = 0; i < 100; i++) { ctx.begin
path(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } btn.addeventlistener('click',draw); </script> </body> </html> you don't have to understand all the code for now, but let's look at the part of the code that actually draws the 100 circles: for (let i = 0; i < 100; i++) { ...
... width and height are the width and height of the inner browser window. you should get the basic idea — we are using a loop to run 100 iterations of this code, each one of which dra...
...hould get the basic idea — we are using a loop to run 100 iterations of this code, each one of which draws a circle in a random position on the page. the amount of code needed would be the same whether we were drawing 100 circles, 1000, or 10,000. only one number has to change. if we weren't using a loop here, we'd have to repeat the following code for every circle we wanted to draw: ctx.begin
path(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); this would get very boring and difficult to maintain very quickly. loops really are the best. the standard for loop let's start exploring some specific loop constructs. the first, which you'll use most of the time, is the for loop — this has the following syntax: for (init...
Object building practice - Learn web development
to move them by this much on each frame. color — each ball gets a color. size — each ball gets a size — this is its radius, in pixels. this handles the properties, but what about the methods? we want to get our balls to actually do something in our program. ...
... next, we use fillstyle to define what color we want the shape to be — we set it to our ball's color property. next, we use the arc() method to trace an arc shape on the paper. its parameters are: the x and y position of the arc's center — we are specifying the ball's x and y properties. ...
...umber of degrees around the circle that the arc is drawn between. here we specify 0 degrees, and 2 * pi, which is the equivalent of 360 degrees in radians (annoyingly, you have to specify this in radians). that gives us a complete circle. if you had specified only 1 * pi, you'd get a semi-circle (180 degrees). last of all, we use the fill() method, which basically states "finish drawing the
path we started with begin
path(), and fill the area it takes up with the color we specified earlier in fillstyle." you can start testing your object out already. save the code so far, and load the html file in a browser. open the browser's javascript console, and then refresh the page so that the canvas size changes to the smaller visible viewport that remains when the console opens. type in th...
CSS performance optimization - Learn web development
previous overview: performance next painting an unstyled page, and then repainting it once styles are parsed would be bad user experience. for this reason, css is render blocking, unless the browser knows the css is not currently needed. the browser can paint the page once it has downloaded the css and built the css object model. browsers follow a specific rendering
path: paint only occurs after layout, which occurs after the render tree is created, which in turn requires both the dom and the cssom trees. to optimize the cssom construction, remove unnecessary styles, minify, compress and cache it, and split css not required at page load into additional files to reduce css render blocking. optimizing for render blocking css can scope styles to particular conditions with medi...
...he cssom trees. to optimize the cssom construction, remove unnecessary styles, minify, compress and cache it, and split css not required at page load into additional files to reduce css render blocking. optimizing for render blocking css can scope styles to particular conditions with media queries. media queries are important for a responsive web design and help us optimize a critical rendering
path. the browser blocks rendering until it parses all of these styles but will not block rendering on styles it knows it will not use, such the print stylesheets. by splitting the css into multiple files based on media queries, you can prevent render blocking during download of unused css. to create a non-blocking css link, move the not-immediately used styles, such as print styles, into separate fil...
...operty applied to the @font-face rule, the font-display property defines how font files are loaded and displayed by the browser, allowing text to appear with a fallback font while a font loads, or fails to load. this improves performance by making the text visible instead of having a blank screen, with a trade-off being a flash of unstyled text. @font-face { font-family: somefont; src: url(/
path/to/fonts/somefont.woff) format('woff'); font-weight: 400; font-style: normal; font-display: fallback; } the contain property the contain css property allows an author to indicate that an element and its contents are, as much as possible, independent of the rest of the document tree. this allows the browser to recalculate layout, style, paint, size, or any combination of them for a limited...
Web performance resources - Learn web development
knowing this will help you understand how to improve the performance of the site. using resource hints such as rel=preconnect, rel=dns-prefetch, rel=prefetch, and rel=preload keep the size of javascript to a minimum. only use as much javascript as needed for the current page. ...
... if you do, have a backup plan for seo (e.g render full page for bot traffic); for example, by using the loading attribute on the <img> element it is also crucial to realize what is really important to your users. it might not be absolute timing, but user perception. quick wins css web performance is all about user experience and perceived performance. as we learned in the critical rendering
path document, linking css with a tradional link tag with rel="stylesheet" is synchronous and blocks rendering. optimize the rendering of your page by removing blocking css. to load css asynchronously one can simpy set the media type to print and then change to all once loaded. the following snippet includes an onload attribute, requiring javascript, so it is important to include a noscript tag with ...
...el="stylesheet" is synchronous and blocks rendering. optimize the rendering of your page by removing blocking css. to load css asynchronously one can simpy set the media type to print and then change to all once loaded. the following snippet includes an onload attribute, requiring javascript, so it is important to include a noscript tag with a traditional fallback. <link rel="stylesheet" href="/
path/to/my.css" media="print" onload="this.media='all'"> <noscript><link rel="stylesheet" href="/
path/to/my.css"></noscript> the downside with this approach is the flash of unstyled text (fout.) the simplist way to address this is by inlining css that is required for any content that is rendered above the fold, or what you see in the browser viewport before scrolling. these styles will improve perce...
Command line crash course - Learn web development
tocomplete names that you know are present, rather than having to type out the whole thing. for example, after typing the above two commands, try typing cd d and pressing tab — it should autocomplete the directory name desktop for you, provided it is present in the current directory. bear this in mind as you move forward. if the directory you want to go to is nested deep, you need to know the
path to get to it. this usually becomes easier as you get more familiar with the structure of your file system, but if you are not sure of the
path you can usually figure it out with a combination of the ls command (see below), and by clicking around in your explorer/finder window to see where a directory is, relative to where you currently are. for example, if you wanted to go to a directory called ...
...window to see where a directory is, relative to where you currently are. for example, if you wanted to go to a directory called src, located inside a directory called project, located on the desktop, you could type these three commands to get there from your home folder: cd desktop cd project cd src but this a waste of time — instead, you can type one command, with the different items in the
path separated by forward slashes, just like you do when specifying
paths to images or other assets in css, html, or javascript code: cd desktop/project/src note that including a leading slash on your
path makes the
path absolute, for example /users/your-user-name/desktop. omitting the leading slash like we’ve done above makes the
path relative to the your present working directory. this is exactl...
... might need inside the directory later on, as it will be gone forever. touch — creates a new empty file, inside the current directory. for example, touch mdn-example.md creates a new empty file called mdn-example.md. mv — moves a file from the first specified file location to the second specified file location, for example mv mdn-example.md mdn-example.txt (the locations are written as file
paths). this command moves a file called mdn-example.md in the current directory to a file called mdn-example.txt in the current directory. technically the file is being moved, but from a practical perspective, this command is actually renaming the file. cp — similar in usage to mv, cp creates a copy of the file in the first location specified, in the second location specified. for example, cp mdn-...
Simple SeaMonkey build
properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'. after that all should be well.) open a shell window by running: c:\mozilla-build\start-msvc2013.bat. even if you're on 64-bit windows, do not use the files ending in -x64.bat. by default you will arrive in your windows user home directory which is likely to contain spaces in its
path (e.g. c:\users\myaccount). this can lead to problems later in the building stage. to avoid that, create a directory without spaces in its
path (e.g. mkdir /c/mozilla-src) and switch to it before building (cd /c/mozilla-src). problems? see windows build prerequisites. building seamonkey building seamonkey requires at least 2 gb of disk space and 256 mb of available ram. # get ...
...illa.org/releases/comm-beta/ and comm-beta instead # for release, use https://hg.mozilla.org/releases/comm-release/ and comm-release instead hg clone https://hg.mozilla.org/comm-central/ cd comm-central python client.py checkout # set up a basic .mozconfig file echo 'ac_add_options --enable-application=suite' > .mozconfig # let's build seamonkey... echo 'mk_add_options moz_objdir=/
path/to/comm-central/obj-sm-release' >> .mozconfig # specify amount of parallel building. if the below is left out, a best guess will be taken automatically. echo 'mk_add_options moz_make_flags="-j4"' >> .mozconfig # ...quickly. # build! # note: this requires autoconf 2.13 (at least initially). # on windows, be sure to use mozmake instead of make, otherwise parallel building will...
... # ...quickly. # build! # note: this requires autoconf 2.13 (at least initially). # on windows, be sure to use mozmake instead of make, otherwise parallel building will break. make -f client.mk for a debug build, you need different configuration options in your .mozconfig file. this requires more disk space, about 3 gb, and twice as much available ram. 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. the support for libxul builds is still experimental but it should work if you --disable-mailnews. on window...
pymake
ongly recommended. usage if you use mach for everything, you don't have to worry about gmake and pymake: mach will run whatever is best for the current machine. note: on windows, you must take special care to be able to switch back and forth between gmake and pymake on the same object dir. see gmake vs. pymake for more information. anywhere you would normally type make, instead type python /
path/to/srcdir/build/pymake/make.py. for example: instead of make -f client.mk to start a build, you would type python build/pymake/make.py -f client.mk. to run tests instead of typing make mochitest-plain in the object directory, you would type python ../build/pymake/make.py mochitest-plain. alternately, if you would like to simply type in pymake -f client.mk from within the mingw32 shell. whi...
... you would type python ../build/pymake/make.py mochitest-plain. alternately, if you would like to simply type in pymake -f client.mk from within the mingw32 shell. while in the shell type cd ~ (without quotes). type touch .profile using any appropriate text editor open .profile and add the following line in the file (assuming your mozilla-central is at c:/mozilla-central, if not, adjust your
path accordingly.) alias pymake=c:/mozilla-central/build/pymake/make.py save your .profile edit and close the shell, then restart the shell. try typing just pymake into the shell and press enter. this should come back with "no makefile found." if it does, your pymake alias is connected and you are ready to type in pymake -f client.mk to start the build. unlike gmake on windows, pymake is capable...
...g just pymake into the shell and press enter. this should come back with "no makefile found." if it does, your pymake alias is connected and you are ready to type in pymake -f client.mk to start the build. unlike gmake on windows, pymake is capable of doing parallel builds, so you can set a moz_make_flags=-jn in your .mozconfig without risk of deadlocks. note: on windows, if using an absolute
path moz_objdir in your .mozconfig, it must be a windows-style (i.e. c:/foo/bar) rather than an msys-style (i.e. /c/foo/bar)
path. ...
ESLint
la code-base. these have the prefix mozilla/. more information: outline details of the rules rule source code common issues and how to solve them my editor says that "mozilla/whatever" is unknown run ./mach eslint --setup restart your editor if that doesn't work, check that you have your editor pointing to the correct node_modules folder. ...
...ozilla/. more information: outline details of the rules rule source code common issues and how to solve them my editor says that "mozilla/whatever" is unknown run ./mach eslint --setup restart your editor if that doesn't work, check that you have your editor pointing to the correct node_modules folder. node.js is not recognized add it to your
path environment variable by running
path="$
path:/
path/to/node.js/". for example: in windows 10, if you have installed node.js on "c:\nodejs", then the command should look like: export
path=$
path:/c/nodejs enabling eslint for a new directory remove the directory from .eslintignore (in the base directory of the repository) fix errors that occur when running ./mach eslint
path/to/dir, see also the no-undef rules below. no-undef t...
...* globals mychromeglobal */ or, add to the global section toolkit/.eslintrc.js if it is widely used. foo.jsm exports a symbol, but that is not recognised by eslint check it is listed correctly in tools/lint/eslint/modules.json using services.scriptloader.loadsubscript? you'll need to include the following just above it: /* import-globals-from relative/
path/to/file.js */ do_check_eq, add_task not defined in a test directory. ensure there is a .eslintrc.js file that extends one of: "plugin:mozilla/browser-test" "plugin:mozilla/chrome-test" "plugin:mozilla/mochitest-test" "plugin:mozilla/xpcshell-test" see other test directories for how to do this. i need to test that something isn't defi...
Obsolete Build Caveats and Tips
n documentation for building older versions of the code base or dealing with older build tools. these tips, while helpful, are jarring and superfluous to the majority of new mozilla builders who are mainly interested in building the latest version of firefox. therefore, instead of deleting all these nuggets of information, it's best to collect them all here and remove them from the majority happy
path documentation. each piece of information should mention the page and the section it originally came from. you can copy in the original text and bold out what has been removed. obsolete caveats and tips from simple_firefox_build install a version of visual studio that supports c++ development: vs 2012 for windows desktop pro or express (free), or vc++ 2010 pro or express (free), or vc++ 2008 pr...
...d_options --with-windows-version=502 to your .mozconfig. for mozilla-1.9.1 and mozilla-1.9.0, you need to add ac_add_options --disable-vista-sdk-requirements to your .mozconfig instead. unsupported sdks the windows sdk for windows server 2008 is not supported, and has been found to cause the following problems: breaks the vcvars32.bat file from visual studio 2008 no longer sets the correct
path for the .net framework causes an invalid
path which breaks the mozilla build if you have the windows server 2008 sdk installed, uninstall it. the sdk will break builds even if you try to use other sdks. other possible workarounds: use another sdk (the one shipped with visual studio 9). delete the vcvars32.bat file and repair your visual studio installation with the setup program. edit vc...
...mail,calendar,suite,xulrunner". this setting is ignored by most mozilla project branches, which now use mercurial instead of cvs for source control. note: starting in gecko 2.0, objdir builds are enabled by default. if you do not specify a moz_objdir it will be automatically set to @topsrcdir@/obj-@config_guess@ alternatively, you can run client.mk directly from your objdir, using make -f <
path_to_srcdir>/client.mk. note: starting in gecko 5.0, if you don't specify an application, --enable-application=browser is assumed, thereby building firefox. ...
OSFile.jsm
ing, or because the code that requires file i/o is already executed on a worker thread. for this reason, api clients can also spawn their own worker threads and make use of os.file directly from these threads. ...
...de that requires file i/o is already executed on a worker thread. for this reason, api clients can also spawn their own worker threads and make use of os.file directly from these threads. ...
...i/o is already executed on a worker thread. for this reason, api clients can also spawn their own worker threads and make use of os.file directly from these threads. ...
PromiseWorker.jsm
and the answer is, whenever you would normally use a chromeworker, but want postmessage to return promises. the promiseworker object is used to deliver all of the os.file functionality to the main thread. here is the test case from firefox codebase: mozilla dxr :: test_promise.js. promiseworker module consists of two javascript files, promiseworker.jsm and promiseworker.js. promiseworker.jsm
path: resource://gre/modules/promiseworker.jsm a javascript code module used by the main thread to create a worker thread and communicate with it. promiseworker.jsm provides basepromiseworker. promiseworker.js
path: resource://gre/modules/workers/promiseworker.js a javascript file used by the worker thread, which is created by promiseworker.jsm in main thread, to communicate with the main thread. ...
...e four methods (dispatch, postmessage, close, and log). but you can instantiate abstractworker itself and set its properties later, instead of creating derived class. main thread file the basepromiseworker object needs to be imported: const { utils: cu } = components; const { basepromiseworker } = cu.import('resource://gre/modules/promiseworker.jsm', {}); let myworker = new basepromiseworker('
path_to_worker_file.js'); you're now ready to start using promiseworker. sending a message from main thread to send a message to a worker from the main thread, one normally uses postmessage(). for promiseworker objects, however, you can't do that. instead, use the post() method, as seen below. post syntax promise = myworker.post(afunctionname, aargs, aclosure, atransferlist); parameters ...
...r argument of: `' + shouldresolve + '`'; } else { throw new error('you passed in a non-true value for shouldresolve argument and therefore this will reject the main thread promise'); } } main thread file bootstrap.js const { utils: cu } = components; const { basepromiseworker } = cu.import('resource://gre/modules/promiseworker.jsm', {}); var myworker = new basepromiseworker('chrome://
path/to/content/myworker.js'); var promise_domyfunctrue = myworker.post('resolvetest', [true]); promise_domyfunctrue.then( function(aval) { console.log('fullfilled - promise_domyfunctrue - ', aval); }, function(areason) { console.error('rejected - promise_domyfunctrue - ', areason); } ).catch( function(acaught) { console.error('caught - promise_domyfunctrue...
Task.jsm
!!" // the result is undefined if no special task.result exception was thrown. }, function (exception) { // failure! we can inspect or report the exception. ...
...the result is undefined if no special task.result exception was thrown. }, function (exception) { // failure! we can inspect or report the exception. ...
...tion (exception) { // failure! we can inspect or report the exception. }); exception handling components.utils.import("resource://gre/modules/osfile.jsm") components.utils.import("resource://gre/modules/task.jsm") task.spawn(function* () { let currentdir = yield os.file.getcurrentdirectory(); let
path = os.
path.join(currentdir, ".mozconfig"); try { let info = yield os.file.stat(
path); console.log("the .mozconfig file is " + info.size + " bytes long."); } catch (ex if ex instanceof os.file.error && ex.becausenosuchfile) { console.log("you don't have .mozconfig in " + currentdir); } }).then(null, components.utils.reporterror); in this example, if the promise returned by os.file.stat is rejected, an exception is thrown inside the task. if the reason for the excepti...
XPCOMUtils.jsm
methods definelazygetter() getter functions in javascript give you a way to define a property of an object, bu...
...nts nsistreamconverter: mycomponent.prototype = { queryinterface: xpcomutils.generateqi([ components.interfaces.nsirequestobserver, components.interfaces.nsistreamlistener, components.interfaces.nsistreamconverter, ]), // ...methods... } importrelative() imports a javascript code module given the calling javascript code module's global object (you should specify this) and a
path relative to that module. this lets modules bundled in a package load one another without having to hard-code full
paths. void importrelative( that,
path, scope ); parameters that the javascript object of the calling javascript code module's global scope. you should simply pass this.
path the relative
path of the javascript code module to import. scope an optional object to import...
...tor itersimpleenumerator( enumerator, interface ); parameters enumerator the nsisimpleenumerator instance to iterate over. interface the expected interface for each element. return value a generator yielding enumerated objects. example const nsifile = components.interfaces.nsifile; for (var file in xpcomutils.itersimpleenumerator(dir.directoryentries, nsifile)) console.log(file.
path); iterstringenumerator() wraps an nsistringenumerator or nsiutf8stringenumerator instance into a javascript generator that can be easily iterated over. generator iterstringenumerator( enumerator ); parameters enumerator the nsistringenumerator or nsiutf8stringenumerator instance to iterate over. return value a generator yielding enumerated strings. example for (var section in xpc...
Creating localizable web applications
le, you may want to provide a way of overriding the autodetection. you can achieve this by setting a cookie when the user changes the locale with the language dropdown, or by looking for locale code in the url. the latter involves rewriting the urls to include the locale code and rewriting apache's aliases to handle locale in urls. you can put the locale code as the top-most element of the url's
path (e.g. http://example.com/foo/bar) or on its end (e.g. http://example.com/foo/bar/en-us). avoid using it in a subdomain, as it can cause problems with certificates (this is wrong: http://en-us.example.com/foo/bar). simplify localized versions if necessary oftentimes, it is better to slightly simplify the localized version of your web application than to serve a mix of localized and english conte...
...times, when the urls are well-designed, you may want to use the url to do something in the code depending on where the user is. take the url structure of the getpersonas.com website for example. the url http://getpersonas.com/nature/popular/2 points to the second page of the listing of the popular personas in the "nature" category. you could easily use list($category, $tab, $page) = explode('/', $
path); to get this information directly from the url. after that, it is tempting to use the $category or $tab variables in the interface. however, this is problematic for localization. you probably don't want to localize the urls to keep them uniform across locales as well as to avoid issues with non-latin and/or rtl characters. so in order to display a localized label of a category or a tab, you sho...
...d the localizable english strings used in the interface. consider the following example: snippet 1. good: $tab_labels = array( "popular" => _('popular'), "recent" => _('recent'), "all" => _('all'), "my" => _('my'), "favorites" => _('favorites') ); list($category, $tab, $page) = explode('/', $
path); if ($tab == 'popular') { // $tab is always english // .... echo $tab_labels($tab); // this will display the translation } indicate the language of the pages you link to indicate the language of the pages you link to if it is different from the user's current language. for english, add hreflang="en" to links to resources that are not going to be localized or are external t...
Extras
style="stop-color:rgb(255,0,0); stop-opacity:.8;"/> </radialgradient> </defs> <g transform="translate(15,15)"> <g> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="360" to="0" dur="15s" repeatcount="indefinite"/> <g transform="translate(-15, -15)"> <
path fill="url(#radgrad1)" d="m 15 0 l 20 10 l 30 15 l 20 20 l 15 30 l 10 20 l 0 15 l 10 10"/> </g> </g> </g> </svg> </mtext> </mpadded> </msqrt> <mo>=</mo> <msubsup> <mo>∫</mo> <mn>0</mn> <mfrac> <mi>π</mi> <mn>2</mn> </mfrac> </msubsup> <msup> <mi>θ</mi> <mtext> <svg width="15px" height="15px"> <defs> <radialgradient id="radgrad2" cx="50%" cy="50%" ...
...bsup> <msup> <mi>θ</mi> <mtext> <svg width="15px" height="15px"> <defs> <radialgradient id="radgrad2" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:.9;"/> </radialgradient> </defs> <g> <animatemotion
path="m0,0 l3,0 l2,5 l5,5 l0,4 l5,2 z" begin="0s" dur="0.5s" repeatcount="indefinite"/> <circle fill="url(#radgrad2)" r="5px" cx="5px" cy="5px"/> </g> </svg> </mtext> </msup> <mrow> <mo>ⅆ</mo> <mi>θ</mi> </mrow> </math> <div style="width: 300px; margin-left: auto; margin-right: auto;"> <svg width="300px" height="250px"> <defs> <lineargradient id="grad1" x1="0%" y1="0%" x2=...
...tensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <mo>(</mo> <mtable> <mtr> <mtd><mi>cos</mi><mi>θ</mi></mtd> <mtd><mo>−</mo><mi>sin</mi><mi>θ</mi></mtd> </mtr> <mtr> <mtd><mi>sin</mi><mi>θ</mi></mtd> <mtd><mi>cos</mi><mi>θ</mi></mtd> </mtr> </mtable> <mo>)</mo> </mrow> </math> </foreignobject> <text>rotation matrix</text> </switch> </g></g></g> <g> <animatemotion
path="m 32,69 c 64,121 100,27 152,42 203,56 239,257 275,161 295,109 144,221 88,214 -2,202 11,35 32,69 z" begin="0s" dur="20s" repeatcount="indefinite"/> <animatetransform attributename="transform" attributetype="xml" type="scale" values="1;2;.5;1" keytimes="0;.25;.75;1" dur="20s" repeatcount="indefinite"/> <circle fill="url(#grad3)" ...
GC and CC logs
ess firefox, you can't record logs from the content process, due to sandboxing. you'll need to disable sandboxing by setting moz_disable_content_sandbox=t when you run firefox. from the commandline tldr: if you just want shutdown gc/cc logs to debug leaks that happen in our automated tests, you probably want something along the lines of: moz_disable_content_sandbox=t moz_cc_log_directory=/full/
path/to/log/directory/ moz_cc_log_shutdown=1 moz_cc_all_traces=shutdown ./mach ... as noted in the previous section, with multiprocess firefox, you can't record logs from the content process, due to sandboxing. you'll need to disable sandboxing by setting moz_disable_content_sandbox=t when you run firefox. on desktop firefox you can override the default location of the log files by setting the moz...
... default location of the log files by setting the moz_cc_log_directory environment variable. by default, they go to a temporary directory which differs per os - it's /tmp/ on linux/bsd, $localappdata\temp\ on windows, and somewhere in /var/folders/ on mac (whatever the directory service returns for tmpd/ns_os_temp_dir). note that just moz_cc_log_directory=. won't work - you need to specify a full
path. on firefox for android you can use the cc-dump extension to save the files to /sdcard. by default, the file is created in some temp directory, and the
path to the file is printed to the error console. to log every cycle collection, set the moz_cc_log_all environment variable. to log only shutdown collections, set moz_cc_log_shutdown. to make all ccs verbose, set moz_cc_all_traces to "all", or t...
..."] = os.environ["moz_upload_dir"] browserenv["moz_cc_log_shutdown"] = "1" analyzing gc and cc logs there are numerous scripts that analyze gc and cc logs on github. to find out why an object is being kept alive, the relevant scripts are find_roots.py and parse_cc_graph.py (which is called by find_roots.py). calling find_roots.py on a cc log with a specific object or kind of object will produce
paths from rooting objects to the specified objects. most big leaks include an nsglobalwindow, so that's a good class to try if you don't have any better idea. to fix a leak, the next step is to figure out why the rooting object is alive. for a c++ object, you need to figure out where the missing references are from. for a js object, you need to figure out why the js object is reachable from a js roo...
Profiling with the Firefox Profiler
ich are spent in pvsync::msg_notify and all child functions that it calls. it is useful to scan down the "running time" column and look for when the time changes. while looking for performance problems, you're looking for the processes that are taking the most time; then you can figure out how to optimize them. common performance bugs in firefox inefficient code that is on the reflow or restyle
paths is often to blame for jank. so is code that is run often in the parent process or in parts of the codebase that apply to many users. synchronous re-flow can be caused by js that, for example, makes changes to the page content in a loop and queries about the layout of the page in that same loop. a presshell:flush means that we are either recomputing styles or recomputing layout. these sorts of ...
... see remote profiling on android for details. the following information is old version of firefox for android. for local builds of fennec, you should build with optimization and strip_flags="--strip-debug" but not with --enable-profiling. nightly builds are already built with the appropriate flags. you'll need to have adb and arm-eabi-addr2line (which is part of the android ndk) in your bash
path, so use locate arm-eabi-addr2line (on linux) or mdfind name:arm-eabi-addr2line (on os x) and stick an export to its location in ~/.bash_profile. the extension will invoke bash to use adb and addr2line. install the latest pre-release build in your host machine's firefox browser that has your phone reachable via adb. this will add a icon in the top right of the browser. set devtools.debugger.remo...
...hare..." and "save as file..." buttons in the top-right of the window. sharing will upload your profile to profiler.firefox.com and make it public. more information on sharing profiles is available. profiling a hung process it is possible to get profiles from hung firefox processes using lldb1. after the process has hung, attach lldb. type in2, : p (void)profiler_save_profile_to_file("some
path/profile.txt") clone mstange’s handy profile analysis repository. run: python symbolicate_profile.py some
path/profile.txt to graft symbols into the profile. mstange’s scripts do some fairly clever things to get those symbols – if your firefox was built by mozilla, then it will retrieve the symbols from the mozilla symbol server. if you built firefox yourself, it will attempt to use ...
Profile Manager
6.10, while profileb might be linked with a copy of firefox 3.5.3. when launched, profile manager will look in some default locations for installed versions of firefox (or other application you're using profile manager with). ...
...operties:
path, version, and default. the default property indicates that this version of firefox will be used with profiles that don't have a specific application version associated with them. creating a profile to create a new profile, just click the new button from profile manager's toolbar. a dialog will appear that allows you to specify the profile's name, and optionally the profile's
path, and the version of firefox (or other application) that will be used with this profile: launching firefox with a profile to launch firefox with a specific profile, select the profile in the main window, and hit the "start firefox" button: firefox will be launched with that profile, and profile manager will terminate. the version of firefox which will be launched is indicated in the "fir...
...r the name of the profile you'd like to create from the archive. other operations context-clicking any profile in the profile list will cause a popup menu to appear with the following commands: copy - makes a copy of the profile using a name and location of your choice. delete - deletes the profile, and all files associated with it. properties - shows a dialog that displays the profile's
path and last-modified date. rename - allows you to specify a new name for the profile. version - allows you change the default application version to be used with the profile. future enhancements ability to install/uninstall/enable/disable extensions in profiles. ability to copy certain assets (e.g., bookmarks) between profiles. add 'profile size' to the properties dialog. ability to rese...
I/O Functions
this chapter describes the nspr functions used to perform operations such as system access, normal file i/o, and socket (network) i/o. for sample code that illustrates basic i/o operations, see introduction to nspr. for information about the types most commonly used with the functions described in this chapter, see i/o types. ...
...ost commonly used with the functions described in this chapter, see i/o types. functions that operate on
pathnames functions that act on file descriptors directory i/o functions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers functions that operate on
pathnames a file or directory in a file system is specified by its
pathname. nspr uses unix-style
pathnames, which are null-terminated character strings. only the ascii character set is supported. the forward slash (/) separates the directories in a
pathname. ...
... some file systems also differentiate drives or volumes. ...
4.3 Release Notes
release date: 01 april 2009 introduction network security services for java (jss) 4.3 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate
path validation library pkcs11 needslogin method support hmacsha256, hmacsha384, and hmacsha512 support for all nss 3.12 initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. ...
...2 support for all nss 3.12 initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. new in jss 4.3 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. ...
...ere implemented in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory
path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type. ...
NSS Sample Code Sample_2_Initialization of NSS
program demonstrates how to initialize the nss database. this program illustrates password handling. ...
...d.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 <dbdir
path> [-p <plainpasswc>]" " [-f <passwdffile>]\n\n", progname); fprintf(stderr, "%-15s specify a db directory
path\n\n", "-d <dbdir
path>"); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p <plainpasswc>"); fprintf(stderr, "%-15s specify a password file\n\n", "-f <plainpasswc>"); exit(-1); } /* initialize the slot password */ char *initslotpassword(pk11slotinfo *slot, prbool retry, void *arg) { file *input; file *output; char...
...ass, 0, pwfile, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed to change password\n"); } if (slot) { pk11_freeslot(slot); } rvshutdown = nss_shutdown(); if (rvshutdown != secsuccess) { pr_fprintf(pr_stderr, "failed : nss_shutdown()\n"); rv = secfailure; } pr_cleanup(); return rv; } </plainpasswc></plainpasswc></dbdir
path></passwdffile></plainpasswc></dbdir
path></pk11func.h></nss.h></prprf.h></plgetopt.h></prthread.h> ...
Setting up an update server
those locations. now that you have a build of firefox capable of using a locally-built mar, it's time to build the mar. first, build firefox the way you want it to be after updating. if you want it to be the same before and after updating, this step is unnecessary and you can use the same build that you used to create the installation. ...
...nnecessary and you can use the same build that you used to create the installation. then run these commands, substituting <obj dir>, <mar output
path>, <version> and <channel> appropriately: ./mach package touch "<obj dir>/dist/firefox/precomplete" mar="<obj dir>/dist/host/bin/mar.exe" moz_product_version=<version> mar_channel_id=<channel> ./tools/update-packaging/make_full_update.sh <mar output
path> "<obj dir>/dist/firefox" for a local build, <channel> can be default, and <version> can be the value from browser/config/version.txt (or something arbitrarily large like 2000.0a1). note: it can be a bit tricky to get the make_full_update.sh script to accept
paths with spaces. serving the update preparing the update files first, create the directory that updates will be served from and pu...
...ou created earlier. installing the update you may want to start by deleting any pending updates to ensure that no previously found updates interfere with installing the desired update. you can use this command with firefox's browser console to determine the update directory: const {fileutils} = chromeutils.import("resource://gre/modules/fileutils.jsm"); fileutils.getdir("updrootd", [], false).
path once you have determined the update directory, close firefox, browse to the directory and remove the subdirectory called updates. next, you need to change the update url to point to the local xml file. this can be done most reliably with an enterprise policy. the policy file location depends on the operating system you are using. windows/linux: <install dir>/distribution/policies.json macos: ...
Signing Mozilla apps for Mac OS X
gn; this command-line application is used to add a signature to an application bundle. the man page for codesign is available online, or you can simply type "man codesign" in a terminal window. the main options of note are: -s your-signing-identity lets you specify the signing certificate you want to sign the application with your-signing-identity is the name of your certificate. ...
...window. the main options of note are: -s your-signing-identity lets you specify the signing certificate you want to sign the application with your-signing-identity is the name of your certificate. --keychain /
path/to/keychain lets you specify which keychain contains the signing certificate specified by your-signing-identity, rather than allowing the codesign to search the keychain list. the
path specified must be a full
path; it's usually something similar to /users/username/library/keychains/keychain-name.keychain. --resource-rules /
path/to/coderesources specifies a file to use when generating the rules to be applied to the code signing. when you're signing mozilla applications with v1 signatures, you'll need to specify a custom coderesources file here. -f forces codesign to overwri...
... info.plist file. leaf[subject.ou]: this needs to be the subject ou of your developer id. you can find it by running this command in the terminal: openssl x509 -text -noout -inform der -in devloperid_application.cer | grep subject putting it all together, you'll wind up using a command similar to the one below to sign your app. you'll of course need to change the signing id, keychain, bundle
path, and requirements. codesign -s mac-testing -fv \ --keychain /users/user/library/keychains/mykeychain.keychain \ --resource-rules ./application.app/contents/_codesignature/coderesources \ --requirements '=designated => identifier "org.you.yourapp" and ( (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9] ) or (anchor apple generic and certificate ...
Accessing the Windows Registry Using XPCOM
) to get an object implementing this interface, not getservice(). second, you must call open() on the key before attempting to read a value. notice in the open() call that the root key to use is specified using the named constants available on the nsiwindowsregkey interface, in this case root_key_local_machine, which corresponds to hkey_local_machine in the windows registry. also notice that the
path to the key has backslashes escaped, a necessity in javascript and c++ string constants. the desired access rights are specified using a named constant from the interface, in this example access_read. this can be very important when dealing with non-administrator accounts with restricted privileges. the value is read using readstringvalue(). you have to specify what type of data you expect to re...
...of these methods take a root key as the first parameter. from javascript, you will want to use the named constants on the interface for this parameter. they are: root_key_classes_root — corresponds to hkey_classes_root root_key_current_user — corresponds to hkey_current_user root_key_local_machine — corresponds to hkey_local_machine the second parameter for open() and create() is the
path to the key. as noted in the example above, you will need to escape backslashes within the string. the third parameter for open() and create() is the access mode. it is specified as a bitwise combination of flags defined on the interface. you can read the interface documentation for a full explanation, but we will show only the three most commonly used modes here: access_read — for reading v...
...modes here: access_read — for reading values, enumerating keys, and receiving notifications access_write — for setting values and creating sub keys access_all — access for all operations in addition to open() and create(), there are the openchild() and createchild() methods. you can call these methods on an already-opened registry key to open a child key. both methods take a relative
path and access mode as parameters and return a new object implementing nsiwindowsregkey. here's the simple example again, but using openchild(): var wrk = components.classes["@mozilla.org/windows-registry-key;1"] .createinstance(components.interfaces.nsiwindowsregkey); wrk.open(wrk.root_key_local_machine, "software\\microsoft", wrk.access_read); var subkey = wrk...
Using XPCOM Components
xpconnect allows interface methods defined via xpidl to be called from javascript, as part of javascript objects that represent instances of components like the co...
...i added |pr_false| as a fourth parameter because the interface seems to require it: http://lxr.mozilla.org/mozilla/source/netwerk/cookie/public/nsicookiemanager.idl#64 this problem also appears in the javascript version below, and i've added |false| as a fourth p...
...owpolicyfield = false; while (enumerator.hasmoreelements()) { var nextcookie = enumerator.getnext(); nextcookie = nextcookie.queryinterface(components.interfaces.nsicookie); /* .... */ } function finalizecookiedeletions() { for (var c=0; c<deletedcookies.length; c++) { cmgr.remove(deletedcookies[c].host, deletedcookies[c].name, deletedcookies[c].
path, false); } deletedcookies.length = 0; } xxx: in the original document, there were only the first three parameters to the |remove| call. i added |false| as a fourth parameter because the interface seems to require it: http://lxr.mozilla.org/mozilla/source/netwerk/cookie/public/nsicookiemanager.idl#64 this problem also appears in the c++ version above, and i've added |pr_false...
nsLocalFile
« xpcom api reference summary a component implementing nsilocalfile. ...
...e. class id 2e23e220-60be-11d3-8c4a-000064657374 contractid @mozilla.org/file/local;1 supported interfaces nsilocalfile, nsifile remarks this component should be accessed via the xpcom component manager. ...
... class id 2e23e220-60be-11d3-8c4a-000064657374 contractid @mozilla.org/file/local;1 supported interfaces nsilocalfile, nsifile remarks this component should be accessed via the xpcom component manager. ...
NS_NewNativeLocalFile
« xpcom api reference summary the ns_newnativelocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file
path. #include "nsxpcom.h" #include "nsilocalfile.h" nsresult ns_newnativelocalfile( const nsacstring& a
path, prbool afollowlinks, nsilocalfile** aresult ); parameters a
path [in] a string object that specifies an absolute filesystem
path. this string should be encoded using ascii or the multibyte character coding corresponding to the native filesystem. this
path does not need to reference an existing file. it is an error to pass a relative filesystem
path. afollowlinks [in] this attribute will determine if the nsilocalfile instance will automatically resolve symbolic links. this parameter has no effect o...
...s no effect on unix systems. on windows, passing true causes shortcuts to be automatically resolved, and on macos, passing true causes finder aliases to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newnativelocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_
path indicates that the specified
path is invalid. this error is returned if a relative file
path is passed to ns_newnativelocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. if you use this function on windows 2000 or later, you would not be able to handle file names containing characters outside the default code page even though the os h...
...s_newnativelocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. if you use this function on windows 2000 or later, you would not be able to handle file names containing characters outside the default code page even though the os has no problem dealing with them. do not use this function (on windows) unless it is guaranteed that the full
path involved is always ascii. example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newnativelocalfile(nsembedcstring("c:\\foo.txt"), pr_false, getter_addrefs(file)); if (ns_failed(rv)) return rv; here, nsembedcstring is used to convert the ascii string literal to an object that can be passed as a const nsacst...
nsICommandLine
ents from the command line; this is typically done once those arguments have been handled. void removearguments( in long astart, in long aend ); parameters astart the index to the first argument to remove from the command line; this is 0-based, and the name of the application is not included. aend the index to the last argument to remove from the command line. resolvefile() resolves a file-
path argument into an nsifile object. this method gracefully handles relative or absolute file
paths, according to the working directory of this command line. nsifile resolvefile( in astring aargument ); parameters aargument the command-line argument to resolve. return value the file
path as an nsifile. resolveuri() resolves a uri argument into a uri. this method has platform-specific logic for c...
...nsiuri resolveuri( in astring aargument ); parameters aargument the command-line argument to resolve. return value a platform-specific uri. ...
...working directory of this command line. nsifile resolvefile( in astring aargument ); parameters aargument the command-line argument to resolve. return value the file
path as an nsifile. resolveuri() resolves a uri argument into a uri. this method has platform-specific logic for converting an absolute uri or a relative file-
path into the appropriate uri object; it gracefully handles win32 c:\
paths which would confuse the i/o service if passed directly. nsiuri resolveuri( in astring aargument ); parameters aargument the command-line argument to resolve. return value a platform-specific uri. see also sample js component that implements a command-line flag. ...
nsICryptoHash
cates that init() or initwithstring() has not been called. example computing the hash of a file you can easily compute the hash of a file using nsicryptohash. you will need to create an instance of nsicryptohash, open an input stream from a file, and then update the hash with the file. ...
...need to create an instance of nsicryptohash, open an input stream from a file, and then update the hash with the file. ...
...to create an instance of nsicryptohash, open an input stream from a file, and then update the hash with the file. ...
nsILoginManager
which login saving is disabled. void getalldisabledhosts( [optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames ); parameters count the number of elements in the returned array. javascript callers can simply use the array's length property and supply a dummy argument for this parameter. hostnames an array of hostname strings in url format without a
pathname. for example: "https://www.site.com". example you can call this method from javascript like this: var disabledhosts = myloginmgr.getalldisabledhosts({}); getalllogins() returns an array containing all logins recorded by the login manager. if you just want to see if any logins are stored, use countlogins() instead. it's more efficient, and avoids the possibility of the user being prom...
...ins the login manager has on record. example you can call this method from javascript like this: var logins = myloginmgr.getalllogins({}); getloginsavingenabled() reports whether or not saving login information is enabled for a host. boolean getloginsavingenabled( in astring ahost ); parameters ahost the hostname to check. this argument should be in the origin url format, with no
pathname. for example: "https://www.site.com". return value true if login saving is enabled for the host, otherwise false. modifylogin() modifies an existing login by replacing it with a new one. if newlogindata is a nsilogininfo, all of the old login's nsilogininfo properties are changed to the values from newlogindata (but the old login's nsiloginmetainfo properties are unmodified). if newlog...
...nabled() enables or disables storing logins for a specified host. when login storing is disabled, the login manager won't prompt the user to store logins for that host. existing logins are not affected. void setloginsavingenabled( in astring ahost, in boolean isenabled ); parameters ahost the hostname to adjust the setting for. this argument should be in the origin url format, with no
pathname. for example: "https://www.site.com". isenabled if true, login saving is enabled for the specified host. if false, login saving is disabled. see also nsilogininfo using nsiloginmanager ...
nsIMsgIncomingServer
name, in acstring newname); void performbiff(in nsimsgwindow amsgwindow); void performexpand(in nsimsgwindow amsgwindow); void removefiles(); void setboolattribute(in string name, in boolean value); void setboolvalue(in string attr, in boolean value); void setcharattribute(in string name, in acstring value); void setcharvalue(in string attr, in acstring value); void setdefaultlocal
path(in nsilocalfile adefaultlocal
path); void setfilevalue(in string relpref, in string abspref, in nsilocalfile avalue); void setfilterlist(in nsimsgfilterlist afilterlist); void setintattribute(in string name, in long value); void setintvalue(in string attr, in long value); void setunicharattribute(in string name, in astring value); void setunicharvalue(in string attr, in astring value);...
...settings nsimsgdownloadsettings emptytrashonexit boolean filterscope nsmsgsearchscopevalue read only. hostname acstring hostname of the server. incomingduplicateaction long isdeferredto boolean read only. issecure boolean issecureserver boolean read only. key acstring internal pref key - guaranteed to be unique across all servers. limitofflinemessagesize boolean local
path nsilocalfile localstoretype acstring the schema for the local mail store, such as "mailbox", "imap", or "news" used to construct uris. read only. loginatstartup boolean logonfallback boolean maxmessagesize long offlinesupportlevel long password acstring passwordpromptrequired boolean if the password for the server is available either via authentication in the current sess...
...void setcharattribute( in string name, in acstring value ); parameters name missing description value missing description exceptions thrown missing exception missing description setcharvalue() void setcharvalue( in string attr, in acstring value ); parameters attr missing description value missing description exceptions thrown missing exception missing description setdefaultlocal
path() void setdefaultlocal
path( in nsilocalfile adefaultlocal
path ); parameters adefaultlocal
path missing description exceptions thrown missing exception missing description setfilevalue() void setfilevalue( in string relpref, in string abspref, in nsilocalfile avalue ); parameters relpref missing description abspref missing description avalue missing description exceptions thrown mi...
nsIToolkitProfileService
ble to access the toolkit profile service. to access the built-in profile manager in versions of firefox up to 4.0 and thunderbird up to 3.3 you can launch with the -profilemanager command line flag. future versions will require the separate profile manager application. ...
...this will always return 0, 1, or 2; if there are more than 2 profiles, 2 is always returned. read only. ...
... an error occurred writing the profile list file to disk. getprofilebyname() gets a profile, given the profile's name. nsitoolkitprofile getprofilebyname( in autf8string aname ); parameters aname the profile name to find. return value an nsitoolkitprofile object describing the specified profile. exceptions thrown ns_error_failure no matching profile was found. lockprofile
path() locks an arbitrary
path as a profile. if the
path does not exist, it is created and the defaults copied from the application directory. nsiprofilelock lockprofile
path( in nsilocalfile adirectory, in nsilocalfile atempdirectory ); parameters adirectory the directory to lock as a profile directory. atempdirectory the directory to lock as a profile temporary directory. retur...
Troubleshooting XPCOM components registration
ry components on the mozilla trunk (firefox 3, xulrunner 1.9), components that fail to load will print an error to the error console. chrome errors must be enabled. if the error appears, you can use nspr logging to see additional information about the failure by running firefox from a command prompt: rem close all firefox windows! set nspr_log_modules=nsnativemoduleloader:5 set nspr_log_file=c:\
path\to\logfile "c:\program files\mozilla firefox\firefox.exe" examining this log for warning and errors may provide valuable clues why the component failed to load. if using firefox 4 / xulrunner 2.0, make sure that your extension is unpacked and you declared the binary component in your chrome.manifest. see xpcom changes in gecko 2.0 parsing errors in javascript components the most common reaso...
...e libraries for the other files it loads. if you compiled the component with msvc 8.0 (2005) and are attempting to use it on a windows xp machine or later, it will need a manifest embedded to find the runtime. please refer to msdn for details. if you have the option, you can manually copy these dependencies to firefox.exe's directory, to windows\system32, or to any directory is the system's
path. a google groups thread on the matter is located here. the dllmain code that msvc 8 (and probably earlier versions too) generates for you doesn't need to be there, you can remove it. you may be able build your component using use_static_libs=1 in order to remove c runtime library dependencies. linux-specific hints check if you have missing dependent libraries: from your f...
...de that msvc 8 (and probably earlier versions too) generates for you doesn't need to be there, you can remove it. you may be able build your component using use_static_libs=1 in order to remove c runtime library dependencies. linux-specific hints check if you have missing dependent libraries: from your firefox (/xulrunner) install directory, run "./run-mozilla.sh `which ldd` -r
path/to/your/component.so". there should be no "not found" entries and no undefined symbols. (the -r switch from gnu ldd lists function relocations; adjust as suitable for your version) trace shared library loading by setting the environment variable ld_debug=all while launching firefox (see `man ld.so` for details). use strace to see if firefox is trying to load your components. pass the -wl,...
Using js-ctypes
is a library object that you use to declare functions and data types for use with the loaded library. note: js-ctypes only works with c libraries; you can't use c++ methods directly. instead, you'll need to create a shim library that uses c functions that then call into the c++ library for you. examples can be found here: bugzilla :: bug 505907 - support c++ calling from jsctypes library search
paths if you specify a full
path, that
path is used to load the library. otherwise, the system looks for the library in its standard locations. windows on windows, the following locations are searched for the library, in this order: the application's directory. the system directory. the 16-bit system directory. the windows directory. the current working directory the directories listed in t...
... note: this information comes from this article on msdn. after you're done when you're finished using a library, you should close it by calling the library object's close() method: lib.close(); if you fail to close the library, it will be automatically closed when it is garbage collected. using the library you may need to declare new types. ...
...r mb_ok = 0; var ret = msgbox(0, "hello world", "title", mb_ok); lib.close(); in line 3, the user32.dll system library is loaded. line 6 declares msgbox() to be a method that calls the windows function messageboxw. line 15 calls the msgbox() routine, which displays the alert. the last thing we do is call lib.close() to close the library when we're done using it. instead of defining the whole
path, you may also just give the file name. about declaring the function how we knew how to declare the function was by going to msdn site and looking at the messagebox (messageboxw is just a unicode version of same function) function. also learn about the lib.declare function used here: lib.declare. learn about the data types used here: data types. we see that it needs to be defined like this: int...
Plug-in Development Overview - Plugins
e plug-in can select one of these transmission modes: normal mode: the browser sends the stream data sequentially to the plug-in as the data becomes available. random-access mode: the browser allows the plug-in to request specific ranges of bytes from anywhere in the stream. this mode requires server support. file mode: the browser saves the data to a local file in cache and passes that file
path to the plug-in. streams produced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse. in the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it,...
...indows installation using the registry on windows, plug-ins should be installed to a plug-in-specific directory such as c:\program files\plugin name\nppluginname.dll. ...
... using the registry on windows, plug-ins should be installed to a plug-in-specific directory such as c:\program files\plugin name\nppluginname.dll. ...
Migrating from Firebug - Firefox Developer Tools
node and clicking edit html... in the context menu. in the devtools this option is also available via the context menu. there the option is called edit as html. only the live preview of changes is currently missing, which is tracked in bug 1067318 and bug 815464. copy html and related information firebug's html panel allows to copy the inner and outer html of an element as well as the css and x
path to it via the context menu of an element. the page inspector provides the same functionality except copying x
paths. this is covered by bug 987877. edit css both tools allow to view and edit the css rules related to the element selected within the node view in a similar way. firebug has a style side panel for this, the devtools have a rules side panel. in firebug you add new rules by right-clic...
...he break on mutate button, or individually for each element and for different types of changes like attribute changes, content changes or element removal. unfortunately, the devtools do not have this feature yet (see bug 1004678). to stop the script execution there, you need to set a breakpoint on the line with the modification within the debugger panel. search for elements via css selectors or x
paths firebug allows to search for elements within the html panel via css selectors or x
paths. also the devtools' inspector panel allows to search for css selectors. it even displays a list with matching ids or classes. searching by x
paths is not supported though (see bug 963933. debugger what's the script panel in firebug, is the debugger panel in the devtools. both allow you to debug javascript c...
... but also other kinds of storages like the local and session storage, the cache and indexeddb databases. inspect cookies all cookies related to a website are listed inside the cookies panel in firebug. inside the devtools, the cookies are grouped by domain under the cookies section within the storage inspector. both show pretty much the same information per cookie, i.e. the name, value, domain,
path, expiration date and whether the cookie is http-only. the devtools don't show by default whether a cookie is secure, but this can be enabled by right-clicking the table header and checking secure from the context menu. additionally, the devtools allow to display the creation date of a cookie as well as when it was last accessed and whether it is host-only. edit cookies to edit a cookie in fire...
CanvasRenderingContext2D.addHitRegion() - Web APIs
asrenderingcontext2d method addhitregion() adds a hit region to the bitmap. canvas hit regions make hit detection easy. they let you route events to dom elements, and make it possible for users to explore the canvas without seeing it. syntax void ctx.addhitregion(options); options the options argument is optional. when provided, it is an object which can contain the following properties:
path a
path2d object describing the area of the hit region. if not provided, the current
path is used. fillrule the algorithm by which to determine if a point is inside or outside the hit region. possible values: nonzero: the non-zero winding rule. default rule. evenodd: the even-odd winding rule. id the id for this hit region to reference it for later use in events, for example. pare...
...f there is no control. defaults to null. examples using the addhitregion method this example demonstrates the addhitregion() method. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); canvas.addeventlistener('mousemove', function(event) { if(event.region) { alert('ouch, my eye :('); } }); ctx.begin
path(); ctx.arc(100, 100, 75, 0, 2 * math.pi); ctx.linewidth = 5; ctx.stroke(); // eyes ctx.begin
path(); ctx.arc(70, 80, 10, 0, 2 * math.pi); ctx.arc(130, 80, 10, 0, 2 * math.pi); ctx.fill(); ctx.addhitregion({id: "eyes"}); // mouth ctx.begin
path(); ctx.arc(100, 110, 50, 0, math.pi); ctx.stroke(); edit the code below to see your changes update live in the canvas. (if you don't see the full smiley,...
...your current browser supports hit regions already; you might need to activate a preference.) playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code" style="height:250px"> ctx.begin
path(); ctx.arc(100, 100, 75, 0, 2 * math.pi, false); ctx.linewidth = 5; ctx.stroke(); // eyes ctx.begin
path(); ctx.arc(70, 80, 10, 0, 2 * math.pi, false); ctx.arc(130, 80, 10, 0, 2 * math.pi, false); ctx.fill(); ctx.addhitregion({id: "eyes"}); // mouth ctx.begin
path(); ctx.arc(100, 110, 50, 0, math.pi, false); ctx.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canv...
CanvasRenderingContext2D.isPointInStroke() - Web APIs
the canvasrenderingcontext2d.ispointinstroke() method of the canvas 2d api reports whether or not the specified point is inside the area contained by the stroking of a
path. syntax ctx.ispointinstroke(x, y); ctx.ispointinstroke(
path, x, y); parameters x the x-axis coordinate of the point to check. y the y-axis coordinate of the point to check.
path a
path2d
path to check against. if unspecified, the current
path is used. return value boolean a boolean, which is true if the point is inside the area contained by the stroking of a
path, otherwise false. examples checking a point in the current
path this example uses the ispointinstroke() method to check if a point is within the area of the current
path's stroke. html <canvas id="canvas"></canvas> <p>in stroke: <code id="r...
...he current
path's stroke. html <canvas id="canvas"></canvas> <p>in stroke: <code id="result">false</code></p> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const result = document.getelementbyid('result'); ctx.rect(10, 10, 100, 100); ctx.stroke(); result.innertext = ctx.ispointinstroke(50, 10); result checking a point in the specified
path whenever you move the mouse, this example checks whether the cursor is in the stroke of an elliptical
path2d
path. if yes, the ellipse's stroke becomes green, otherwise it is red. ...
... checking a point in the specified
path whenever you move the mouse, this example checks whether the cursor is in the stroke of an elliptical
path2d
path. if yes, the ellipse's stroke becomes green, otherwise it is red. ...
CanvasRenderingContext2D.lineCap - Web APIs
ends of lines are rounded. "square" the ends of lines are squared off by adding a box with an equal width and half the height of the line's thickness. examples changing the shape of line caps this example rounds the end caps of a straight line. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.begin
path(); ctx.moveto(20, 20); ctx.linewidth = 15; ctx.linecap = 'round'; ctx.lineto(100, 100); ctx.stroke(); result comparison of line caps in this example three lines are drawn, each with a different value for the linecap property. two guides to see the exact differences between the three are added. each of these lines starts and ends exactly on these guides. the line on the left uses the defaul...
...us half the width of the line. the line on the right uses the "square" option. this adds a box with an equal width and half the height of the line thickness. ...
... living standard ...
CanvasRenderingContext2D.lineTo() - Web APIs
syntax ctx.lineto(x, y); parameters x the x-axis coordinate of the line's end point. y the y-axis coordinate of the line's end point. return value undefined. examples drawing a straight line this example draws a straight line using the lineto() method. ...
... syntax ctx.lineto(x, y); parameters x the x-axis coordinate of the line's end point. y the y-axis coordinate of the line's end point. return value undefined. examples drawing a straight line this example draws a straight line using the lineto() method. ...
... the line's end point. y the y-axis coordinate of the line's end point. return value undefined. examples drawing a straight line this example draws a straight line using the lineto() method. html <canvas id="canvas"></canvas> javascript the line begins at (30, 50) and ends at (150, 100). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.begin
path(); // start a new
path ctx.moveto(30, 50); // move the pen to (30, 50) ctx.lineto(150, 100); // draw a line to (150, 100) ctx.stroke(); // render the
path result drawing connected lines each call of lineto() (and similar methods) automatically adds to the current sub-
path, which means that all the lines will all be stroked or filled together. this example draws a letter 'm...
Hit regions and accessibility - Web APIs
are still experimental in current web browsers; check the browser compatibility tables). canvasrenderingcontext2d.addhitregion() adds a hit region to the canvas. canvasrenderingcontext2d.removehitregion() removes the hit region with the specified id from the canvas. canvasrenderingcontext2d.clearhitregions() removes all hit regions from the canvas. ...
... the specified id from the canvas. canvasrenderingcontext2d.clearhitregions() removes all hit regions from the canvas. you can add a hit region to your
path and check for the mouseevent.region property to test if your mouse is hitting your region, for example. ...
...or routing to <input> elements, for example. see also this codepen demo. focus rings when working with the keyboard, focus rings are a handy indicator to help navigating on a page. to draw focus rings on a canvas drawing, the drawfocusifneeded property can be used. canvasrenderingcontext2d.drawfocusifneeded() if a given element is focused, this method draws a focus ring around the current
path. additionally, the scroll
pathintoview() method can be used to make an element visible on the screen if focused, for example. canvasrenderingcontext2d.scroll
pathintoview() scrolls the current
path or a given
path into the view. ...
Using images - Web APIs
target canvas. one of the more practical uses of this would be to use a second canvas element as a thumbnail view of the other larger canvas. creating an image from scratch another option is to create new htmlimageelement objects in our script. to do this, you can use the convenient image() constructor: var img = new image(); // create new img element img.src = 'myimage.png'; // set source
path when this script gets executed, the image starts loading. if you try to call drawimage() before the image has finished loading, it won't do anything (or, in older browsers, may even throw an exception). so you need to be sure to use the load event so you don't try this before the image has loaded: var img = new image(); // create new img element img.addeventlistener('load', function() { /...
...mage() before the image has finished loading, it won't do anything (or, in older browsers, may even throw an exception). so you need to be sure to use the load event so you don't try this before the image has loaded: var img = new image(); // create new img element img.addeventlistener('load', function() { // execute drawimage statements here }, false); img.src = 'myimage.png'; // set source
path if you're only using one external image this can be a good approach, but once you need to track more than one we need to resort to something more clever. it's beyond the scope of this tutorial to look at image pre-loading tactics, but you should keep that in mind. embedding an image via data: url another possible way to include images is via the data: url. data urls allow you to completely de...
... drawimage() method places the backdrop at the coordinate (0, 0), which is the top-left corner of the canvas. <html> <body onload="draw();"> <canvas id="canvas" width="180" height="150"></canvas> </body> </html> function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); var img = new image(); img.onload = function() { ctx.drawimage(img, 0, 0); ctx.begin
path(); ctx.moveto(30, 96); ctx.lineto(70, 66); ctx.lineto(103, 76); ctx.lineto(170, 15); ctx.stroke(); }; img.src = 'https://mdn.mozillademos.org/files/5395/backdrop.png'; } the resulting graph looks like this: screenshotlive sample scaling the second variant of the drawimage() method adds two new parameters and lets us place scaled images on the canvas. drawimage(image...
FileSystemDirectoryEntry - Web APIs
ntries api represents a directory in a file system. it provides methods which make it possible to access and manipulate the files in a directory, as well as to access the entries within the directory. basic concepts you can create a new directory by calling getdirectory(). if you want to create subdirectories, create each child directory in sequence. if you try creating a directory using a full
path that includes parent directories that do not exist yet, an error is returned. so create the hierarchy by recursively adding a new
path after creating the parent directory. example in the following code snippet, we create a directory called "documents." // taking care of the browser-specific prefixes. window.requestfilesystem = window.requestfilesystem || window.webkitrequestfilesystem; window.
...filesystem = window.requestfilesystem || window.webkitrequestfilesystem; window.directoryentry = window.directoryentry || window.webkitdirectoryentry; ... function onfs(fs){ fs.root.getdirectory('documents', {create:true}, function(directoryentry){ //directoryentry.isfile === false //directoryentry.isdirectory === true //directoryentry.name === 'documents' //directoryentry.full
path === '/documents' }, onerror); } // opening a file system with temporary storage window.requestfilesystem(temporary, 1024*1024 /*1mb*/, onfs, onerror); properties this interface has no properties of its own, but inherits properties from its parent interface, filesystementry. methods this interface inherits methods from its parent interface, filesystementry. createreader() creates ...
... properties of its own, but inherits properties from its parent interface, filesystementry. methods this interface inherits methods from its parent interface, filesystementry. createreader() creates a filesystemdirectoryreader object which can be used to read the entries in this directory. getdirectory() returns a filesystemdirectoryentry object representing a directory located at a given
path, relative to the directory on which the method is called. getfile() returns a filesystemfileentry object representing a file located within the directory's hierarchy, given a
path relative to the directory on which the method is called. obsolete methods removerecursively() deletes a directory and all of its contents, including the contents of subdirectories. this has been removed from the...
HTMLAnchorElement - Web APIs
.media is a domstring that reflects the media html attribute, indicating the intended media for the linked resource. htmlhyperlinkelementutils.password is a usvstring containing the password specified before the domain name. htmlhyperlinkelementutils.origin read only returns a usvstring containing the origin of the url, that is its scheme, its domain and its port. htmlhyperlinkelementutils.
pathname is a usvstring representing the
path name component, if any, of the referenced url. htmlhyperlinkelementutils.port is a usvstring representing the port component, if any, of the referenced url. htmlhyperlinkelementutils.protocol is a usvstring representing the protocol component, including trailing colon (':'), of the referenced url. htmlanchorelement.referrerpolicy is a domstring th...
...lelement from html5 on, but were defined on htmlanchorelement in dom level 2 html and earlier specifications. specifications specification status comment html living standardthe definition of 'htmlanchorelement' in that specification. living standard the following property has been added: download. technically, the url-related properties, media, host, hostname,
pathname, port, protocol, search, and hash, have been moved to the htmlhyperlinkelementutils mixin, and htmlanchorelement implements this mixin. html5the definition of 'htmlanchorelement' in that specification. recommendation the methods blur() and focus(), as well as the properties tabindex and accesskey, are now defined on htmlelement. the following properties are now obsolete: ch...
...ement implements this mixin. html5the definition of 'htmlanchorelement' in that specification. recommendation the methods blur() and focus(), as well as the properties tabindex and accesskey, are now defined on htmlelement. the following properties are now obsolete: charset, coords, name, rev, and shape. the following properties have been added: hash, host, hostname, media,
pathname, port, protocol, rellist, search, and text. document object model (dom) level 2 html specificationthe definition of 'htmlanchorelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe definition of 'htmlanchorelement' in that specification. obsolete initial defi...
HTMLAreaElement - Web APIs
d resource. htmlareaelement.nohref is a boolean flag indicating if the area is inactive (true) or active (false). htmlhyperlinkelementutils.password is a usvstring containing the password specified before the domain name. htmlhyperlinkelementutils.origin read only returns a usvstring containing the origin of the url, that is its scheme, its domain and its port. htmlhyperlinkelementutils.
pathname is a usvstring containing the
path name component, if any, of the referenced url. htmlhyperlinkelementutils.port is a usvstring containing the port component, if any, of the referenced url. htmlhyperlinkelementutils.protocol is a usvstring containing the protocol component (including trailing colon ':'), of the referenced url. htmlareaelement.referrerpolicy is a domstring that reflec...
...aining the whole url of the script executed in the worker. it is a synonym for htmlhyperlinkelementutils.href. specifications specification status comment html living standardthe definition of 'htmlareaelement' in that specification. living standard the following property has been added: download. technically, the url-related properties, media, host, hostname,
pathname, port, protocol, search, and hash, have been moving to the htmlhyperlinkelementutils mixin, and htmlareaelement implements this mixin. html5the definition of 'htmlareaelement' in that specification. recommendation technically, the properties tabindex and accesskey are now defined on htmlelement. the following property is now obsolete: nohref. the following properties ha...
...hyperlinkelementutils mixin, and htmlareaelement implements this mixin. html5the definition of 'htmlareaelement' in that specification. recommendation technically, the properties tabindex and accesskey are now defined on htmlelement. the following property is now obsolete: nohref. the following properties have been added: rel, rellist, media, hreflang, type, host, hostname,
pathname, port, protocol, search, and hash. document object model (dom) level 2 html specificationthe definition of 'htmlareaelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe definition of 'htmlareaelement' in that specification. obsolete initial definition ...
HTMLInputElement.webkitdirectory - Web APIs
selected items. the selected file system entries can be obtained using the webkitentries property. syntax htmlinputelement.webkitdirectory = boolvalue value a boolean; true if the <input> element should allow picking only directories or false if only files should be selectable. understanding the results after the user makes a selection, each file object in files has its file.webkitrelative
path property set to the relative
path within the selected directory at which the file is located. for example, consider this file system: photoalbums birthdays jamie's 1st birthday pic1000.jpg pic1004.jpg pic1044.jpg don's 40th birthday pic2343.jpg pic2344.jpg pic2355.jpg pic2356.jpg ...
...g pic2356.jpg vacations mars pic5533.jpg pic5534.jpg pic5556.jpg pic5684.jpg pic5712.jpg if the user chooses photoalbums, then the list reported by files will contain file objects for every file listed above—but not the directories. the entry for pic2343.jpg will have a webkitrelative
path of photoalbums/birthdays/don's 40th birthday/pic2343.jpg. this makes it possible to know the hierarchy even though the filelist is flat. note: the behavior of webkitrelative
path is different in chromium < 72. see this bug for further details. example in this example, a directory picker is presented which lets the user choose one or more directories. when the change event occurs, a list of al...
... draft initial specification. this api has no official w3c or whatwg specification. browser compatibility the compatibility table on this page is generated from str...
IDBDatabase.createObjectStore() - Web APIs
(name); idbdatabase.createobjectstore(name, options); parameters name the name of the new object store to be created. note that it is possible to create an object store with an empty name. optionalparameters optional an options object whose attributes are optional parameters to the method. it includes the following properties: attribute description key
path the key
path to be used by the new object store. if empty or not specified, the object store is created without a key
path and uses out-of-line keys. you can also pass in an array as a key
path. autoincrement if true, the object store has a key generator. defaults to false. unknown parameters are ignored. returns a new idbobjectstore. exceptions this method ma...
...g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database. invalidaccesserror if autoincrement is set to true and key
path is either an empty string or an array containing an empty string. example // let us open our database var request = window.indexeddb.open("todolist", 4); // this handler is called when a new version of the database // is created, either when one has not been created before // or when a new version number is submitted by calling // window.indexeddb.open(). // this handler is only supporte...
... version number is submitted by calling // window.indexeddb.open(). // this handler is only supported in recent browsers. ...
IDBObjectStore - Web APIs
tore interface of the indexeddb api represents an object store in a database. records within an object store are sorted according to their keys. this sorting enables fast insertion, look-up, and ordered retrieval. note: this feature is available in web workers. properties idbobjectstore.indexnames read only a list of the names of indexes on objects in this object store. idbobjectstore.key
path read only the key
path of this object store. if this attribute is null, the application must provide a key for each modification operation. idbobjectstore.name the name of this object store. idbobjectstore.transaction read only the idbtransaction object to which this object store belongs. idbobjectstore.autoincrement read only the value of the auto increment flag for this object store. ...
... not // been created before, or a new version number has been // submitted via the window.indexeddb.open line above dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { key
path: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); ob...
...a android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitkey
pathchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support ...
IDBObjectStoreSync - Web APIs
however be reintroduced in the future if there is enough demand from web developers. the idbobjectstoresync interface of the indexeddb api provides synchronous access to an object store of a database. ...
...t (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); void removeindex (in domstring indexname) raises (idbdatabaseexception); attributes attribute type description indexnames readonly domstringlist a list of the names of the indexes on this object store. key
path readonly domstring the key
path of this object store. if this attribute is set to null, then the application must provide a key for each modification operation. mode readonly unsigned short the mode for isolating access to the data in this object store. for possible values, see constants. name readonly domstring the name of this object store. constants ...
...dex's referenced object store. data_err if this object store uses out-of-line keys, and the key parameter was not passed. serial_err if the data being stored could not be serialized by the internal structured cloning algorithm. createindex() creates and returns a new index with the given name in the connected database. idbindexsync createindex ( in domstring name, in domstring key
path, in optional boolean unique ); parameters name the name of a new index. key
path the key
path used by the new index. unique if true, keys in the index must be unique; if false, duplicate keys are allowed. returns idbindexsync an object to access the newly created index. get() retrieves and returns the value from this object store for the record that corresponds to the given...
Using Pointer Events - Web APIs
a pointerdown event occurs, indicating that a new touch on the surface has occurred, the handlestart() function below is called. function handlestart(evt) { log("pointerdown."); var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); log("pointerdown: id = " + evt.pointerid); ongoingtouches.push(copytouch(evt)); var color = colorfortouch(evt); ctx.begin
path(); ctx.arc(touches[i].pagex, touches[i].pagey, 4, 0, 2 * math.pi, false); // a circle at the start ctx.arc(evt.clientx, evt.clienty, 4, 0, 2 * math.pi, false); // a circle at the start ctx.fillstyle = color; ctx.fill(); } after storing some of the event's processing in the ongoingtouches for later processing, the start point is drawn as a small circle. we're using a 4-pixel wide line,...
...s to update the cached touch information and to draw a line from the previous position to the current position of each touch. ...
...last line segment for the touch that ended and remove the touch point from the ongoing touch list. ...
Touch events - Web APIs
called. function handlestart(evt) { evt.preventdefault(); console.log("touchstart."); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { console.log("touchstart:" + i + "..."); ongoingtouches.push(copytouch(touches[i])); var color = colorfortouch(touches[i]); ctx.begin
path(); ctx.arc(touches[i].pagex, touches[i].pagey, 4, 0, 2 * math.pi, false); // a circle at the start ctx.fillstyle = color; ctx.fill(); console.log("touchstart:" + i + "."); } } this calls event.preventdefault() to keep the browser from continuing to process the touch event (this also prevents a mouse event from also being delivered). then we get the context and pull the list o...
...ch. ...
... { evt.preventdefault(); log("touchend"); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var color = colorfortouch(touches[i]); var idx = ongoingtouchindexbyid(touches[i].identifier); if (idx >= 0) { ctx.linewidth = 4; ctx.fillstyle = color; ctx.begin
path(); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); ctx.lineto(touches[i].pagex, touches[i].pagey); ctx.fillrect(touches[i].pagex - 4, touches[i].pagey - 4, 8, 8); // and a square at the end ongoingtouches.splice(idx, 1); // remove it; we're done } else { console.log("can't figure out which touch to end"); } } } this is very similar to ...
URL - Web APIs
followed by (if a port was specified) a ':' and the port of the url. hostname a usvstring containing the domain of the url. href a stringifier that returns a usvstring containing the whole url. origin read only returns a usvstring containing the origin of the url, that is its scheme, its domain and its port. password a usvstring containing the password specified before the domain name.
pathname a usvstring containing an initial '/' followed by the
path of the url. port a usvstring containing the port number of the url. protocol a usvstring containing the protocol scheme of the url, including the final ':'. search a usvstring indicating the url's parameter string; if any parameters are provided, this string includes all of them, beginning with the leading ? character. searchp...
... identifying the object in the browser. revokeobjecturl() revokes an object url previously created using url.createobjecturl(). ...
...the url parameter is a relative url: const url = new url('../cats', 'http://www.example.com/dogs'); console.log(url.hostname); // "www.example.com" console.log(url.
pathname); // "/cats" url properties can be set to construct the url: url.hash = 'tabby'; console.log(url.href); // "http://www.example.com/cats#tabby" urls are encoded according to the rules found in rfc 3986. for instance: url.
pathname = 'démonstration.html'; console.log(url.href); // "http://www.example.com/d%c3%a9monstration.html" the urlsearchparams interface can be used to build and manipulate the url query string. to get the search params from the current window's url, you can do this: // https://some.site/?id=123 const parsedurl = new url(window.location.href); console.log(parsedurl.searchparams.get("id")); // "1...
Variable fonts guide - CSS: Cascading Style Sheets
rades to the traditional @font-face syntax now available in modern browsers. the basic syntax is the same, but the font technology can be specified, and allowable ranges for descriptors like font-weight and font-stretch can be supplied, rather than named according to the font file being loaded. ...
...ccording to the font file being loaded. ...
...25%; font-style: oblique 0deg 20deg; } note: there is no set specific value for the upper-end degree measurement in this case; they simply indicate that there is an axis so the browser can know to render upright or italic (remember that italics are only on or off) example for a font that contains only italics and no upright characters: @font-face { font-family: 'myvariablefontname'; src: '
path/to/font/file/myvariablefont.woff2' format('woff2-variations'); font-weight: 125 950; font-stretch: 75% 125%; font-style: italic; } example for a font that contains an oblique (slant) axis: @font-face { font-family: 'myvariablefontname'; src: '
path/to/font/file/myvariablefont.woff2' format('woff2-variations'); font-weight: 125 950; font-stretch: 75% 125%; font-style: oblique 0deg 12deg; ...
Shapes From Images - CSS: Cascading Style Sheets
in this guide we will take a look at how we can create a shape from an image file with an alpha channel or even from a css gradient. this is a very flexible way to create shapes. rather than drawing a
path with a complex polygon in css, you can create the shape in a graphics program and then use the
path created by the pixels less opaque than a threshold value. a simple shape from an image to use an image for the shape the image needs to have an alpha channel, an area that is not fully opaque. the shape-image-threshold property is used to set a threshold for this opacity. ...
... to use an image for the shape the image needs to have an alpha channel, an area that is not fully opaque. the shape-image-threshold property is used to set a threshold for this opacity. pixels that are more opaque than this value will be used to calculate the area of the shape. as a simple example, i have an image of a star with a solid red area and an area which is fully transparent. i use the
path to the image file as the value of the shape-outside property. the content now wraps around the star shape. i can use shape-margin to move the text away from the shape, giving a margin around the created shape and the text. cors compatibility something that you will run into when creating shapes from an image is that the image you use must be cors compatible. an image hosted on the same dom...
... ...
CSS reference - CSS: Cascading Style Sheets
cingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearclipclip-
pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><displa...
...height (@viewport)max-inline-sizemax-widthmax-width (@viewport)max-zoom (@viewport)@mediamin()min-block-sizemin-heightmin-height (@viewport)min-inline-sizemin-widthmin-width (@viewport)min-zoom (@viewport)minmax()mix-blend-modemmmsn@namespacenegative (@counter-style):not:nth-child:nth-last-child:nth-last-of-type:nth-of-type<number>oobject-fitobject-positionoffsetoffset-anchoroffset-distanceoffset-
pathoffset-rotate:only-child:only-of-typeopacityopacity():optionalorderorientation (@viewport)@ornamentsornaments()orphans:out-of-rangeoutlineoutline-coloroutline-offsetoutline-styleoutline-widthoverflowoverflow-anchoroverflow-blockoverflow-inlineoverflow-wrapoverflow-xoverflow-yoverscroll-behavioroverscroll-behavior-blockoverscroll-behavior-inlineoverscroll-behavior-xoverscroll-behavior-yppad (@count...
...ineoverflow-wrapoverflow-xoverflow-yoverscroll-behavioroverscroll-behavior-blockoverscroll-behavior-inlineoverscroll-behavior-xoverscroll-behavior-yppad (@counter-style)paddingpadding-blockpadding-block-endpadding-block-startpadding-bottompadding-inlinepadding-inline-endpadding-inline-startpadding-leftpadding-rightpadding-top@pagepage-break-afterpage-break-beforepage-break-insidepaint()paint-order
path()pc<percentage>perspectiveperspective()perspective-originplace-contentplace-itemsplace-self::placeholderpointer-eventspolygon()<position>positionprefix (@counter-style)ptpxqqquotesrradradial-gradient()range (@counter-style)<ratio>:read-only:read-writerect()remrepeat()repeating-linear-gradient()repeating-radial-gradient():requiredresize<resolution>revertrgb()rgba():rightright@right-bottom:rootrota...
animation - CSS: Cascading Style Sheets
ttom: 0; } svg { width: 1.5em; height: 1.5em; } button { width: 27px; height: 27px; background-size: 16px; background-position: center; background-repeat: no-repeat; border-radius: 3px; cursor: pointer; } button.play { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3e
path%20%7bdisplay%3anone%7d%20
path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3c
path%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3c
path%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3c
path%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2...
...%20%2f%3e%3c
path%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#play'); } button.pause { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3e
path%20%7bdisplay%3anone%7d%20
path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3c
path%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3c
path%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3c
path%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2...
...%2f%3e%3c
path%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#pause'); } button.restart { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3e
path%20%7bdisplay%3anone%7d%20
path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3c
path%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3c
path%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3c
path%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2...
Math (math) - EXSLT
the namespace for the math package is http://exslt.org/math. ...
...the namespace for the math package is http://exslt.org/math. ...
...the namespace for the math package is http://exslt.org/math. ...
Strings (str) - EXSLT
the namespace for the strings package is http://exslt.org/strings. ...
...the namespace for the strings package is http://exslt.org/strings. ...
...the namespace for the strings package is http://exslt.org/strings. ...
<input type="image"> - HTML: Hypertext Markup Language
mples and send us a pull request. value none — the value attribute should not be specified. events none. supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none. methods none. value <input type="image"> elements do not accept value attributes. the
path to the image to be displayed is specified in the src attribute. additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attributes: attribute description alt alternate string to display when the image can't be shown formaction the url to which to submit the data formenctype ...
...if possible, use text which matches the label you'd use if you were using a standard submit button. the width and he...
...if possible, use text which matches the label you'd use if you were using a standard submit button. the width and height attributes are used to specify the width and height the image should be shown at, in pixels. ...
Referrer-Policy - HTTP
-policy: same-origin referrer-policy: strict-origin referrer-policy: strict-origin-when-cross-origin referrer-policy: unsafe-url directives no-referrer the referer header will be omitted entirely. no referrer information is sent along with requests. no-referrer-when-downgrade (default) this is the default behavior if no policy is specified, or if the provided value is invalid. the origin,
path, and querystring of the url are sent as a referrer when the protocol security level stays the same (http→http, https→https) or improves (http→https), but isn't sent to less secure destinations (https→http). there is effort from browsers in moving to a stricter default value, namely strict-origin-when-cross-origin (see https://github.com/whatwg/fetch/pull/952), consider using this value (...
...alue, namely strict-origin-when-cross-origin (see https://github.com/whatwg/fetch/pull/952), consider using this value (or a stricter one), if possible, when changing the referrer-policy. origin only send the origin of the document as the referrer. for example, a document at https://example.com/page.html will send the referrer https://example.com/. origin-when-cross-origin send the origin,
path, and query string when performing a same-origin request, but only send the origin of the document for other cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will send no referrer information. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (https→https), but don't send it to a less ...
...the document for other cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will send no referrer information. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (https→https), but don't send it to a less secure destination (https→http). strict-origin-when-cross-origin send the origin,
path, and querystring when performing a same-origin request, only send the origin when the protocol security level stays the same while performing a cross-origin request (https→https), and send no header to any less-secure destinations (https→http). unsafe-url send the origin,
path, and query string when performing any request, regardless of security. this policy will leak potentially-private...
SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead - JavaScript
he syntax due to a conflict with ie whenever it was found in the page after //@cc_on was interpreted to turn on conditional compilation in the ie jscript engine. ...
...onditional compilation in the ie jscript engine. the conditional compilation comment in ie is a little known feature, but it broke source maps with jquery and other libraries. examples deprecated syntax syntax with the "@" sign is deprecated. ...
...query and other libraries. examples deprecated syntax syntax with the "@" sign is deprecated. //@ sourcemappingurl=http://example.com/
path/to/your/sourcemap.map standard syntax use the "#" sign instead. ...
clip - SVG: Scalable Vector Graphics
the clip attribute is a presentation attribute defining the visible region of an element. this attribute has the same parameter values as defined for the css clip property. unitless values, which indicate current user coordinates, are permitted on the coordinate values on the rect(). the value of auto defines a clipping
path along the bounds of the viewport created by the given element. as a presentation attribute, it can be applied to any element but it has effect only on the following six elements: <svg>, <symbol>, <image>, <foreignobject>, <pattern>, <marker> html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- auto clipping --> <svg x="0" width="10" height="10" clip="auto"> <circle cx="5" cy="5" r="4" stroke="green" /> <...
...00/svg"> <!-- auto clipping --> <svg x="0" width="10" height="10" clip="auto"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> <!-- rect(top, right, bottom, left) clipping --> <svg x="10" width="10" height="10" clip="rect(1, 9, 8, 2)"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> </svg> usage notes warning: this property is deprecated. use clip-
path instead. value auto | rect() default value auto animatable yes the value auto defines a clipping
path along the bounds of the viewport created by the given element.the value rect() defines a clipping rectangle following the following syntax: rect(<top>, <right>, <bottom>, <left>). the <top> and <bottom> values specify offsets from the top border edge of...
... scalable vector graphics (svg) 1.1 (second edition)the definition of 'clip' in that specification. recommendation initial definition ...
color-rendering - SVG: Scalable Vector Graphics
rformance, which might mean sacrificing the color interpolation precision as specified by through the linearrgb value for color-interpolation-filters. note: as a presentation attribute, color-rendering can be used as a css property. ...
...interpolation-filters. note: as a presentation attribute, color-rendering can be used as a css property. ...
...as a presentation attribute, it can be applied to any element but it only has an effect on the following 29 elements: <a>, <animate>, <animatecolor>, <circle>, <clip
path>, <defs>, <ellipse>, <foreignobject>, <g>, <glyph>, <image>, <line>, <lineargradient>, <marker>, <mask>, <missing-glyph>, <
path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <svg>, <switch>, <symbol>, <text>, <text
path>, <tspan>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="ur...
fill - SVG: Scalable Vector Graphics
e has two different meanings. for shapes and text it's a presentation attribute that defines the color (or any svg paint servers like gradients or patterns) used to paint the element; for animation it defines the final state of the animation. as a presentation attribute, it can be applied to any element but it only has an effect on the following eleven elements: <altglyph>, <circle>, <ellipse>, <
path>, <polygon>, <polyline>, <rect>, <text>, <text
path>, <tref>, and <tspan>. for animation five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>. html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- simple color fill --> <circle cx="50" cy="50" r="40" fill="pink" /> <!-- fill circle...
...t> default value black animatable yes note: as a presentation attribute fill can be used as a css property. ellipse for <ellipse>, fill is a presentation attribute that defines the color of the ellipse. value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property.
path for <
path>, fill is a presentation attribute that defines the color of the interior of the shape. (interior is define by the fill-rule attribute) value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property. polygon for <polygon>, fill is a presentation attribute that defines the color of the i...
...t animation frame) | remove (keep the state of the first animation frame) default value remove animatable no text for <text>, fill is a presentation attribute that defines what the color of the text. value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property. text
path for <text
path>, fill is a presentation attribute that defines the color of the text. value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property. tref warning: as of svg2 <tref> is deprecated and shouldn't be used. for <tref>, fill is a presentation attribute that defines the color of the tex...
marker-end - SVG: Scalable Vector Graphics
the marker-end attribute defines the arrowhead or polymarker that will be drawn at the final vertex of the given shape. for all shape elements, except <polyline> and <
path>, the last vertex is the same as the first vertex. in this case, if the value of marker-start and marker-end are both not none, then two markers will be rendered on that final vertex. for <
path> elements, for each closed sub
path, the last vertex is the same as the first vertex. marker-end is only rendered on the final vertex of the
path data. note: as a presentation attribute, marker-end can be used as a css property. ...
...al vertex. for <
path> elements, for each closed sub
path, the last vertex is the same as the first vertex. marker-end is only rendered on the final vertex of the
path data. note: as a presentation attribute, marker-end can be used as a css property. ...
... <marker-ref> this v...
marker-start - SVG: Scalable Vector Graphics
the marker-start attribute defines the arrowhead or polymarker that will be drawn at the first vertex of the given shape. for all shape elements, except <polyline> and <
path>, the last vertex is the same as the first vertex. in this case, if the value of marker-start and marker-end are both not none, then two markers will be rendered on that final vertex. for <
path> elements, for each closed sub
path, the last vertex is the same as the first vertex. marker-start is only rendered on the first vertex of the
path data. note: as a presentation attribute, marker-start can be used as a css property. ...
...ertex. for <
path> elements, for each closed sub
path, the last vertex is the same as the first vertex. marker-start is only rendered on the first vertex of the
path data. note: as a presentation attribute, marker-start can be used as a css property. ...
... <marker-ref> this...
onclick - SVG: Scalable Vector Graphics
the onclick attribute specifies some script to run when the element is clicked. ...
... the onclick attribute specifies some script to run when the element is clicked. ...
...t is clicked. ...
preserveAspectRatio - SVG: Scalable Vector Graphics
wbox providing a given aspect ratio must fit into a viewport with a different aspect ratio. because the aspect ratio of an svg image is defined by the viewbox attribute, if this attribute isn't set, the preserveaspectratio attribute has no effect (with one exception, the <image> element, as described below). ...
...pectratio="xmaxymid slice" x="150" y="0" viewbox="0 0 100 100" width="10" height="25"><use href="#smiley" /></svg> <!-- none --> <svg preserveaspectratio="none" x="0" y="30" viewbox="0 0 100 100" width="160" height="60"><use href="#smiley" /></svg> </svg> topexample html,body,svg { height:100% } <svg viewbox="-1 -1 162 92" xmlns="http://www.w3.org/2000/svg"> <defs> <
path id="smiley" d="m50,10 a40,40,1,1,1,50,90 a40,40,1,1,1,50,10 m30,40 q36,35,42,40 m58,40 q64,35,70,40 m30,60 q50,75,70,60 q50,75,30,60" /> </defs> <!-- (width>height) meet --> <rect x="0" y="0" width="20" height="10"> <title>xmidymid meet</title> </rect> <svg viewbox="0 0 100 100" width="20" height="10" preserveaspectratio="xmidymid meet" x="0" y="0"> <use href="#smiley" /...
... </rect> <svg viewbox="0 0 100 100" width="10" height="25" preserveaspectratio="xmaxymid slice" x="150" y="0"> <use href="#smiley" /> </svg> <!-- none --> <rect x="0" y="30" width="160" height="60"> <title>none</title> </rect> <svg viewbox="0 0 100 100" width="160" height="60" preserveaspectratio="none" x="0" y="30"> <use href="#smiley" /> </svg> </svg>
path { fill: yellow; stroke: black; stroke-width: 8px; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; } rect:hover, rect:active { outline: 1px solid red; } syntax preserveaspectratio="<align> [<meetorslice>]" its value is made of one or two keywords: a required alignment value and an optional "meet or slice" reference as described below: alignment value t...
<hatch> - SVG: Scalable Vector Graphics
the <hatch> svg element is used to fill or stroke an object using one or more pre-defined
paths that are repeated at fixed intervals in a specified direction to cover the areas to be painted. hatches defined by the <hatch> element can then referenced by the fill and stroke css properties on a given graphics element to indicate that the given element shall be filled or stroked with the hatch.
paths are defined by <hatch
path> elements. ...
...h> element can then referenced by the fill and stroke css properties on a given graphics element to indicate that the given element shall be filled or stroked with the hatch.
paths are defined by <hatch
path> elements. usage context categoriesnever-rendered element, paint server elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements<hatch
path>, <script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes x y pitch rotate hatchunits hatchcontentunits transform href dom interface this element implements the svghatchelement interface. example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <h...
...ributes presentation attributes style attributes specific attributes x y pitch rotate hatchunits hatchcontentunits transform href dom interface this element implements the svghatchelement interface. example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <hatch id="hatch" hatchunits="userspaceonuse" pitch="5" rotate="135"> <hatch
path stroke="#a080ff" stroke-width="2"/> </hatch> </defs> <rect fill="url(#hatch)" stroke="black" stroke-width="2" x="10%" y="10%" width="80%" height="80%" /> </svg> result ...
<mask> - SVG: Scalable Vector Graphics
an alpha mask for compositing the current object into the background. a mask is used/referenced using the mask property. html,body,svg { height:100% } <svg viewbox="-10 -10 120 120"> <mask id="mymask"> <!-- everything under a white pixel will be visible --> <rect x="0" y="0" width="100" height="100" fill="white" /> <!-- everything under a black pixel will be invisible --> <
path d="m10,35 a20,20,0,0,1,50,35 a20,20,0,0,1,90,35 q90,65,50,95 q10,65,10,35 z" fill="black" /> </mask> <polygon points="-10,110 110,110 110,-10" fill="orange" /> <!-- with this mask applied, we "punch" a heart shape hole into the circle --> <circle cx="50" cy="50" r="50" mask="url(#mymask)" /> </svg> attributes height this attribute defines the height of the masking area. value ...
...pe: <coordinate> ; default value: -10%; animatable: yes width this attribute defines the width of the masking area. ...
... candidate recommendation scalable vector graphics (svg) 1.1 (second editi...
<polyline> - SVG: Scalable Vector Graphics
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes ...
...olyline shape with stroke and no fill --> <polyline points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polyline value type: <number>+ ; default value: ""; animatable: yes
pathlength this attribute lets specify the total length for the
path, in user units. ...
... length for the
path, in user units. ...
<symbol> - SVG: Scalable Vector Graphics
and thus promote accessibility. ...
...alue: 0; animatable: yes y this attribute determines the y coordinate of the symbol. ...
...only instances of a <symbol> element (i.e., a reference to a <symbol> by a <use> element) are rendered. that means that some browsers could refuse to directly display a <symbol> ...
SVG fonts - SVG: Scalable Vector Graphics
pt. glyph --></glyph> <glyph unicode="@"><!-- outline of @ glyph --></glyph> <!-- more glyphs --> </font> we start with the <font> element. this bears an id attribute, to enable it to be referenced via a uri (see below). the horiz-adv-x attribute determines how wide a character is on aver...
...0z"/></missing-glyph> <glyph unicode="!" horiz-adv-x="300"><!-- outline of exclam. pt. glyph --></glyph> <glyph unicode="@"><!-- outline of @ glyph --></glyph> <!-- more glyphs --> </font> we start with the <font> element. this bears an id attribute, to enable it to be referenced via a uri (see below). the horiz-adv-x attribute determines how wide a character is on average compared to the
path definitions of the single glyphs. the value 1000 sets a reasonable value to work with. there are several accompanying attributes that help further define the basic glyph-box layout. the <font-face> element is the svg equivalent of the css @font-face declaration. it defines basic properties of the final font such as weight, style, etc. in the example above the first and most important to be defin...
...displayed if a certain glyph is not found in the font and if there are no fallback mechanisms. it also shows how glyphs are created: by simply adding any graphical svg content inside. you can use literally any other svg elements in here, even <filter>, <a> or <script>. for simple glyphs, however, you can simply add a d attribute — this defines a shape for the glyph exactly like how standard svg
paths work. the actual glyphs are then defined by <glyph> elements. the most important attribute is unicode. it defines the unicode codepoint represented by this glyph. if you also specify the lang attribute on a glyph, you can further restrict it to certain languages (represented by xml:lang on the target) exclusively. again, you can use arbitrary svg to define the glyph, which allows for great effe...
Same-origin policy - Web security
ced as the "scheme/host/port tuple", or just "tuple". ...
...comprise a whole — a generic form for double/triple/quadruple/quintuple/etc.) the following table gives examples of origin comparisons with the url http://store.company.com/dir/page.html: url outcome reason http://store.company.com/dir2/other.html same origin only the
path differs http://store.company.com/dir/inner/another.html same origin only the
path differs https://store.company.com/page.html failure different protocol http://store.company.com:81/dir/page.html failure different port (http:// is port 80 by default) http://news.company.com/dir/page.html failure different host inherited origins scripts executed from pages with an about:blank or javascript: url inherit the origin of the docume...
.... firefox and chrome use the public suffix list to determine if a domain is a public suffix. internet explorer uses its own internal method to determine if a domain is a public suffix. the browser will make a cookie available to the given domain including any sub-domains, no matter which protocol (http/https) or port is used. when you set a cookie, you can limit its availability using the domain,
path, secure, and httponly flags. when you read a cookie, you cannot see from where it was set. even if you use only secure https connections, any cookie you see may have been set using an insecure connection. ...
Index - XSLT: Extensible Stylesheet Language Transformations
2 common xslt errors xslt your server needs to send both the source and the stylesheet with a xml mime type, text/xml or application/xml. to find out the current type, load the file in mozilla and look at the page info. or use a download tool, those usually tell the mime type. ...
...pts will be helpful in understanding the description of netscape's capabilities that follows. 15 for further reading needscontent, needshelp, transforming_xml_with_xslt, xml, xslt http://www.amazon.com/xslt-programme.../dp/0764543814 16 resources extensions, needscontent, needsexample, needslivesample, xml, xsl no summary! 17 the netscape xslt/x
path reference netscape, reference, xslt, axes no summary! 18 using the mozilla javascript interface to xsl transformations xslt this document describes the javascript interface in mozilla 1.2 and up to the xslt processing engine (transformiix). 19 xslt elements reference element, overview, reference, xslt there are two types of elements discussed he...
... the <xsl:text> element writes literal text to the output tree. it may contain #pcdata, literal text, and entity references. 50 <xsl:transform> element, reference, xslt, transform the <xsl:transform> element is exactly equivalent to the <xsl:stylesheet> element. 51 <xsl:value-of> element, reference, xslt, value-of the <xsl:value-of> element evaluates an x
path expression, converts it to a string, and writes that string to the result tree. 52 <xsl:variable> element, reference, xslt, variable the <xsl:variable> element declares a global or local variable in a stylesheet and gives it a value. because xslt permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of sc...
Classes and Inheritance - Archive of obsolete content
w how to override the stub implementation of the method draw in shape with a more specialized one in circle. recall that javascript returns the first property it finds when walking the prototype chain of an object from the bottom up. consequently, overriding a method is as simple as providing a new definition on the prototype of the subclass: circle.prototype.draw = function (ctx) { ctx.begin
path(); ctx.arc(this.x, this.y, this.radius, 0, 2 * math.pi, false); ctx.fill(); }; with this definition in place, we get: let shape = shape(2, 3); shape.draw(); // error: not yet implemented let circle = circle(2, 3, 5); circle.draw(); // typeerror: ctx is not defined which is the behavior we were aiming for. classes in the add-on sdk we have shown how to emulate classical ...
...this is all handled automatically. on the other hand, the call to the constructor for shape still has to be made explicitly. this is...
remote/parent - Archive of obsolete content
// the first argument is the frame the message came from frames.port.on("pageshow", (frame) => { console.log(frame.frameelement.currenturi.host + ": pageshow"); }); globals functions remoterequire(id, module = null) loads a module in any existing and future child processes. the module loads asynchronously but you can start sending messages to the module immediately. you can use an absolute
path to the module or a relative
path. if you use a relative
path, you must use the module parameter. const { remoterequire } = require("sdk/remote/parent"); remoterequire("./my-module.js", module); note that even single-process applications have a process that contains content frames. for consistency and to make writing multiprocess compatible code easier, remoterequire() will also create a new mod...
...require } = require("sdk/remote/parent"); remoterequire("./my-module.js", module); note that even single-process applications have a process that contains content frames. for consistency and to make writing multiprocess compatible code easier, remoterequire() will also create a new module loader and load modules in the main process. parameters id : string the module to load. to use a relative
path you must pass the module parameter. module : object the module to resolve the relative module id against. to resolve relative to the loading module, pass module here. properties processes a processes object. frames a frames object. processes the processes object lets you interact with the processes currently running. you can use it as a simple list of all running processes: const { proc...
ui/button/action - Archive of obsolete content
this appears in a tooltip, and when the button is in the menu, it appears underneath the button as a legend. icon url, string, object one or more icons for the button. you can specify this in one of three ways: as a resource:// url pointing at an icon file in your add-on's "data" directory, typically constructed using self.data.url(iconfile) as a relative
path: a string in the form "./iconfile", where "iconfile" is a relative
path to the icon file beginning in your add-on's "data" directory as an object, or dictionary of key-value pairs. here you can specify a range of sizes for your button's icon. each key-value pair specifies an icon: each value specifies an image file as a resource:// url or relative
path. each key must be ...
... only emit one type of event, "click". listener : function the listener to remove. destroy() destroy the button. after calling this function, the button will no longer appear in the ui, and accessing any of its properties or methods will throw an error. properties id the button's unique id. this is read-only. label the button's label. icon the button's icon or icons, as a url, relative
path, or object containing a set of key-value pairs. disabled boolean property indicating whether or not the button is disabled. badge new in firefox 36. value to attach to the button as a badge. may be a number or a string. the badge can contain as many characters (or digits) as you like, but only the first four will be displayed. badgecolor new in firefox 36. color for the badge, specif...
ui/button/toggle - Archive of obsolete content
this appears in a tooltip, and when the button is in the menu, it appears underneath the button as a legend. icon url, string, object one or more icons for the button. you can specify this in one of three ways: as a resource:// url pointing at an icon file in your add-on's "data" directory, typically constructed using self.data.url(iconfile) as a relative
path: a string in the form "./iconfile", where "iconfile" is a relative
path to the icon file beginning in your add-on's "data" directory as an object, or dictionary of key-value pairs. here you can specify a range of sizes for your button's icon. each key-value pair specifies an icon: each value specifies an image file as a resource:// url or relative
path. each key must be ...
... event, "click" and "change". listener : function the listener to remove. destroy() destroy the button. after calling this function, the button will no longer appear in the ui, and accessing any of its properties or methods will throw an error. properties id the button's unique id. this property is read-only. label the button's label. icon the button's icon or icons, as a url, relative
path, or object containing a set of key-value pairs. disabled boolean property indicating whether or not the button is disabled. checked boolean property indicating whether or not the button is checked. it's initialized to false, or the value of the checked option to the button's constructor. it is then flipped, on a per-window basis, whenever the user clicks the button or when the button's click(...
jpm-mobile - Archive of obsolete content
mozilla's irc network. command reference there are currently two jpm commands: jpm-mobile run launch an instance of firefox with your add-on installed. jpm-mobile test runs your add-on's unit tests. jpm-mobile run this command runs a new instance of firefox with the add-on installed: jpm-mobile run jpm-mobile run accepts the following options: --adb /
path/to/adb provides the
path to adb. -b --binary binary use the package name of firefox specified in binary. jpm-mobile run -b fennec you can get the package name by following command. $ adb shell pm list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox -v --verbose verbose operation. ...
...hell pm list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox -v --verbose verbose operation. jpm-mobile test jpm-mobile test see the tutorial on unit testing and the reference documentation for the assert module for more details on this. jpm-mobile test accepts the following options: --adb /
path/to/adb provides the
path to adb. -b --binary binary use the package name of firefox specified in binary. jpm-mobile test -b fennec you can get the package name by following command. $ adb shell pm list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox -v --verbose verbose operation. ...
package.json - Archive of obsolete content
s service" xpcom component. defaults to a random guid generated by cfx. hasembeddedwebextension new in jpm 1.2.0. boolean value: true if the add-on contains an embedded webextension. homepage the url of the add-on's website. this value will be used as the add-on's em:homepageurl element in its install.rdf. icon the
path to an image file containing the icon for the add-on. optional: you can have no icon field in package.json and put your icon named "icon.png" in the root directory of your add-on. if no icon is specified, the standard add-on icon will be used by default. when using jpm, using a relative
path to the data directory (to make it re-usable for add-on html content) does not work. you can ...
...t may either scaled and possibly distorted) or might break parts of firefox ui. (if you test this, please add the result here.) this can also be an object with the image size as key and the (absolute) location of the image as value. jpm looks for the sizes 64, 48 and 32. icon64 note: this is deprecated along with cfx; it's not available when using jpm. the
path to an image containing the large icon for the add-on. defaults to icon64.png. if you don't provide an icon here, the same icon as specified by icon will be used. this value will be used as the add-on's em:icon64url element in its install.rdf. the icon may be up to 64x64 pixels in size. id a globally unique identifier for the add-on. this value will be used as t...
Getting Started (jpm) - Archive of obsolete content
ata and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png back at the command prompt, type: jpm run this is the jpm command to run a new instance of firefox with your add-on installed. if firefox can not be located, or you have installed firefox developer as an alternate browser, you may need to provide the
path to it. for example, in ubuntu: jpm run -b /usr/bin/firefox when firefox launches, in the top-right corner of the browser you'll see an icon with the firefox logo. click the icon, and a new tab will open with http://www.mozilla.org/ loaded into it. that's all this add-on does. it uses two sdk modules: the action button module, which enables you to add buttons to the browser, and the tabs module...
...ibute it, you'll need to package it as an xpi file. this is the installable file format for firefox add-ons. you can distribute xpi files yourself or publish them to https://addons.mozilla.org so other users can download and install them. to build an xpi, just execute the command jpm xpi from the add-on's directory: jpm xpi you should see a message like: jpm info successfully created xpi at /
path/to/my-addon/@my-addon-0.0.1.xpi to test that this worked, try installing the xpi file in your own firefox installation. you can do this by pressing the ctrl+o key combination (cmd+o on mac) from within firefox, or selecting the "open" item from firefox's "file" menu. this will bring up a file selection dialog: navigate to the "@my-addon.xpi" file, open it and follow the prompts to install the a...
Getting started (cfx) - Archive of obsolete content
o see output from console.log() messages, you'll have to tweak a setting. see the documentation on logging levels for the details on this. ...
...ts = function(grunt) { 'use strict'; require('matchdep').filterdev('grunt-!(cli)').foreach(grunt.loadnpmtasks); grunt.initconfig({ shell: { xpi: { command: [ 'cd plugin
path', 'cfx xpi', 'wget --post-file=pluginname.xpi http://localhost:8888/ || echo>/dev/null' ].join('&&') } }, watch: { xpi: { files: ['plugin
path/**'], tasks: ['shell:xpi'] } } }); grunt.loadnpmtasks('grunt-contrib-watch'); grunt.loadnpmtasks('grunt-shell'); grunt.registertask('default', ['watch']); }; ...
Using third-party modules (jpm) - Archive of obsolete content
modules with jpm. we'll use the menuitem package to add a new menu item to firefox. summary first, while in the root of your add-on, install the package that contains the modules you want to use: npm install menuitem --save now you'll see a new directory in your add-on root called "node_modules" that contains a directory "menuitem". ...
...init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory called "node_modules". the --save argument instructs npm to add this package to the dependencies key in the add-on's package.json file. you'll now see a new directory in "my-menuitem" called "node_modules". it will contain a single directory "addon-
pathfinder", and the modules included in this package will be somewhere in that directory: my-menuitem index.js node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-
pathfinder/lib/ui/menuitem". open "index.js" and replace it with this: var menuitems = require("menuitem"); var menuitem = menuitems.menui...
JS XPCOM - Archive of obsolete content
r access as a service depends on the contract. in order to get an xpcom object you need to know the contract id of the object and the interface that you wish to use on it. creating an instance of a component the preferred method of creating xpcom instances is via the components.constructor helper. ...
...e contract. in order to get an xpcom object you need to know the contract id of the object and the interface that you wish to use on it. creating an instance of a component the preferred method of creating xpcom instances is via the components.constructor helper. for example, var nsfile = components.constructor("@mozilla.org/file/local;1", "nsifile", "initwith
path"); var file = new nsfile(file
path); they can also be created and initialized manually: var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsifile); file.initwith
path(file
path); this creates a new instance of the object with contract id @mozilla.org/file/local;1 and allows you to call methods from the nsifile interface on it. getting an xpcom service var pre...
Miscellaneous - Archive of obsolete content
''; var prng = components.classes['@mozilla.org/security/random-generator;1']; var bytebucket = prng.getservice(components.interfaces.nsirandomgenerator).generaterandombytes(nob, buffer); detecting full screen mode on/off it works for that global 'window' object at least. window.addeventlistener('fullscreen', function(){ alert('fullscreen mode on or off') }, false) getting addon install
path first one using addon manager: components.utils.import('resource://gre/modules/addonmanager.jsm'); addonmanager.getaddonbyid('example@addon', function(addon) { let
path = addon.getresourceuri().
path; // something like /home/username/.... }); example@addon is extension id. another one is to utilize bootstrap.js startup function data argument: function startup(data, reason) { // some co...
... components.utils.import('resource://gre/modules/addonmanager.jsm'); addonmanager.getaddonbyid('example@addon', function(addon) { let
path = addon.getresourceuri().
path; // something like /home/username/.... }); example@addon is extension id. another one is to utilize bootstrap.js startup function data argument: function startup(data, reason) { // some code ... yourmodule(data.install
path.
path); // some code ... } ...
Inline options - Archive of obsolete content
ut to be removed. use this notification to remove event listeners, or any other references that might otherwise be leaked. locating the options file there are two ways to let the add-on manager find your options file: method 1 name the file options.xul and put it in the extension's root folder (alongside install.rdf). this method does not require you to create a chrome.manifest and set it's
path. this method does not require you to specify optionstype in install.rdf. method 2 use install.rdf to identify the xul file used for displaying the options. this requires that you register a content
path in the chrome.manifest. you must also specify the optionstype as 2: <em:optionsurl>chrome://myaddon/content/name_of_my_file_to_use_for_inline_opts.xul</em:optionsurl> <em:optionstype>2</em:opti...
...2 use install.rdf to identify the xul file used for displaying the options. this requires that you register a content
path in the chrome.manifest. ...
Install Manifests - Archive of obsolete content
tionsurl in a new tab (if the application supports that), or a dialog box optionstype defaults to 1 if there is an optionsurl included in install.rdf or 2 if there is no optionsurl and the file options.xul exists in the root of the add-on. <em:optionstype>2</em:optionstype> options can be opened in a new tab since firefox 7.0a1. to do so, set optionstype to 3 and set optionsurl to a the
path of a page to open. <em:optionstype>3</em:optionstype> <em:optionsurl>chrome://myaddon/content/options.html</em:optionsurl> this section here contains an example of localized html page as an option panel in a new tab: bootstrapped extensions :: localization (l10n) (example linked to is: github :: l10n-html-options). optionsurl the chrome:// url of the extension's options dialog box. this is on...
...ile.jar where jarfile.jar is the name of the jar file that contains the chrome package's files. this could also be the name of a directory that contains the chrome package's files, un-jarred (e.g. urn:mozilla:extension:file:directory). in either case, the referenced chrome package file(s) must be placed in the chrome subdirectory of the xpi's top level. this object has a package property (with a
path within the jar file or directory that leads to the location where the contents.rdf file responsible for registering that package is located), a locale property (ditto, but to register the locale) and a skin property (ditto, but to register the theme material). in extensions for firefox 1.5, this property is no longer necessary: the chrome.manifest at the top level of the xpi is used to locate ch...
Setting up an extension development environment - Archive of obsolete content
ly. note: for an extended guide on how to set up even more user profiles, take a look at multiple firefox profiles. this particularly comes in handy for the use of all currently available firefox versions. it even allows the running of simultaneous versions, at the same time. to quickly achieve our task of creating just a developer profile, we will start the application with the parameters: /
path/to/firefox -no-remote -p profilename without these parameters, the default behavior of your mozilla applications is to only open the everyday user profile: named default. as we are specifically defining the user profile dev, if you don't have the dev profile already created, the profile selection window opens, where you can create it. in the following example, the described command starts a new...
...d as the file name (for example "your_profile_directory/extensions/{46d1b3c0-db7a-4b1a-863a-6ee6f77ecb58}"). (how to find your profile directory) alternatively, rather than using a guid, create a unique id using the format "name@yourdomain" (for example chromebug@mydomain.com) - then the proxy filename will be same as that id, with no curly brackets {}. the contents of this file should be the
path to the directory that contains your install.rdf file, for example /full/
path/to/yourextension/ on mac and linux, and c:\full\
path\to\yourextension\ on windows. remember to include the closing slash and remove any trailing whitespace. note: if you already installed the extension via xpi, you should uninstall it first before creating the pointer file. also note that the use of proxy files...
Index of archived content - Archive of obsolete content
console/traceback content/content content/loader content/mod content/symbiont content/worker core/heritage core/namespace core/promise dev/panel event/core event/target frame/hidden-frame frame/utils fs/
path io/byte-streams io/file io/text-streams lang/functional lang/type loader/cuddlefish loader/sandbox net/url net/xhr places/bookmarks places/favicon places/history platform/xpcom preferences/event-target ...
...vg animation svg general scrollbar sidebar stringview tabbox toolbar tree uri parsing view source for xul applications windows xml-related code snippets xml:base support in old browsers x
path getattributens common pitfalls communication between html and your extension creating custom firefox extensions with the mozilla build system custom about: urls default preferences deploying a plugin as an extension developing add-ons displaying web content in an extension without se...
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
cognize xpcom components. you now have information about the plugins directory for gecko embedding browsers. examples given for "product x.y" were using netscape 6 but other possible mozilla based browsers exist as well; all gecko-based browsers are encouraged to write these keys, so that plugin vendors can write plugin installers that install correctly to all gecko-based browsers. to find the
path to the browser executable (exe) applicable to netscape 6.1, 6.2.x, netscape 7.0 (and up), mozilla 1.0, and compuserve 7.0 finding the browser executable is useful if you wish to launch the browser following installation of the plugin dll. go to hkey_local_machine\software\mozilla caveat emptor: if the mozilla subkey is not present under hkey_local_machine, look under hkey_current_user\softwa...
... under hkey_current_user\software also. however, always look at hkey_local_machine first. you can enumerate the application subkeys, e.g. hkey_local_machine\software\mozilla\product x.y\. the keys "product x.y" contain application keys for the given mozilla based browser. example: netscape 6 6.1 look at the bin\ subkey, e.g. hkey_local_machine\software\mozilla\netscape 6 6.1\bin\ access the
pathtoexe value and value-data pair, e.g:
pathtoexe=c:\program files\netscape\netscape 6\netscp6.exe you now have information about the location of the exe on windows for gecko embedding browsers. examples given for "product x.y" were using netscape 6, but other possible mozilla based browsers exist as well; all gecko-based browsers are encouraged to write these keys, so that plugin vendors can writ...
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
rectory, in a file named prefs.js. this is a readable file of javascript commands. all other files in that directory are dynamically created by mozilla on first start. unlike mozilla's binary registry.dat file, thunderbird's and firefox' profiles.ini file is a readable text file. here is an example of what this may look like: [general] startwithlastprofile=1 [profile0] name=default isrelative=1
path=profiles/default.uda if you want to point this to a location of your choice (for example h:\thunderbird), you need to perform to changes: set isrelative to be 0 update the
path to point to the desired place. note: for absolute
paths thunderbird uses dos'ish backslashes (\) rather than unixish slashes (/). you'd obtain a file such as the following: [general] startwithlastprofile=1 [profile0] na...
...f you want to point this to a location of your choice (for example h:\thunderbird), you need to perform to changes: set isrelative to be 0 update the
path to point to the desired place. note: for absolute
paths thunderbird uses dos'ish backslashes (\) rather than unixish slashes (/). ...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
you did not create an empty project) copy the npruntime sample plugin source code into the dir of the new vs project and add the files to the project using the vs gui (.cpp files to "source files", .h files to "header files", .rc file to "resource files"). samples can be obtained from: https://developer.mozilla.org/en/plugins/samples_and_test_cases get the npapi sdk. add the npapi sdk include
path (example : c:\npapi-sdk\headers) to project properties|(all configurations)|c++|general|additional include directories. note: if your project is still empty, the c++ tree might not be visible. so, add some files first. add the following preprocessor definitions to project properties|(all configurations)|c++|preprocessor|preprocessor definitions: win32;_windows;xp_win32;xp_win;_x86_;npsimple_expo...
...ons: win32;_windows;xp_win32;xp_win;_x86_;npsimple_exports disable precompiled headers using project properties|(all configurations)|c++|precompiled headers|create/use precompiled header. they may be already disabled. define the function exports by adding the .def filename (e.g. nprt.def) to project properties|(all configurations)|linker|input|module definition file. it could be either the full
path or the
path relative to the project directory. optional: open the above .def file and change "nprt" to the filename of your dll as vs sees it (without "np", if you decided to rename later) optional: edit the .rc file and and the top of npp_gate.cpp for the description, mimetype, file extension etc. to reflect your plugin remove the function npp_getjavaclass from npp_gate.cpp build rename the...
Building Firefox with Rust code - Archive of obsolete content
you have new rust libraries that code in libxul calls directly, then you should add the appropriate extern crate lines in toolkit/library/rust/shared/lib.rs, and add those libraries (crates) as dependencies in toolkit/library/rust/cargo.toml. ...
...nes in toolkit/library/rust/shared/lib.rs, and add those libraries (crates) as dependencies in toolkit/library/rust/cargo.toml. if you want to call code in the "e10s" crate, you would add: extern crate e10s; to toolkit/library/rust/shared/lib.rs; you would also need to specify the
path to that crate in the dependencies section of toolkit/library/rust/shared/cargo.toml: [dependencies] e10s = {
path = "../../../../
path/from/srcdir/e10s" } the e10s crate must also be checked into the tree at the appropriate
path. if the e10s crate depends on any other crates, their sources must also be checked into the tree, and e10s's cargo.toml must have
path attributes for each of its dependencies, and so on. this is automated by the mach vendor command, which installs the dependencies in third_party/rus...
JSS build instructions for OSX 10.6 - Archive of obsolete content
ing errors. ...
..._8_7_rtm nspr cvs co -r nss_3_12_9_with_ckbi_1_82_rtm nss cvs co -r jss_4_3_2_rtm jss build nss for 32 and 64: cd mozilla/security/nss make nss_build_all cc="gcc -arch i386" ccc="g++ -arch i386" make nss_build_all use_64=1 build jss for 32 and 64: cd ../jss make cc="gcc -arch i386" ccc="g++ -arch i386" make use_64=1 on osx, java.library.
path doesnt seem to have /usr/lib or other
paths. temporal solution: copy libs to java dir /usr/lib/java. setting ld_library_
path didnt work ...
GRE Registration - Archive of obsolete content
ifferently on each operating system. this document describes the registration mechanism. windows on windows, gre registration information is kept in the win32 registry under the hkey_local_machine/software/mozilla.org/gre and hkey_current_user/software/mozilla.org/gre keys. each subkey is searched for gre registration information: hklm/software/mozilla.org/gre/1.8_1 version=1.8 grehome=c:\
path\to\installed-dir feature=value feature2=value2 hklm/software/mozilla.org/gre/1.8_2 version=1.8 grehome=c:\
path\to\second-installation when installing a gre via the mozilla suite gre installer, the installer will blindly overwrite any previous gre information in hklm/software/mozilla.org/gre/<version>. when installing a gre via the command line <tt>xulrunner.exe -register-global</tt>, xu...
... will try alternate keys <version>_1 _2 until an available key is found. mac on mac, the only gre is the libxul framework xul.framework. this framework is installed either in /library/frameworks/xul.framework/versions/<version> or in ~/library/frameworks/xul.framework/versions/<version>. linux on linux, registration information is kept in ini-style files of the following form: [1.7.10] gre_
path=/usr/lib/mozilla-1.7.10 feature=value feature2=value2 these ini files can be in any of the following locations: /etc/gre.conf /etc/gre.d/*.conf ~/.gre.conf ~/.gre.d/*.conf mozilla has never officially shipped a linux gre based on the mozilla suite. however, some linux distributors including red hat/fedora core ship /etc/gre.d/*.conf files with the mozilla suite rpms. xulrunner rpms/post-install ...
GRE - Archive of obsolete content
ll three major platforms (windows, mac, and linux). finding and using a gre from application code avoid linking directly against xpcom.dll if an application wishes to use the gre, it must take careful steps to ensure that it links against the proper libraries. if you link directly against xpcom.dll/libxpcom.so (xpcom.lib import lib), your application will not launch unless xpcom.dll is in your
path. this prevents dynamically finding a compatible gre at runtime. find a compatible gre note: support for locating a standalone glue was removed in gecko 6.0. to find a compatible gre, you should use the function gre_getgre
pathwithproperties() (declared in xpcom/glue/standalone/nsxpcomglue.h). this allows the embedder to specify what version(s) of gre are appropriate, and to specify any specia...
...find a compatible gre (see above). dynamically link to that gre using the xpcomgluestartup() function. see environment variables below. initialize xpcom and do your work; when finished, shut down xpcom. unlink xpcom with xpcomglueshutdown(). dependent libraries and environment variables the xulrunner gre is designed so that the embedder does not need to set any environment variables such as
path or ld_library_
path before calling xpcomgluestartup(), because it dynamically loads the correct dependent libraries. unfortunately, the mozilla suite-based gre is not as forgiving, especially on linux. embedders will need to set the ld_library_
path environment variable and start a new process in order to embed a suite-based gre correctly. ...
Creating a Help Content Pack - Archive of obsolete content
te later. this attribute is optional, with fallback to the value welcome. nc:base contains the base url relative to which the help content referenced in the descriptor file is located. for example, if your glossary, index, and table of contents rdf files are all located at chrome://myapp/locale/help/*, then you could put chrome://myapp/locale/help/ here and use only the actual file names without
path when needed later. you don't actually need this attribute if you don't want it, but it's a useful shorthand to save typing. next, we need to describe where to find the glossary, index, and table of contents. (we're still not actually to the point where we're describing the actual data in each of these, so we'll just use some filler data for now.) add the following code inside the rdf:descriptio...
... the viewer functions. to open the help viewer, run the openhelp() function. it's exactly the same as any javascript command, you you can insert it in command elements, oncommand attributes, and other such places. the parameters are described below: openhelp(atopic, acontentpackspec); atopic: the rdf:id of the topic you want to load as the home page in the help viewer. acontentpackspec: the
path to the content pack you want to load. here is an example of how firefox opens its help documentation: openhelp('firefox-help', 'chrome://browser/locale/help/help.rdf'); packing it all up ...
JavaScript crypto - Archive of obsolete content
() { window.crypto.importusercertificates(nickname, cert, forcebackup); return false; } document.forms[0].onsubmit = loadcertificate; </script> signing text domstring signtext(domstring stringtosign, domstring caoption /* ... */); loading pkcs #11 modules long deletemodule(domstring modulename); long addmodule(domstring modulename, domstring libraryfull
path, long cryptomechanismflags, long cipherflags); loads or removes a new pkcs #11 module. in the add case, the module will be placed in the nss secmod.db database and will be loaded automatically on application restart. in the delete case, the module is removed from the nss secmod.db. this function will issue a user prompt to confirm the operation before the add or de...
...oads or removes a new pkcs #11 module. in the add case, the module will be placed in the nss secmod.db database and will be loaded automatically on application restart. in the delete case, the module is removed from the nss secmod.db. this function will issue a user prompt to confirm the operation before the add or delete actually occurs. parameters modulename name of the module. libraryfull
path the filename of the library prepended with its full
path. cryptomechanismflags a bit vector indicating all cryptographic mechanisms should be turned on by default (see below). cipherflags a bit vector indicating all ssl or s/mime cipher functions supported by the module (see below). mechanism flag definitions in general, most tokens should not set any of the cipher flags. setting these fl...
Enabling Experimental Jetpack Features - Archive of obsolete content
at we're up to next! the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module. in python, you can call from __future__ import foo which adds the functionality that foo yields to the script. in jetpack, we propse adding a new function to the base namespace called importfromfuture. methods import(stringmount
path string)imports the requested experimental feature into the script. stringmount
pathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a list of mount
paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to...
...re is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration). list() arrayreturns an array of the set of potential stringmount
path as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the list is to write it to the console.log. var list = jetpack.future.list();console.log(list); open the firebug console to view. ...
Enabling - Archive of obsolete content
the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module. in python, you can call from __future__ import foo which adds the functionality that foo yields to the script. in jetpack, we propse adding a new function to the base namespace called importfromfuture. methods import(stringmount
path string)imports the requested experimental feature into the script. stringmount
pathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a list of mount
paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the j...
... here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration). list()returns an array of the set of potential stringmount
path as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the list is to write it to the console.log. var list = jetpack.future.list(); console.log(list); open the firebug console to view. ...
Enabling Experimental Jetpack Features - Archive of obsolete content
the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module. in python, you can call from __future__ import foo which adds the functionality that foo yields to the script. in jetpack, we propse adding a new function to the base namespace called importfromfuture. methods import(stringmount
path string)imports the requested experimental feature into the script. stringmount
pathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a list of mount
paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the j...
...e is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration). list() arrayreturns an array of the set of potential stringmount
path as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the list is to write it to the console.log. var list = jetpack.future.list(); console.log(list); open the firebug console to view. ...
Modularization techniques - Archive of obsolete content
t in use static nsresult freelibraries(); }; there are several ways a factory can make its way into the repository. the most direct is through registerfactory(). registerfactory() supports two different registration mechanisms. the first takes a class id and a pointer to a factory. this mechanism can be used on factories that are linked into the executable. the second takes a class id and the
path to a dynamically loadable library. this mechanism can be used both inside an executable at run-time and externally using the apersist flag to tell the repository to store the class id/library relationship in its permenant store. about nsiids and nscids to simplify the process of dynamically finding, loading and binding interfaces, all classes and interfaces are assigned unique ids. the ids are ...
... sample->hello(); ns_release(sample); } return 0; } registering a dll this is currently being hashed out. you can currently manually register a dll using the nsrepository's registerfactory() method (for an example of this, see nssample2.cpp). a dll can export two additional functions for self registration and unregistration. extern "c" ns_export nsresult nsregisterself(const char *
path); extern "c" ns_export nsresult nsunregisterself(const char *
path); this allows a dll to register and unregister all its factories. a simple program called regfactory.exe (on windows) or regfactory (on unix) can be used to register self-registering dlls. reference counting basics reference counting is a critical part of modularity picture. there are a number of basic reference counting rules ...
Overview of how downloads work - Archive of obsolete content
there are two ways of downloading files in mozilla. one way is to encounter a file with an unknown content type, the other is to choose "save link target as" from the context menu of a link. things like file|save page as, save image as, etc. are all part of the second code
path. this document describes both code
paths (see below for the second one). click on the images to display them "stand-alone" in the browser, which may resize them to fit the browser window. ...
...hem "stand-alone" in the browser, which may resize them to fit the browser window. ...
File object - Archive of obsolete content
r (stderr). file.currentdir a file object referring to the current directory; this property may be set. file.separator the system name separator (slash on unix). instance properties file.length the length of the file in bytes, or the number of entries in the directory. note: calculating the length of the directory is very expensive. file.parent the directory containing the file. file.
path the canonical
path to the file. file.name the name of the file. file.isdirectory true if the file is a directory. file.isfile true if the file is a file. file.exists true if the file exists. file.canread true if the file can be read. file.canwrite true if the file can be written. file.canappend true if the file is in append mode. file.canreplace true if the file is in replace mod...
...tics as writeln. file.list() get a list of files, potentially matching a regular expression filter, from the file. only has meaning when the file is a directory. file.mkdir() create a directory. directory will be created in the same directory as the file, unless the file is a directory, in which case, the directory will be created in that directory. xxx file.tostring() returns the canonical
path to the file. file.tourl() returns a file:// url describing the file relative to the local file system. url is uri-encoded. examples example: hello, world file.output.writeln("hello, world"); example: writing a new file var file = new file("myfile.txt"); file.open("write,create", "text"); file.writeln("the quick brown fox jumped over the lazy dogs"); file.close(); example: reading from a ...
Standalone XPCOM - Archive of obsolete content
tion and a component. this should get built by default. nstestsample is the sample application. this should have been installed in your bin/ directory. libsample.so (unix) is the sample component implementation that the sample application will try to instantiate. this should have been installed in your bin/components directory to run the test, cd to your bin/ directory setenv ld_library_
path . ./nstestsample warning: mozilla_five_home not set. nsnativecomponentloader: autoregistering begins. nsnativecomponentloader: autoregistering succeeded inital print: initial value set value to: xpcom defies gravity final print : xpcom defies gravity test passed. test failed: what went wrong? the most common case of why the sample would have failed if you didn't run it from the ...
...ies gravity final print : xpcom defies gravity test passed. test failed: what went wrong? the most common case of why the sample would have failed if you didn't run it from the bin directory. here are some error messsages and possible ways of fixing them. ./nstestsample: error in loading shared libraries: libxpcom.so: cannot open shared object file: no such file or directory ld_library_
path not set. to fix, setenv ld_library_
path . (note the dot). link errors when building xpcom standalone this is usually due to xpcom not being built standalone. make sure you did configure --enable-standalone-modules=xpcom. what's the difference between standalone and non-standalone xpcom? there is no binary difference between standalone xpcom and the xpcom that ships with the mozilla browser. ...
Anonymous Content - Archive of obsolete content
ed if they are found on the primary generating binding. explicit insertion points on other bindings are ignored. inherited insertion points are used to place the anonymous content generated by the next binding in the chain that contributes anonymous content. that binding can define inherited insertion points for its base binding as well. this pattern continues all the way up the binding chain. x
path selectors specified using the includes attribute determine which insertion point a given child should be placed under. [actually, only tag names may be specified; see the includes attribute description in <children> element reference, bug 174614 and bug 51527.] if no attribute is specified, an insertion point is considered generic and will match on all content. the insertion point used for a giv...
...ldren. see insertion points for more information. in this situation, a new tree emerges that is different from the explicit content node tree. in addition to having a single explicit parent (the bound element) the explicit children also have an arbitrary set of anonymous parents (created by bindings when child insertion points were used). child, descendant, and sibling selectors will match on any
path of anonymous and explicit elements. as far as css is concerned, anonymous content nodes are children (or descendants) of the bound element, they are ancestors of explicit content, and they are siblings of the explicit content. style rules using the child, descendant, or sibling selectors transparently cross bind scopes and operate on the altered and original content models. the final modified c...
Windows stub installer - Archive of obsolete content
o to mozilla/xpinstall/wizard/windows/builder on the shell prompt type "perl build.pl". now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/dist/win32_d.obj/install. run the stub installer setup.exe from the install directory. ...
...". now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/dist/win32_d.obj/install. run the stub installer setup.exe from the install directory. ...
modDate - Archive of obsolete content
returns a double number representing the date that the file was last modified. ...
... returns a double number representing the date that the file was last modified. ...
windowsGetShortName - Archive of obsolete content
summary returns a
path that conforms to the windows 8.3 file naming convention. method of file object syntax string windowsgetshortname( object localdirspec ) parameters the windowsregisterserver method has the following parameter: localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder. returns a string with the windows shortname. if the
path already conforms to 8.3, the return value is null. ...
...hod of file object syntax string windowsgetshortname( object localdirspec ) parameters the windowsregisterserver method has the following parameter: localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder. returns a string with the windows shortname. if the
path already conforms to 8.3, the return value is null. example flongfile
path = getfolder(fprogram, "longfilename.file"); sshortfile
path = file.windowsgetshortname(flongfile
path); if(sshortfile
path) { // do something } ...
initInstall - Archive of obsolete content
displayname, string package, string version); int initinstall ( string displayname, string package, installversion version); parameters the initinstall method has the following parameters: displayname a string that contains the name of the software being installed. the name of the software is displayed to the user. ...
...eters: displayname a string that contains the name of the software being installed. the name of the software is displayed to the user. package the client version registry
pathname for the software (for example: plugins/adobe/acrobat or /royalairways/royalpi/). it is an error to supply a null or empty name. the name can be absolute or relative. a relative
pathname is relative to the netscape 6 namespace. a relative
pathname must start with plugins/, to be relative to the plug-ins portion of that namespace or java/download/, to be relative to the java portion. all other parts of the netscape 6 area of the registry are reserved for use by netscape. the client version registry is a hierarchical description of the software registered for use with ne...
Return Codes - Archive of obsolete content
or the file (and, therefore, its certificate) could not be found. no_matching_certificate -206 extracted file was not signed by the certificate used to sign the installation script cant_read_archive -207 xpi package cannot be read invalid_arguments -208 bad parameters to a function illegal_relative_
path -209 illegal relative
path user_cancelled -210 user clicked cancel on install dialog install_not_started -211 a problem occurred with the parameters to initinstall, or initinstall was not called first silent_mode_denied -212 the silent installation privilege has not been granted. no_suc...
...its permissions are set to read only. is_directory -216 the specified file cannot be deleted because it is a directory. network_file_is_in_use -217 the specified file cannot be deleted because it is in use. apple_single_err -218 an error occurred when unpacking a file in applesingle format. invalid_
path_err -219 the
path provided to getfolder was invalid. patch_bad_diff -220 an error occurred in gdiff. patch_bad_checksum_target -221 the checksum generated for the source file does not match the checksum in the xpi file. patch_bad_checksum_result -222 the checksum of the patched file failed. ...
Index - Archive of obsolete content
ample xul, xul_template_guide no summary! 941 simple query syntax xul, xul_template_guide no summary! 942 sorting results xul, xul_template_guide when results are generated from a query, content is generated in the same order as the results. for an xml datasource, generated content will be output in the order corresponding to the results of the x
path query expression. for an sqlite datasource, the generated content corresponds to the order of results of the sql query. for an rdf datasource, again, the results are in the order the query generates them, although except in the case of an rdf seq, this order is arbitrary as rdf triples don't occur in any particular order. when the reference node is an rdf seq container and the results are in that...
...of the template. this is usually used to generate content in a tree or menu. both the rdf and xml datasource types support recursion. for example, using this xml datasource: 950 xml assignments xul, xul_template_guide no summary! 951 xml templates xul, xul_template_guide mozilla also supports the use of xml datasources. an xml document will be loaded and x
path expressions may be used to take portions of the xml document and generate content from these. when an xml source is desired, specify a querytype attribute on the root node of the template to the value xml. this indicates to the template builder that an xml source is being used as that the queries use syntax that is specific to xml. 952 textbox (xpfe autocomplete) xul elements, xul ...
Using Recursive Templates - Archive of obsolete content
ery: <query expr="group/person/"> or, we could display one level for the two groups, and use another level for each person. <groupbox type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <action> <vbox uri="?" class="indent"> <label value="?name"/> </vbox> </action> </template> </groupbox> in this simplified example, the x
path expression just gets the list of child elements of the reference node. for the outermost iteration, a vbox is created with a child label. since the initial reference node is the root of the xml source document, the results are two elements, one for each group element. however, a further step is done to retrieve an additional level of nodes. as each group has children itself, each result (in this ...
...to provide a different appearance for containers with children, empty containers, as well as non-containers. in this example, both the parent groups and child people are displayed the same. you could use multiple rules as well, in order to generate different output for each level. in this next example, an assign element is used to assign the local name of the node is to the variable ?type. in an x
path expression, the period refers to the context node. for an assign element, the context is the the result node. the local-name function retrieves the tag of the element without the namespace prefix. in this case, there isn't a namespace prefix, so the name function could be used instead. <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"> <assign var="?ty...
XML Assignments - Archive of obsolete content
« previousnext » sometimes, you will want to use a more complex substitution apart from just taking an attribute from the xml. for instance, you might want to display not the name of a person, but the length of their name. x
path provides syntax to retrieve this using the built-in string-length method. however, you cannot use a expression that returns a number in the query, as the query must return dom nodes as results. in this case, we use an expression that returns the nodes as in earlier examples, and use some additional syntax of the query to get the length of the names. to do this, we use an additional element, the assign element. this element allows the use of additional x
path expressions to get more data from the xml data. here is an example: <vbox datasources="people.xm...
... <hbox uri="?" align="center"> <button label="?name"/> <label value="?gender"/> <label value="?namelength"/> <label value="?siblings"/> </hbox> </action> </template> </vbox> two assign elements are placed as children of the query element. it allows us to declare additional variables that may be used in the action body. the expr attribute specifies the x
path expression and the var attribute specifies the variable to assign to. note that while the query expression uses the root node (or reference node) as the x
path context, the expressions for the assign element are evaluated using each result node as the context. for each result, the ?namelength variable will be assigned the length of the name attribute on the result node, and the ?siblings variable ...
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
put in just now. see, it all balances out in the end! building with a prebuilt sdk once you've downloaded the xulrunner sdk, you'll need a .mozconfig of your own. here's an example for mccoy: # options for client.mk. mk_add_options moz_co_projects=browser mk_add_options moz_objdir=@topsrcdir@/../mccoybase # options for 'configure' (same as command-line options). ac_add_options --with-libxul-sdk=/
path/to/xulrunner-sdk ac_add_options --enable-application=mccoy you still need to get the mozilla source code and put your project in a subdirectory underneath the mozilla root. of course, you only really need the mozilla build system since all the other mozilla files are in the xulrunner sdk, and there is a bug filed to make it possible to check out the build system only. okay, okay, can i build it ...
...is used for content/, skin/ and locale/. this also means that you will need to put a makefile in each directory. if you're lazy like me, you can also use one big jar manifest in the chrome/ directory, which means you don't need to put makefiles in the chrome subdirectories either. you can make this jar.mn to rule them all just by concatenating the three files in the mccoy example and updating the
path to each file (since you will need to point to the correct subdirectory): mccoy.jar: % content mccoy %content/ * content/mccoy.xul (content/mccoy.xul) content/mccoy.js (content/mccoy.js) * content/mccoy.xml (content/mccoy.xml) ...etc... note that the locale manifest uses a variable to specify the name of the locale which has to be defin...
Deploying XULRunner - Archive of obsolete content
pplication files such as icons, etc myapplicationname.exe (this is the "stub executable"... you should copy and rename this file from xulrunner-stub.exe in your xulrunner installation.) xulrunner/ ... copy xulrunner/ to this directory when deploying with xulrunner 2.0 and above do the following: move chrome.manifest to the root directory, and adjust resource
paths inside chrome.manifest accordingly with xulrunner 9.0 or 10.0 you may need to copy "mozutils.dll" and/or "mozcrt19.dll" from the xulrunner directory to the root directory. this should be fixed with xulrunner 11.0 with xulrunner 11.0 you may need to copy "gkmedias.dll" from the xulrunner directory to the root directory mac os x on mac os x, the exact layout of your application b...
...art of the application ... additional application files such as icons, etc macos/ xulrunner (this is the "stub executable"... you should copy this file from /library/frameworks/xul.framework/versions/1.8/xulrunner.) when deploying with xulrunner 2.0, move chrome.manifest to the root directory, and adjust resource
paths inside chrome.manifest accordingly. additionally, your mac app will not run without a valid info.plist file. here's a sample one: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>cfbundledevelopmentregion</key> <string>english</string> <key>cfbundleexecutabl...
XULRunner tips - Archive of obsolete content
alternatively, the dom inspector may also be added as an extension: (if you already have inspector installed for another application you can skip to the next step) follow the instructions above through "unzip the package." create a file in the extensions directory of your application with the same name as the dom inspector id (inspector@mozilla.org) containing one line of text -- the exact
path to the root directory of dom inspector (where the install.rdf is) like this one: /home/username/.mozilla/firefox/numbersandletters/extensions/inspector@mozilla.org/ now create a javascript file with the following code and include it in the main window of your application: function startdomi() { // load the window datasource so that browser windows opened subsequent to dom // inspector ...
...e login manager service, which internally initializes the system: components.classes["@mozilla.org/login-manager;1"].getservice(components.interfaces.nsiloginmanager); using firefox to run xulrunner applications firefox 3 and up contain the xulrunner runtime. it has an -app command-line switch to run a specified xul application instead of starting the browser. on windows: firefox.exe -app
path\to\application.ini on linux: firefox -app
path/to/application.ini on the mac: /applications/firefox.app/contents/macos/firefox-bin -app /
path/to/application.ini note that at least on the mac, you need to use a full
path. partial
paths don't seem to work. troubleshooting window title missing if the title of your xul <window> is blank, even though you specified a title attribute, make...
mozilla.dev.platform FAQ - Archive of obsolete content
then unpack the xul app into the mac structure with xulrunner -install-app q: can you build xulrunner with newer (>1.5) features, such as storage? a: xulrunner trunk and 1.8 (but not 1.8.0) build storage by default, and anything can be built with storage if you put in you <tt>mozconfig --enable-storage</tt> q: program received signal exc_bad_instruction, illegal instruction/operand. ...
...tt>mozconfig --enable-storage</tt> q: program received signal exc_bad_instruction, illegal instruction/operand. 0x00016b50 in xre_createappdata () a: when you <tt>--disable-libxul</tt>, the xpcom glue doesn't have information about how to load all the dependent libraries like <tt>libgfx.dylib</tt>. in order to use xr successfully in <tt>--disable-libxul</tt> mode, you have to setup dyld_library_
path to include <tt>/library/frameworks/xul.framework/versions/1.9a1</tt> - benjamin smedberg, fri, oct 20 2006 9:12 am q: when i try to build a completely standalone xul app on os x (10.4.8). took an foo.app directory created with xulrunner-bin --install-app and tried to copy (using rsync -rl) the xul.framework directory into a frameworks directory in the .app bundle and then deleting the xul.frame...
NPN_PostURL - Archive of obsolete content
the following parameters: instance pointer to the current plug-in instance. url url of the request, specified by the plug-in. target display target, specified by the plug-in. if null, pass the new stream back to the current plug-in instance regardless of mime type. for values, see npn_geturl. len length of the buffer buf. buf
path to local temporary file or data buffer that contains the data to post. temporary file is deleted after use. data in buffer cannot be posted for a protocol that requires a header. file a boolean value that specifies whether to post a file. values: true: post the file whose
path is specified in buf, then delete the file. false: post the raw data in buf. retur...
...ow. you can also write the response data to a frame by specifying the frame name as the target parameter. for http urls only, the browser resolves this method as the http server method post, which transmits data to the server. the data to post can be contained either in a local temporary file or a new memory buffer. to post to a temporary file, set the flag file to true, the buffer buf to the
path name string for a file, and len to the length of the
path string. the file-type url prefix "file://" is optional. ms windows and os x if a file is posted with any protocol other than ftp, the file must be text with unix-style line breaks ('\n' separators only). to post data from a memory buffer, set the flag file to false, the buffer buf to the data to post, and len to the length of buffer. ...
NPP_NewStream - Archive of obsolete content
nes the mode of the stream. values: np_normal (default): delivers stream data to the instance in a series of calls to npp_writeready and npp_write. the plug-in can process the data progressively as it arrives from the network or file system. np_asfileonly: the browser saves stream data to a file in the local cache. when the stream is complete, the browser calls npp_streamasfile to deliver the
path of the file to the plug-in. if the stream comes from a local file, the npp_write and npp_writeready functions are not called. npp_streamasfile is simply called immediately. this mode allows the plug-in full random access to the data using platform-specific file operations. np_asfile: file download. differs from np_asfileonly in that data is delivered to the plug-in, through a series of calls to ...
... immediately. this mode allows the plug-in full random access to the data using platform-specific file operations. np_asfile: file download. differs from np_asfileonly in that data is delivered to the plug-in, through a series of calls to npp_writeready and npp_write, as it is saved to the file (as in mode np_normal). when the stream is complete, the browser calls npp_streamasfile to deliver the
path of the file to the plug-in. if the data in the stream comes from a file that is already local, the data is read, sent to the plug-in through npp_write, and written to a file in the local cache. note: most plug-ins that need the stream saved to a file should use the more efficient mode np_asfileonly (above); this mode is preserved for compatibility only. np_seek: stream data is not automati...
Solaris 10 Build Prerequisites - Archive of obsolete content
anyway. run . /opt/jdsbld/bin/env.sh to import the jds cbe settings into your environment. build environment 1. install sun studio 12 or sun studio 11 with a patch to avoid a compiler bug. 2. install cbe. make some changes to /opt/jdsbld/bin/env.sh. --- env.sh.orig tue jul 1 02:38:35 2008 +++ env.sh tue jun 24 01:08:01 2008 @@ -95,7 +95,8 @@ echo setting ld=$ld export ld -
path="$cbe_prefix/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/bin:/usr /sfw/bin:$ccdir" +
path="/opt/sfw/bin:$cbe_prefix/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/s bin:/bin:/usr/sfw/bin:$ccdir" test "x$jds_cbe_env_quiet" != x1 && \ echo setting
path=$
path export
path +export pkg_config_
path=/opt/sfw/lib/pkgconfig:/usr/lib/pkgconfig 3. replace the commands in cbe that don't work on...
...e extra spec file tarball to the spec file directory. % cd gnome-2-20 % gtar jxvf firefox-solaris-10-spec.tar.bz2 6. unpack the patch tarball to the patches directory. % cd gnome-2-20/patches % gtar jxvf firefox-3.0-solaris-10-patches.tar.bz2 7. build pkg-config and gtk-doc from source. just unpack the source tarball, run "./configure --prefix=/opt/sfw", make and make install. add /opt/sfw/bin to
path environment after installation. 8. build glib/atk/cairo/pango/gtk2/dbus/dbus-glib/firefox. % . /opt/jdsbld/bin/env.sh % pkgtool --download build-only -v solaris10/sfw{name1}.spec % pkgadd -d . {package_name1} % pkgadd -d . {package_name1}-devel % pkgtool --download build-only -v solaris10/sfw{name2}.spec % pkgadd -d . {package_name2} % pkgadd -d . {package_name2}-devel ...... ...
Browser Detection and Cross Browser Support - Archive of obsolete content
simple tests. introduction in an ideal world, we could author html, xml, css and javascript and only worry about the w3c and ecma standards. however, we don't quite live in such a world yet. due to bugs, incomplete implementations of the standards and legacy browsers, web developers must be able to determine which browser a visitor is using and provide the appropriate content and scripting code
path. although browser detection is perhaps the most common scripting task that every web developer faces, it seems that the variety of different strategies in use for detecting browsers is unlimited. as a member of the netscape evangelism team who has spent over a year investigating existing web content, i can say without a doubt that most compatibility problems found on the web today are due to a l...
...ion browsers) to standards mode (which more strictly adhers to the standards). for new content, we recommend that you use a doctype which will invoke standards mode in gecko and internet explorer 6. this will ensure that your designs work similarly in these browsers as well as in any other browsers which support the standards. provide support for unknown browsers always provide content and code
paths for unknown browsers. the recommended approach is to assume that any unknown browser supports the basic standards of html and css and to a certain extent javascript and the w3c dom. this will guarantee that your content will be supported today and in the future by any browser which supports the standards. limit the use of vendor/version specific features authoring content which is standards co...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
this first example we’ll demonstrate is querying a mysql database for some employee contact information. it is assumed that you have already downloaded, extracted, and consumed the necessary documentation to get up and running with some basic rhino scripts. if you don’t already have it, you’ll need to also download the jdbc driver for mysql, extract the class files, and include the
path in your class
path environment variable. the code in listing 1 is a sample javascript script which incorporates java classes to handle the database query. listing 1 - querying a mysql database from rhino // import the java sql packages importpackage( java.sql ); // load the mysql driver java.lang.class.forname( "com.mysql.jdbc.driver" ); // create connection to the dat...
...b, file io, css, server sessions, e4x, etc...] this is a great advantage to the developer as it presents a consistent server-side and client-side development environment for both browser and server contexts that is centered on open source and web standards. also since you know which engine you're targeting, you're free to confidently use advanced built in controls such as xml processing via e4x, x
path, and xslt. let's take a tour through some of the top features of jaxer through code examples. jaxer – server-side ajax via the firefox browser engine on the server although server-side javascript is not a new concept, jaxer implements it in a unique fashion. by taking advantage of current scriptmonkey and ajax capabilities not to mention the loads of other features ...
Implementation Status - Archive of obsolete content
6.1.6 constraint supported 6.1.7 p3ptype unsupported 279049; 6.2.1 atomic datatype partial we will support simpletype's using length, minlength, maxlength, pattern, maxinclusive, mininclusive, maxexclusive, minexclusive, totaldigits, and fractiondigits 7. ...
...orted 279049; 6.2.1 atomic datatype partial we will support simpletype's using length, minlength, maxlength, pattern, maxinclusive, mininclusive, maxexclusive, minexclusive, totaldigits, and fractiondigits 7. ...
Mozilla XForms User Interface - Archive of obsolete content
alues (see the spec). message used in combination with event listeners to display a message to the user when the specified event occurs (see the spec). xforms user interface these elements are mainly used to organize and manage the form's markup. they can be bound to instance nodes to define context for the xforms controls that they contain, should any of their child nodes happen to use relative x
path expressions. binding these elements to instance data is also a way to apply model item properties (for example, relevancy) to the elements. elements in this section do not have any behaviors that are dependent on the host language. group this element is used to logically group xforms elements together (see the spec). switch this element is used in conjunction with case and toggle elements (see th...
...ement is used (as an event handler) to make a case visible and thereby hiding all other case elements contained by the same switch. repeat a repeat element contains markup and is itself bound to a nodeset in an instance document (see the spec). for each node in the nodeset, the contents of the repeat element will be displayed in the form. that node will serve as the context node for any relative x
path expressions in that set of repeated markup. for example, if a repeat is bound to a nodeset that contains 5 nodes and the repeat contains an output element that echoes the current node, then the user will see 5 outputs in the form. combined together, these outputs would echo the value of every node in the selected nodeset. ...
XForms - Archive of obsolete content
ed since it could be removed at any time. try to avoid using it. note: support for xforms was removed from firefox in firefox 19. see the html forms guide for approaches to creating forms in html5. xforms essentials an online book giving you a guided tour of xforms. xforms were envisioned as the future of online forms as envisioned by the w3c. drawing on other w3c standards like xml schema, x
path, and xml events, xforms tried to address some of the limitations of the current html forms model. however, xforms never gained traction and is now considered obsolete. other strengths that xforms brings to the table is the separation of data from presentation, strong data typing, the ability to submit xml data to servers instead of name/value pairs, and a descriptive way to author forms so that t...
...er interface elements documentation. ...
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
s settling on a standard that has a potential for long-term use. an organization must have the assurance that the standard they choose to incorporate into their development process will be relevant in the future. in other words, there must be long-term potential. a fundamental mistake that many organizations make is to use proprietary methods, software, code, or standards. following a proprietary
path has led many organizations down disastrous
paths. case in point: xerox corporation. xerox was clearly ahead of their time in the early 1980’s when they designed and developed the star office system. it was an elegant workstation with an iconic desktop developed by the engineers at parc (palo alto research center). the star office system offered functionality that neither microsoft nor apple ha...
... standard. following proprietary de facto standards leaves an organization vulnerable and open to obsolescence when the owner of the de facto changes focus or direction, or abandons the de facto altogether and renders the standard stagnate. on the other hand, by adopting open technology standards and participating in the development and direction of those standards, an organization is providing a
path for future development, growth and revenue. original document information author(s): beth epperson last updated date: 7 november 2014 ...
Examples - Game development
metric mmorpg with similarities to runescape classic and ultima. katan.io html5 and canvas implementation of settlers of catan. pyramid solitaire ancient egypt pyramid solitaire app ported to webassembly with emscripten assorted demos wavegl webgl visualizer for sound sources. canvas airport simulation animated map showing planes taking off and landing at airports, along with flight
path patterns. animation physics 3d rendering of terrain and cars, using ammo.js for the physics calculations. volumetric particle flow physics simulation of flowing liquid. explosion and chain reaction exploding particles that set off other explosions. canvas generated planet a planet with orbiting asteriod belt. digital fireworks animated firework effects rendered on canvas. autumn falli...
...owd of people all trying to reach their opposite positions. svg masking experiment an xray machine, creating using an svg mask. realistic water simulation flowing water, like the waves on the ocean. dungeon demo haxor-based dungeon scene with walkable character. massive assault tech demo rendered archipelago with futuristic military vehicles. flight stream 3d globe with simulated flight
paths. webgl filters demo showing webgl filters being used to add effects to html elements. svg isometic tiles generating isometric tiles with svg matricies. threejs app player a player into which you can load and run three.js examples. ...
Game monetization - Game development
the technology is mature enough; now it's just about chosing the right approach. paid games the first, most obvious choice that may come to your mind might be selling the games the way it is done for huge aaa titles — with a fixed, up front price. ...
... ...
Visual-js game engine - Game development
2d part only) : windows gui application version 1.0 (using visual-js 0.9 lib) important : you will need net 4.5.2 minimum also redistribution pack for c++ how to start project ? ...
...r with ctrl+s before testing in browsers. adding new script explanation : after adding new script and save script if you have extra changes , open starter/run.js and you will found line : sys.script.load("scripts/new_script.js") ctrl+s use from menu run->choose browser for testing . - important safari not working at the moment chrome , firefox , opera tutorial - pencil (animation
path) : how to use pencil tool to create
path object .
path object can be saved intro localhost , you can collect object and put it direct source code . file location : starter/templates/
paths.js templetes are made from visual-js core also . see source code :
paths.js see the pen visual js - pencil by visualjs game engine (@zlatnaspirala) on codepen. online demo examples at : https://jsfi...
Visual typescript game engine - Game development
n = false; networking is disabled by default. find configuration at ./src/lib/client-config.ts /** * addson * all addson are ansync loaded scripts. * - cache is based on webworkers. * - hackertimer is for better performace also based on webworkers. * - dragging is script for dragging dom elements. */ private addson: addson = [ { name: "cache", enabled: true, script
path: "externals/cacheinit.ts", }, { name: "hackertimer", enabled: true, script
path: "externals/hack-timer.js", }, { name: "dragging", enabled: true, script
path: "externals/drag.ts", }, ]; /** * @description this is main coordinary types of positions * can be "diametric-fullscreen" or "frame". * @property drawreference * @type s...
...| | ├── server.ts | | ├── connector.ts | | ├── self-cert/ server part installed database: mongodb@3.1.8 -no typescript here, we need to keep state clear no. node.js is the best options. for email staff, i choose: npm i gmail-send. -run services database server (locally and leave it alive to develop process): npm run dataserver looks like this : mongod --db
path ./server/database/data fix: "failed: address already in use" : netstat -ano | findstr :27017 taskkill /pid typeyourpidhere /f also important "run visual studio code as administrator". - a command for killing all node.js process for window users : taskkill /im node.exe /f networking multimedia communication: websocketserver running on node.js text-based protocol sip (session initiat...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
return false; break; } request.send(null); if((request.status === 200 || request.status === 0) && request[responsetype] !== null) { response = request[responsetype]; if (responsetype === 'responsexml') { // apply xpointer (only x
path1() subset is supported) var responsenodes; if (xpointer) { var x
pathresult = response.evaluate( xpointer, response, ...
... if (xpointer) { var x
pathresult = response.evaluate( xpointer, response, null, x
pathresult.ordered_node_snapshot_type, null ); var a = []; for(var k = 0; k < x
pathresult.snapshotlength; k++) { a[k] = x
pathresult.snapshotitem(k); ...
Web fonts - Learn web development
sy and simple, like fonts. open up the stylesheet.css file and copy both the @font-face blocks contained inside into your web-font-start.css file — you need to put them at the very top, before any of your css, as the fonts need to be imported before you can use them on your site. each of the url() functions points to a font file that we want to import into our css — we need to make sure the
paths to the files are correct, so add fonts/ to the start of each
path (adjust as necessary). now you can use these fonts in your font stacks, just like any web safe or default system font. for example: font-family: 'zantrokeregular', serif; you should end up with a demo page with some nice fonts implemented on them. because different fonts are created at different sizes, you may have to adjus...
...ed to as "bulletproof @font-face syntax", after a post by paul irish from early on when @font-face started to get popular (bulletproof @font-face syntax). let's go through it to see what it does: font-family: this line specifies the name you want to refer to the font as. you can put this as anything you like, as long as you use it consistently throughout your css. src: these lines specify the
paths to the font files to be imported into your css (the url part), and the format of each font file (the format part). the latter part in each case is optional, but it is useful to declare it because it allows browsers to find a font they can use faster. multiple declarations can be listed, separated by commas — the browser will search through them and use the first one it can find that it underst...
Front-end web developer - Learn web development
simply work through each section, learning new skills (or improving existing ones) as you go along. each section includes exercises and assessments to test your understanding before you move forward. ...
...e you don't understand something, or some code is just not working. don't panic. we all get stuck, whether we are beginner or professional web developers. the learning and getting help article provides you with a series of tips for looking up information and helping yourself. if you are still stuck, feel free to post a question on our discourse forum. let's get started. good luck! the learning
pathway getting started time to complete: 1.5–2 hours prerequisites nothing except basic computer literacy. how will i know i'm ready to move on? there are no assessments in this part of the course. but make sure you don't skip. it is important to get you set up and ready to do work for exercises later on in the course. guides installing basic software — basic tool setup (15 min read) b...
HTML basics - Learn web development
nt to show to web users when they visit your page, whether that's text, images, videos, games, playable audio tracks or whatever else. images let's turn our attention to the <img> element again: <img src="images/firefox-icon.png" alt="my test image"> as we said before, it embeds an image into our page in the position it appears. it does this via the src (source) attribute, which contains the
path to our image file. we have also included an alt (alternative) attribute. in this attribute, you specify descriptive text for users who cannot see the image, possibly because of the following reasons: they are visually impaired. users with significant visual impairments often use tools called screen readers to read out the alt text to them. something has gone wrong causing the image not to di...
...(alternative) attribute. in this attribute, you specify descriptive text for users who cannot see the image, possibly because of the following reasons: they are visually impaired. users with significant visual impairments often use tools called screen readers to read out the alt text to them. something has gone wrong causing the image not to display. for example, try deliberately changing the
path inside your src attribute to make it incorrect. if you save and reload the page, you should see something like this in place of the image: the keywords for alt text are "descriptive text". the alt text you write should provide the reader with enough information to have a good idea of what the image conveys. in this example, our current text of "my test image" is no good at all. a much better ...
Images in HTML - Learn web development
with captions, and how html images relate to css background images. how do we put an image on a webpage? in order to put a simple image on a webpage, we use the <img> element. this is an empty element (meaning that it has no text content or closing tag) that requires a minimum of one attribute to be useful — src (sometimes spoken as its full title, source). the src attribute contains a
path pointing to the image you want to embed in the page, which can be a relative or absolute url, in the same way as href attribute values in <a> elements. note: you should read a quick primer on urls and
paths to refresh your memory on relative and absolute urls before continuing. so for example, if your image is called dinosaur.jpg, and it sits in the same directory as your html page, you could...
....jpg, the browser wouldn't display the image, and would display the alt text instead: so, why would you ever see or need alt text? it can come in handy for a number of reasons: the user is visually impaired, and is using a screen reader to read the web out to them. in fact, having alt text available to describe images is useful to most users. as described above, the spelling of the file or
path name might be wrong. the browser doesn't support the image type. some people still use text-only browsers, such as lynx, which displays the alt text of images. you may want to provide text for search engines to utilize; for example, search engines can match alt text with search queries. users have turned off images to reduce data transfer volume and distractions. this is especially common on m...
Test your skills: Multimedia and embedding - Learn web development
the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. multimedia and embedding 1 in this task we want you to embed a simple audio file onto the page. you need to: add the
path to the audio file to an appropriate attribute to embed it on the page. the audio is called audio.mp3, and it is in a folder inside the current folder called media. add an attribute to make browsers display some default controls. add some appropriate fallback text for browsers that don't support <audio>. try updating the live code below to recreate the finished example: download the starti...
...ur own editor or in an online editor. multimedia and embedding 2 in this task we want you to mark up a slightly more complex video player, with multiple sources, subtitles, and other features besides. you need to: add an attribute to make browsers display some default controls. add some appropriate fallback text for browsers that don't support <video>. add multiple sources, containing the
paths to the video files. the files are called video.mp4 and video.webm, and are in a folder inside the current folder called media. let the browser know in advance what video formats the sources point to, so it can make an informed choice of which one to download ahead of time. give the <video> a width and height equal to its intrinsic size (320 by 240 pixels). make the video muted by default. di...
Client-side storage - Learn web development
here we first grab ...
...mise fulfills, the service worker is deemed registered. // register service worker to control making site work offline if('serviceworker' in navigator) { navigator.serviceworker .register('/learning-area/javascript/apis/client-side-storage/cache-sw/video-store-offline/sw.js') .then(function() { console.log('service worker registered'); }); } note: the given
path to the sw.js file is relative to the site origin, not the javascript file that contains the code. the service worker is at https://mdn.github.io/learning-area/javascript/apis/client-side-storage/cache-sw/video-store-offline/sw.js. the origin is https://mdn.github.io, and therefore the given
path has to be /learning-area/javascript/apis/client-side-storage/cache-sw/video-store-offline/sw.js. if yo...
Aprender y obtener ayuda - Learn web development
can't really engage in both ways of learning — or thinking — at once. so which one should you choose? you might think that focused learning is better for studying, but in reality, both are very important. focused thinking is great for concentrating hard on specific subjects, getting into deep problem solving, and improving your mastery of the techniques required — strengthening the neural
pathways in your brain where that information is stored. it isn't however very good at getting an understanding of "the big picture", and unlocking new neural
pathways when you are trying to understand new subjects or solve new problems that you haven't come across before. for that, you need diffuse thinking. this is the opposite of focus — you let your brain wander around the wider landscape, sea...
...d about the problem we are trying to solve first, and the technology used to solve it second. this is pretty much always the best way round to do it — don't start with a cool new technology that you want to use, and try to shoehorn it into the use case. note: the simplest solution is often the best. getting practice the more you practice solving a problem, the stronger your brain's neural
pathways are in that area, and the easier it becomes to recall the details and the logic of that particular problem. keep tinkering with code, and getting more practice. if you run out of problems to solve, look up some tests online, do some more courses, or ask your friends and family (or local school or church) if there is anything they'd like you to build for them. getting help web development r...
What is web performance? - Learn web development
detailed overview. source order. your html index file's source order can significantly affect performance. the download of additional assets linked to from the index file is generally sequential, based on source order, but this can be manipulated and should definitely be optimized, realizing that some resources block additional downloads until their content is parsed and executed. the critical
path. ...
...r, but this can be manipulated and should definitely be optimized, realizing that some resources block additional downloads until their content is parsed and executed. the critical
path. this is the process that the browser uses to construct the web document once the files have been downloaded from the server. the browser follows a well-defined set of steps, and optimizing the critical rendering
path to prioritize the display of content that relates to the current user action will lead to significant improvements in content rendering time. see critical rendering
path for more information. the document object model. the document object model, or dom, is a tree structure that represents the content and elements of your html as a tree of nodes. this includes all the html attributes and the rela...
Deployment and next steps - Learn web development
u can create and modify at will. a specific job called pages in the configuration file will make gitlab aware that you are deploying a gitlab pages website. let's have a go at doing this now. create a .gitlab-ci.yml file inside your project's root and give it the following content: image: node:latest pages: stage: deploy script: - npm install - npm run build artifacts:
paths: - public only: - master here we are telling gitlab to use an image with the latest version of node to build our app. next we are declaring a pages job, to enable gitlab pages. whenever there's a push to our repo, gitlab will run npm install and npm run build to build our application. we are also telling gitlab to deploy the contents of the public folder. on the last line, we are ...
...con.png'> <link rel='stylesheet' href='global.css'> <link rel='stylesheet' href='build/bundle.css'> <script defer src='build/bundle.js'></script> do this now. now we just have to commit and push our changes to gitlab. do this by running the following commands: > git add public/index.html > git add .gitlab-ci.yml > git commit -m "added .gitlab-ci.yml file and fixed index.html absolute
paths" > git push counting objects: 5, done. delta compression using up to 8 threads. compressing objects: 100% (5/5), done. writing objects: 100% (5/5), 541 bytes | 541.00 kib/s, done. total 5 (delta 3), reused 0 (delta 0) to gitlab.com:opensas/mdn-svelte-todo.git 7dac9f3..5725f46 master -> master whenever there's a job running gitlab will display an icon showing the process of the job. click...
Getting started with Svelte - Learn web development
repl and how you'd use it. it looks like so: to start a repl, open your browser and navigate to https://svelte.dev/repl. on the left side of the screen you'll see the code of your components, and on the right you'll see the running output of your app. the bar above the code lets you create .svelte and .js files and rearrange them. to create a file inside a folder just specify the complete
pathname, like this — components/mycomponent.svelte. the folder will be automatically created. above that bar you have the title of the repl. click on it to edit it. on the right side you have three tabs: the result tab shows your app output, and provides a console at the bottom. the js output tab lets you inspect the javascript code generated by svelte, and set compiler options. the c...
...sion in the url. this is useful when reporting issues related to a specific version of svelte. we will provide a repl at the beginning and end of each article so that you can start coding with us right away. note: at the moment the repl can't handle folder names properly. if you are following the tutorial on the repl, just create all your components inside the root folder. then when you see a
path in the code, for example import todos from './components/todos.svelte', just replace it with a flat url, e.g. import todos from './todos.svelte'. the code so far git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/01-getting-started or directly downloa...
HTTP logging
logs for firefox running on linux. quit out of firefox if it's running. open a new shell. the commands listed here assume a bash-compatible shell. copy and paste the following commands into the shell one at a time. make sure to hit enter after each line. export moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshostresolver:5,cookie:5 export moz_log_file=/tmp/log.txt cd /
path/to/firefox ./firefox reproduce the problem you're debugging. when the problem has been reproduced, exit firefox and look for the generated log files, which you can find at /tmp/log.txt. mac os x these instructions show how to log http traffic in firefox on mac os x. quit firefox is if it's currently running, by using the quit option in the file menu. keep in mind that simply closing al...
...l window, hitting the return key after each line. export moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshostresolver:5,cookie:5 export moz_log_file=~/desktop/log.txt cd /applications/firefox.app/contents/macos ./firefox-bin (the instructions assume that you've installed firefox directly into your startup disk's applications folder. if you've put it elsewhere, change the
path used on the third line appropriately.) reproduce whatever problem you're trying to debug. quit firefox and look for the generated log.txt log files on your desktop. note: the generated log file uses unix-style line endings. older editors may have problems with this, but if you're using an even reasonably modern mac os x application to view the log, you won't have any problems. start loggin...
The Firefox codebase: CSS Guidelines
generally, when specifying -moz-appearance: foo; you're giving hints as to how something should act, however -moz-appearance: none; is probably saying 'ignore browser preconceptions - i want a blank sheet', so that's more visual. however -moz-appearance va...
...ss, that way the theme values get to override the content values (which is probably what you want), and you're going to want them both after the global values, so your imports will look like this: <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/content/
path/module.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/
path/module.css" type="text/css"?> [1] -moz-appearance is tricky. generally, when specifying -moz-appearance: foo; you're giving hints as to how something should act, however -moz-appearance: none; is probably saying 'ignore browser preconceptions - i want a blank sheet', so that's more visual. however -moz-appearance values aren't implemented and don't behave consistently across platforms, so ideal...
Gecko Logging
started, you can set prefs under the logging. prefix. for example, setting logging.foo to 3 will set the log module foo to start logging at level 3. the special boolean prefs logging.config.sync and logging.config.add_timestamp can be used to control the sync and timestamp properties described above. redirecting logging output to a file logging output can be redirected to a file by passing its
path via an environment variable. by default logging output goes to stderr. set moz_log_file="log.txt" the rotate and append options described above only apply when logging to a file. the special pref logging.config.log_file can be set at runtime to change the log file being output to. e10s note when a content process is in sandbox, it cannot write to stderr or any file. you may need to set pr...
... adding more rust code to gecko, and rust crates typically use a different approach to logging. many rust libraries use the log crate to log messages, which works together with env_logger at the application level to control what's actually printed via rust_log. you can set an overall logging level, though it could be quite verbose: set rust_log="debug" you can also target individual modules by
path: set rust_log="style::style_resolver=debug" for linux/macos users, you need to use export rather than set. if you're only interested in the content process you can use rust_log_child rather than rust_log. the log crate lists the available log levels: log level purpose rust logging levels error designates very serious errors. warn designates hazardou...
Browser API
point). see bug 1503070 for more details. the methods removed in firefox 65 are: htmliframeelement.addnextpaintlistener() defines a handler to listen for the next mozafterpaint event in the browser <iframe>. htmliframeelement.clearmatch() clears any content highlighted by findall() or findnext(). htmliframeelement.download() downloads a specified url, storing it at the specified filename/
path. htmliframeelement.executescript() allows a specified script to be executed against a page loaded in the browser <iframe>. htmliframeelement.findall() searches for a string in a browser <iframe>'s content; if found, the first instance of the string relative to the caret position will be highlighted. htmliframeelement.findnext() highlights the next or previous instance of a search result aft...
...w icon (e.g. <link rel="icon"> or <link rel="apple-touch-icon">) is available in the browser <iframe>'s content. mozbrowserloadend sent when the browser <iframe> has finished loading all its assets. mozbrowserloadstart sent when the browser <iframe> starts to load a new page. mozbrowserlocationchange sent when a browser <iframe>'s location changes. mozbrowsermanifestchange sent when a the
path to the app manifest changes, in the case of a browser <iframe> with an open web app embedded in it. mozbrowsermetachange sent when a <meta> elelment is added to, removed from or changed in the browser <iframe>'s content. mozbrowseropenwindow sent when window.open() is called within a browser <iframe>. mozbrowseropentab sent when a new tab is opened within a browser <iframe> as a result of t...
AddonManager
autoupdatedefault boolean whether add-ons should auto-update by default (overrideable per add-on). corresponds to the extensions.autoupdatedefault preference. callbacks installcallback() a callback that is passed a single ...
...ready registered. void addtypelistener( in typelistener listener ) parameters listener the typelistener to add removetypelistener() removes a typelistener if the listener is registered. void removetypelistener( in typelistener listener ) parameters listener the typelistener to remove geturiforresourceinfile() nsiuri geturiforresourceinfile( in nsifile afile, in string a
path ) parameters afile the nsifile containing the resources; must be either a directory or an xpi file. a
path the
path to find the resource at, "/" separated. if a
path is empty then the uri to the root of the contained files will be returned. returns an nsiuri pointing at the resource. ...
Download
indicates whether this download's progress property is able to report partial progress while the download proceeds, and whether the value in totalbytes is relevant. this depends on the saver and the download source. launchwhensucceeded boolean if this property is true when the download finishes successfully, the target file will be opened or executed automatically. launcher
path string local file
path of the application to be used to launch the target file, or null if the file should be launched with the default application associated with the contenttype property or the extension of the target file. onchange function this can be set to a function that is called after other properties change. warning: this property cannot be used if th...
...ne, you should create a separate download object with the same source as the current one. promise start(); parameters none. promise resolves to undefined when the download has finished successfully and you can access the target file. promise can be rejected with downloaderror if the download failed. launch() opens or executes the target file after download has completed. if the launcher
path property is null, the file will be opened with the default application for the mime type specified in the contenttype property. if the content type is not available, an attempt will be made to obtain it from the extension of the target file. if the launcher
path property is set, the file will be opened with the specified custom application. promise launch(); parameters none. promise resolves...
QA phase
enter the following command to perform the configuration: $ ./mach configure once your command-line finishes spitting out the config command's output, navigate to the newly...
...rn how to use your hg repository. after your new repository is created by the l10n-drivers, please visit the url for your repo. we'll use x-testing here for our example. you can do this by entering the following url into your browser: http://hg.mozilla.org/l10n-central/x-testing now, navigate to your locale's directory on your local machine. if you're using koala, this should be located at /
path/to/your/koala.project/locale/3.6/x-testing, otherwise, it should be located at /
path/to/your/working_dir/l10n_base/x-testing. in this directory, you should have an hg repository. you might have created it yourself by running hg init or hg clone or you might have had it created by koala when you were setting up a new localization project. also at this point, you shouldn't have any uncommitted cha...
Fonts for Mozilla's MathML engine
re texlive-fontsextra # arch linux sudo urpmi texlive-dist texlive-fontsextra # mageia however, you might need to ensure that the fonts are known by your system. typically, use a fontconfig configuration /etc/fonts/conf.avail/09-texlive-fonts.conf that points to the opentype directory of texlive, such as: <?xml version="1.0"?> <!doctype fontconfig system "fonts.dtd"> <fontconfig> <dir>/your/
path/to/texmf-dist/fonts/opentype</dir> </fontconfig> finally, add this configuration file to the system font location list and regenerate the fontconfig cache: ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/ fc-cache -sf android you must use the mathml-fonts add-on. note: there is an enhancement request opened on the noto bug tracker to improve math support. firefox os ...
...ml-fonts add-on. note that using the add-on is not optimal since it forces your gecko browser to load a css stylesheet on each page you visit as well as web math fonts on all pages with mathml content. a better alternative on unix systems is to install the otf files for latin modern math and stix into some local font folder and (if necessary) to run fc-cache on it. on os x and linux, the standard
paths are ~/library/fonts/ and ~/.fonts. fonts with a math table you can actually render mathml using any font with a math table and related open font format features. a list of such math fonts is provided below. you can use the advanced font preference menu to configure the default font for mathematics. alternatively, you can try the mathml-fontsettings add-on. asana math cambria math dejavu m...
DMD
y-report dumping hook: adb shell am broadcast -a org.mozilla.gecko.memory_dump in logcat, you should see output similar to this: i/dmd (20731): opened /storage/emulated/0/download/memory-reports/dmd-default-20731.json.gz for writing ... i/geckoconsole(20731): nsimemoryinfodumper dumped reports to /storage/emulated/0/download/memory-reports/unified-memory-report-default-20731.json.gz the
path is where the memory reports and dmd reports get dumped to. you can pull them like so: adb pull /sdcard/download/memory-reports/dmd-default-20731.json.gz adb pull /sdcard/download/memory-reports/unified-memory-report-default-20731.json.gz processing the output dmd outputs one gzipped json file per process that contains a description of that process's heap. you can analyze these files (either g...
... missing filename, function name and line number information. this will occur automatically the first time you run dmd.py on the output file. this can take 10s of seconds or more to complete. (this will fail if your build does not contain symbols. however, if you have crash reporter symbols for your build -- as tryserver builds do -- you can use this script instead: clone the whole repo, edit the
paths at the top of resymbolicate_dmd.py and run it.) the simplest way to do this is to just run the dmd.py script on your dmd report while your working directory is $objdir/dist/bin. this will allow the local libraries to be found and used. if you invoke dmd.py without arguments you will get output appropriate for the mode in which dmd was invoked. "dark matter" mode output for "dark matter" mode,...
Leak-hunting strategies and tips
an xpcom interface and be used transparently by native code. the nsxpcwrappedjs object creates a gc root that exists as long as the wrapper does. the wrapper itself is just a normal reference-counted object, so a leaked nsxpcwrappedjs can be debugged using the normal refcount-balancer tools. if you really need to debug leaks that involve js objects closely, you can get detailed printouts of the
paths js uses to mark objects when it is determining the set of live objects by using the functions added in bug 378261 and bug 378255. (more documentation of this replacement for gc_mark_debug, the old way of doing it, would be useful. it may just involve setting the xpc_shutdown_heap_dump environment variable to a file name, but i haven't tested that.) post-processing of stack traces on mac and li...
...ees in addition to raw stacks; since they are rather slow, it is often much faster to generate balance trees (e.g., using make-tree.pl for the refcount balancer or diffbloatdump.pl --use-address for trace-malloc) andthen run the balance trees (which are much smaller) through the post-processing. getting symbol information for system libraries windows setting the environment variable _nt_symbol_
path to something like symsrv*symsrv.dll*f:\localsymbols*http://msdl.microsoft.com/download/symbols as described in microsoft's article. this needs to be done when running, since we do the address to symbol mapping at runtime. linux many linux distros provide packages containing external debugging symbols for system libraries. fix_stacks.py uses this debugging information (although it does not verif...
TraceMalloc
ess filename. try running with the unified output format option, -u. the output is a large html file that hyperlinks ancestor and descendent libraries, classes, and functions that call into one another, attributing malloc blame up and down each graph. bloatblame accumulates allocation counts and ignores free calls. if you run with --trace-malloc -, your code can call ns_tracemallocdumpallocations(
pathname) at opportune times, and a human-readable listing of the current heap, including stack traces for every allocation, will be written to
pathname. this file can be post-processed by tools in mozilla/tools/trace-malloc as follows: histogram.pl, which produces a type histogram that can be diffed with histogram-diff.sh to produce output that looks like this: ---- base ---- ---- incr ---- --...
...ogfd(logfd) - close the log file identified by logfd, flushing its buffer of any events first. if logfd identifies the current log file, change the current log file to the default log file given by the --trace-malloc command line argument. tracemalloclogtimestamp(caption) - log a timestamp event to the current log file, annotating the log even with the caption string. tracemallocdumpallocations(
pathname) - dump a human-readable listing of all traced, live allocations. see nstracemalloc.h for detailed comments on the log file format. analyzing the shutdown log the shutdown log is a basic tool for finding memory leaks. the shutdown log contains the stack trace of every allocation that has not been deallocated by shutdown. some of these are false positives, allocations that are truly needed un...
PR_MkDir
mode the access permission bits of the file mode of the new directory if the file is created when pr_create_file is on. caveat: the mode parameter is currently applicable only on unix platforms. ...
... 00400. read by owner. 00200. write by owner. 00100. search by owner. 00040. read by group. 00020. write by group. 00010. search by group. 00004. read by others. 00002. write by others. 00001. search by others. returns if successful, pr_success. if unsuccessful, pr_failure. the actual reason can be retrieved via pr_geterror. description pr_mkdir creates a new directory with the
pathname name. all the
path components up to but not including the leaf component must already exist. for example, if the
pathname of the directory to be created is a/b/c/d, the directory a/b/c must already exist. see also pr_rmdir ...
PR_Open
flags the file status flags define how the file is accessed. it is a bitwise or of the following bit flags. in most cases, only one of the first three flags may be used. ...
... permission, others returns the function returns one of the following values: if the file is successfully opened, a pointer to a dynamically allocated prfiledesc for the newly opened file. the prfiledesc should be freed by calling pr_close. if the file was not opened successfully, a null pointer. description pr_open creates a file descriptor (prfiledesc) for the file with the
pathname name and sets the file status flags of the file descriptor according to the value of flags. if a new file is created as a result of the pr_open call, its file mode bits are set according to the mode parameter. ...
NSPR API Reference
ndition variable type condition variable functions monitors monitor type monitor functions cached monitors cached monitor functions i/o types directory type file descriptor types file info types network address types types used with socket options functions type used with memory-mapped i/o offset interpretation for seek functions i/o functions functions that operate on
pathnames functions that act on file descriptors directory i/o functions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers network addresses network address types and constants network address functions atomic operations pr_atomicincrement pr_atomicde...
... 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 prstaticlinktable library linking functions pr_setlibrary
path pr_getlibrary
path pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program platform notes dynamic library search
path exporting symbols from the main executable program process management and interprocess communication process management types ...
HTTP delegation
to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an application session with ocsp enabled, a large number of ocsp requests might have to be sent. therefore the api should allow for keep-alive (persistent) http connections. http uris consist of host:port and a
path, e.g. http://ocsp.provider.com:80/cgi-bin/ocsp-responder if nss needs to access a http server, it will request that an "http server session object" be created (sec_httpserver_createsessionfcn). the http server session object is logically associated with host and port destination information, in our example this is "host ocsp.provider.com port 80". the object may be used by the application to asso...
...httpserver_keepalivesessionfcn) on the server session object, giving application code a chance to do whatever is required. for each individual http request, nss will request the creation of a "http request object" (sec_httprequest_createfcn). no full uri is provided as a parameter. instead, the parameters are a server session object (that carries host and port information already) and the request
path. in our example the
path is "/cgi-bin/ocsp-responder". (when issueing get requests, the "?query-string=data" portion should already be appended to the request
path) after creation, nss might call functions to provide additional details of the http request (e.g. sec_httprequest_setpostdatafcn). the application is expected to collect the details for later use. once nss is finished providing all det...
HTTP delegation
to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an application session with ocsp enabled, a large number of ocsp requests might have to be sent. therefore the api should allow for keep-alive (persistent) http connections. http uris consist of host:port and a
path, e.g. http://ocsp.provider.com:80/cgi-bin/ocsp-responder if nss needs to access a http server, it will request that an "http server session object" be created (sec_httpserver_createsessionfcn). the http server session object is logically associated with host and port destination information, in our example this is "host ocsp.provider.com port 80". the object may be used by the application to asso...
...httpserver_keepalivesessionfcn) on the server session object, giving application code a chance to do whatever is required. for each individual http request, nss will request the creation of a "http request object" (sec_httprequest_createfcn). no full uri is provided as a parameter. instead, the parameters are a server session object (that carries host and port information already) and the request
path. in our example the
path is "/cgi-bin/ocsp-responder". (when issuing get requests, the "?query-string=data" portion should already be appended to the request
path) after creation, nss might call functions to provide additional details of the http request (e.g. sec_httprequest_setpostdatafcn). the application is expected to collect the details for later use. once nss is finished providing all deta...
Using JSS
rary the jss shared library is jss4.dll (windows) or libjss4.so (unix). if you built jss from source, it is in mozilla/dist/<platform>/lib. if you are downloading binaries, get it from http://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/. jss classes if you built jss from source, the compiled jss classes are in mozilla/dist/classes[_dbg]. you can put this directory in your class
path to run applications locally; or, you can package the class files into a jar file for easier distribution: cd mozilla/dist/classes[_dbg] zip -r ../jss42.jar . if you are downloading binaries, get jss42.jar from http://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/. setup your runtime environment you need to set some environment variables before building and running java a...
... can package the class files into a jar file for easier distribution: cd mozilla/dist/classes[_dbg] zip -r ../jss42.jar . if you are downloading binaries, get jss42.jar from http://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/. setup your runtime environment you need to set some environment variables before building and running java applications with jss. class
path include the
path containing the jss classes you built, or the
path to jss42.jar. (the
path to jss34.jar ends with the string "/jss42.jar". it is not just the directory that contains jss42.jar.) ld_library_
path (unix) /
path (windows) include the
path to the nspr, nss, and jss shared libraries. initialize jss in your application before calling any jss methods, you must...
NSS_3.12_release_notes.html
note: firefox 3 uses nss 3.12, but not the new sqlite-based shareable certificate and key databases. we missed the deadline to enable that feature in firefox 3. distribution information the cvs tag for the nss 3.12 release is nss_3_12_rtm. nss 3.1...
...7664: false positive crl revocation test on ppc/ppc64 nss_enable_pkix_verify=1 bug 404526: glibc detected free(): invalid pointer bug 300929: certificate policy extensions not supported bug 129303: nss needs to expose interfaces to deal with multiple token sources of certs. bug 217538: softoken databases cannot be shared between multiple processes bug 294531: design new interfaces for certificate
path building and verification for libpkix bug 326482: nss ecc performance problems (intel) bug 391296: need an update helper for shared databases bug 395090: remove duplication of pkcs7 code from pkix_pl_httpcertstore.c bug 401026: need to provide a way to modify and create new pkcs #11 objects. bug 403680: cert_pkixverifycert fails if crls are missing, implement cert_pi_revocationflags bug 427706: n...
NSS 3.14.2 release notes
primary nss documentation pages please visit /docs/nss new in nss 3.14.2 nss will now make use of the intel aes-ni and avx instruction sets for hardware-accelerated aes-gcm on 64-bit linux systems. note: the new assembly code requires gnu as version 2.19 or newer. on red hat enterprise linux 5.x systems, install the binutils220 package and add /usr/libexec/binutils220 to the beginning of your
path environment variable. initial manual pages for some nss command line tools have been added. they are still under review, and contributions are welcome. the documentation is in the docbook format and can be rendered as html and unix-style manual pages using an optional build target. new types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_...
...lytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing notable changes in nss 3.14.2 bug 805604 - support for aes-ni and avx accelerated aes-gcm was contributed by shay gueron of intel. if compiled on linux systems in 64-bit mode, nss will include runtime detection to check if the platform supports aes-ni and pclmulqdq. if so, nss uses the optimized code
path, reducing the cpu cycles per byte to 1/20 of what was required before the patch (https://bugzilla.mozilla.org/show_bug.cgi?id=805604 and https://crypto.stanford.edu/realworldcrypto/slides/gueron.pdf). support for other platforms, such as windows, will follow in a future nss release. (https://bugzilla.mozilla.org/show_bug.cgi?id=540986) sqlite has been updated to 3.7.15. note: please apply the p...
NSS Sample Code Sample_3_Basic Encryption and MACing
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 <dbdir
path> [-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", " "); fprintf(stderr, "%-20s specify db directory
path\n\n", "-d <dbdir
path>")...
...down(); if (rvshutdown != secsuccess) { pr_fprintf(pr_stderr, "failed : nss_shutdown()\n"); rv = secfailure; } pr_cleanup(); return rv; } </plstr.h></prtypes.h></prlog.h></prinit.h></prerror.h></plgetopt.h></prthread.h></opfilename></ipfilename></ipfilename></ipfilename></ipfilename></ipfilename></opfilename></ipfilename></noisefilename></dbpwdfile></dbpwd></dbdir
path></a|b></opfilename></ipfilename></dbpwdfile></dbpwd></noisefilename></dbdir
path></a|b></pk11priv.h></keyhi.h></plstr.h></prtypes.h></prlog.h></prinit.h></prerror.h></plgetopt.h></prthread.h> ...
PKCS #11 Module Specs
re considered escape characters for the next character in the stream. note that case must be preserved in the values. these modules specs can be passed by the application directly to nss via the secmod_loadusermodule() call. to initialize a pkcs #11 module 'on-the-fly'. recognized names all applications/libraries must be able recognize the following name values: library this specifies the
path to the pkcs #11 library. name this specifies the name of the pkcs #11 library. parameter this specifies a pkcs #11 library parameter with the application must pass to the pkcs #11 library at c_initialize() time (see below). in additions applications/libraries should be able to ignore additional name value pairs which are used to specify configuration for other applications. of course thes...
...ation for other applications. of course these application/libraries should be able to parse their own name/value pairs. each of these name/value pairs are optional. if the library is not specified, the line represents some application specific meta configuration data. other applications and libraries can safely ignore this line. if the name is not specified, the application can use the library
path to describe the pkcs #11 library in any ui it may have. if the parameter is not specified, no parameters are passed to the pkcs #11 module. if the application/library does not find its application/library specific data, it should use it's defaults for this pkcs #11 library. parameter passing if the parameter is specified, the application/library will strip the value out, processing any outter...
Python binding for NSS
fix reference counting bug in pk11_password_callback() which contributed to nss not being able to shutdown due to resources still in use. add utf-8 support to ssl.config_server_session_id_cache() added unit tests for cipher, digest, client_server. all unittests now run, added test/run_tests to invoke full test suite. fix bug in test/setup_certs.py, hardcoded full
path to libnssckbi.so was causing failures on 64-bit systems, just use the libnssckbi.so basename, modutil will find it on the standard search
path. doc/examples/cert_dump.py uses new algorithmid class to dump signature algorithm doc/examples/ssl_example.py now can cleanly shutdown nss. exception error messages now include pr error text if available. the following classes were...
... text if available. ...
Installation guide
files also have an "install" target, but it has a different meaning: our "install" means installing the headers, libraries, and programs in the appropriate directories under mozilla/dist. so right now you need to manually install the headers, libraries, and programs in the directories you want. ...
...ectory other than /usr/lib, you usually need to set the ld_library_
path environment variable. you can avoid that by installing the libraries in a directory that is $origin/../lib, where $origin is the directory where the programs are installed. this is done here: http://lxr.mozilla.org/security/sour...platlibs.mk#53 53 ifeq ($(os_arch), linux) 54 ifeq ($(use_64), 1) 55 extra_shared_libs += -wl,-r
path,'$$origin/../lib64:$$origin/../lib' 56 else 57 extra_shared_libs += -wl,-r
path,'$$origin/../lib' 58 endif 59 endif for example, if you install certutil in /foo/bar/nss/bin and the .so's in /foo/bar/nss/lib, then you only need to add /foo/bar/nss/bin to your
path; you don't need to set ld_library_
path. the libraries you need to install are listed below. nspr: libnspr4.so libplds4.so libplc4.so ...
NSS environment variables
brary, to verify certificates. 3.12 nss_fips string ("fips","true","on","1") will start nss in fips mode. 3.12.5 nss_hash_alg_support string specifies agorithms allowed to be used in certain applications, such as in signatures on certificates and crls. see documentation at this link. 3.12.3 nss_output_file string (filename) output file
path name for the pkcs #11 module logger. default is stdout. 3.7 nss_sdb_use_cache string ("no","yes","auto") controls whether nss uses a local cache of sql database contents. default is "auto". see the source for more information. 3.12 nss_ssl_cbc_random_iv string ("0", "1") controls the workaround for the beast attack on ssl 3.0 and tls 1.0. "0" disables it, "...
...mbolic debugging information in a particular format. 3.12.8 nsdistmode string on operating systems other than windows, this controls whether copies, absolute symlinks, or relative symlinks of the output files should be published to mozilla/dist. the possible values are: copy: copies of files are published absolute_symlink: symlinks whose targets are absolute
pathnames are published if not specified, default to relative symlinks (symlinks whose targets are relative
pathnames). on windows, copies of files are always published. before 3.0 ns_use_gcc boolean (1 to enable) on systems where gcc is not the default compiler, this tells nss to build with gcc. before 3.0 nss_allow_sslkeylogfile boolean (1 to ena...
sslerr.html
he certificate's issuer has an invalid signature. sec_error_crl_invalid -8159 new crl has an invalid format. sec_error_extension_value_invalid -8158 certificate extension value is invalid. sec_error_extension_not_found -8157 certificate extension not found. sec_error_ca_cert_invalid -8156 issuer certificate is invalid. sec_error_
path_len_constraint_invalid -8155 certificate
path length constraint is invalid. sec_error_cert_usages_invalid -8154 certificate usages field is invalid. sec_internal_only -8153 internal-only module. sec_error_invalid_key -8152 the key does not support the requested operation. sec_error_unknown_critical_extension -8151 certificate conta...
... certificate nickname already in use. sec_error_not_fortezza_issuer -8088 peer fortezza chain has a non-fortezza certificate. sec_error_cannot_move_sensitive_key -8087 "a sensitive key cannot be moved to the slot where it is needed." sec_error_js_invalid_module_name -8086 invalid module name. sec_error_js_invalid_dll -8085 invalid module
path/filename. sec_error_js_add_mod_failure -8084 unable to add module. sec_error_js_del_mod_failure -8083 unable to delete module. sec_error_old_krl -8082 new krl is not later than the current one. sec_error_ckl_conflict -8081 new ckl has different issuer than current ckl. sec_error_cert_not_in_name_space -8080 certificate iss...
NSS tools : signtool
ce. the -j option is available only in netscape signing tool 1.0 and later versions. the -j option cannot be used at the same time as the -z option. if the -c# option is not used with the -j option, the default compression value is 6. note that versions 1.1 and later of netscape signing tool correctly recognizes the codebase attribute, allows
paths to be expressed for the class and src attributes instead of filenames only, processes link tags and parses html correctly, and offers clearer error messages. -l lists the certificates in your database. an asterisk appears to the left of the nickname for any certificate that can be used to sign objects with signtool. --lea...
...cate db": adding signdir/meta-inf/manifest.mf to testjar.jar adding signdir/meta-inf/signtool.sf to testjar.jar adding signdir/meta-inf/signtool.rsa to testjar.jar tree "signdir" signed successfully 4. test the archive you just created. signtool -v testjar.jar using certificate directory: /u/jsmith/.netscape archive "testjar.jar" has passed crypto verification. status
path ------------ ------------------- verified test.f using netscape signing tool with a zip utility to use netscape signing tool with a zip utility, you must have the utility in your
path environment variable. you should use the zip.exe utility rather than pkzip.exe, which cannot handle long filenames. you can use a zip utility instead of the -z option to package ...
Renaming With Pork
is copy. typically, make cxxflags="-wp,-k,-w0 -save-temps" will work. note the -k,-w0 options are passed down to the mcpp preprocessor such that it can annotate files with more precise position information. in order for this to work mcpp has to be integrated into your compiler as described in the pork installation instructions 3. in the analysis copy make a list of files to process. use absolute
paths. find `pwd` -name \*.ii > /tmp/ls.txt 4. run renamer through pork-barrel. this makes it easier to refer to any diagnostics touch /tmp/err.txt tail -f /tmp/err.txt & ~/work/pork-barrel/pork-barrel 4 /tmp/ls.txt ./renamer -rename-class string sm::string > /tmp/string.diff 2>/tmp/err.txt pork-barrel runs multiple copies of the renamer and merges their output. one can also run the ./renamer co...
...efer to any diagnostics touch /tmp/err.txt tail -f /tmp/err.txt & ~/work/pork-barrel/pork-barrel 4 /tmp/ls.txt ./renamer -rename-class string sm::string > /tmp/string.diff 2>/tmp/err.txt pork-barrel runs multiple copies of the renamer and merges their output. one can also run the ./renamer command directly on the .ii files. 5. apply the patch in the test sources. pork patches contain absolute
paths in them and will touch generated sources if it comes across any. thus it is helpful to postprocess the patch with sed and filterdiff. now in the analysis copy do some processing on the patch and apply it. --dry-run is helpful for debugging filterdiff -x \*/smbase/\* /tmp/string.diff |sed 's/.home.tglek.tmp.//' | patch -p1 --dry-run ...
Tutorial: Embedding Rhino
t embedding of rhino possible is the runscript example. all it does it read a script from the command line, execute it, and print a result. here's an example use of runscript from a shell command line: $ java runscript "math.cos(math.pi)" -1 $ java runscript "function f(x){return x+1} f(7)" 8 note that you'll have to have both the rhino classes and the runscript example class file in the class
path. let's step through the body of main one line at time. entering a context the code context cx = context.enter(); creates and enters a context. a context stores information about the execution environment of a script. initializing standard objects the code scriptable scope = cx.initstandardobjects(); initializes the standard objects (object, function, etc.) this must be done before scrip...
...ost objects can implement special javascript features like dynamic properties. counter example the counter example is a simple host object. we'll go through it method by method below. it's easy to try out new host object classes in the shell using its built-in defineclass function. we'll see how to add it to runscript later. (note that because the java -jar option preempts the rest of the class
path, we can't use that and access the counter class.) $ java -cp "js.jar;examples" org.mozilla.javascript.tools.shell.main js> defineclass("counter") js> c = new counter(7) [object counter] js> c.count 7 js> c.count 8 js> c.count 9 js> c.resetcount() js> c.count 0 counter's constructors the zero-argument constructor is used by rhino runtime to create instances. for the counter example, no initial...
JIT Optimization Outcomes
n the expected constant. this is an unlikely failure mode, and should not occur. indictionarymode the object whose property is being accessed is in dictionary mode. objects which are used in ways that suggest they are hashtables are turned into dictionary objects and their types marked as such. noprotofound a prototype object was not found for all the object used by this operation. multiproto
paths objects used in this operation had differing prototypes. nonwritableproperty the property being assigned to is not writable for some types of objects which are used in this operation. protoindexedprops the object being accessed has indexed properties that are exotic (for example, defined as a property on a prototype object and left as a hole in the underlying object). arraybadflags the ar...
...otcached nonnativereceiver indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled. simdtypenotoptimized the type observed as being retrieved from this property access did not match an optimizable type. unknownsimdproperty the property being accessed on the object is not one of the optimizable property names. hascommoninlining
path inlined dom monomorphic polymorphic inline cache outcomes outcomes describing inline cache stubs that were generated. icoptstub_genericsuccess icgetpropstub_readslot icgetpropstub_callgetter icgetpropstub_arraylength icgetpropstub_unboxedread icgetpropstub_unboxedreadexpando icgetpropstub_unboxedarraylength icgetpropstub_typedarraylength icgetpropstub_domproxyshadowed icgetpropstu...
SpiderMonkey 1.8.5
re running, issue the command /usr/bin/g++-4.2 -v from a terminal window. the following builds are known to not work: i686-apple-darwin9-g++-4.2.1 (gcc) 4.2.1 (apple inc. build 5574) to work around this issue, either upgrade your xcode or use an alternate version of gcc, such as the one that shipped with leopard. to select an alternate c++ compiler, invoke configure thus: cxx=/usr/bin/g++-4.0 /
path/configure --my-configuration-options js-config the new configure-based build system does not correctly generate the js-config script on many platforms, nor when js-ctypes are enabled. if you are building your project with a gnu-make based build system, the following workaround can be integrated into your build system to generate the correct ldflags, with a strong likelihood that it will work with...
...re-based build system does not correctly generate the js-config script on many platforms, nor when js-ctypes are enabled. ...
SpiderMonkey 1.8.7
re running, issue the command /usr/bin/g++-4.2 -v from a terminal window. the following builds are known to not work: i686-apple-darwin9-g++-4.2.1 (gcc) 4.2.1 (apple inc. build 5574) to work around this issue, either upgrade your xcode or use an alternate version of gcc, such as the one that shipped with leopard. to select an alternate c++ compiler, invoke configure thus: cxx=/usr/bin/g++-4.0 /
path/configure --my-configuration-options js-config the new configure-based build system does not correctly generate the js-config script on many platforms, nor when js-ctypes are enabled. if you are building your project with a gnu-make based build system, the following workaround can be integrated into your build system to generate the correct ldflags, with a strong likelihood that it will work wit...
...e-based build system does not correctly generate the js-config script on many platforms, nor when js-ctypes are enabled. ...
Web Replay
ues like treating all accesses on the buffers as atomic (probably unacceptable overhead) or performing all accesses on the buffer on a single core and keeping track of context switches. dom workers are not supported yet. for simplicity, debugger integration is currently only able to handle js code that runs on the main thread. webgl is not supported yet, as it uses a pretty different rendering
path from normal web content. media elements are not supported yet, as many of these run third party multithreaded code which hasn't been tested with the infrastructure. porting almost all implementation work so far has been on macos. windows port work is underway, but is not yet working. the difficulties are in figuring out the set of system library apis to intercept, in getting the memory mana...
...e which hasn't been tested with the infrastructure. porting almost all implementation work so far has been on macos. windows port work is underway, but is not yet working. the difficulties are in figuring out the set of system library apis to intercept, in getting the memory management and dirty memory parts of the rewind infrastructure to work, and in handling the different graphics and ipc
pathways on different platforms. comparison with other projects there is lots of existing work in this area. the closest projects are rr, webkit's replay project, and microsoft's time-travel debugger. compared to rr: this should work on all platforms and architectures supported by gecko, though with substantial port work required. this will be part of gecko itself, rather than a separate tool,...
How to build an XPCOM component in JavaScript
provided for download is powerpc-only. if you need an intel version, you'll need to compile it yourself as described on that page. execute this command to compile the typelib. here, {sdk_dir} is the directory in which you unpacked the gecko sdk. {sdk_dir}/bin/xpidl -m typelib -w -v -i {sdk_dir}/idl -e helloworld.xpt helloworld.idl note: on windows you must use forward slashes for the include
path. note: (the -i flag is an uppercase i, not a lowercase l.) this will create the typelib file helloworld.xpt in the current working directory. for a new component in firefox/thunderbird/b2g if you are adding a new feature to applications in the mozilla-central repository, you can create a makefile listing the idl files and the build system will automatically generate the typelib. a sample make...
...ository, you can create a makefile listing the idl files and the build system will automatically generate the typelib. a sample makefile.in # this source code form is subject to the terms of the mozilla public # license, v. 2.0. if a copy of the mpl was not distributed with this # file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
Finishing the Component
register as a new category. you have already registered as a category to receive startup notification. this time, the category name to use is "content-policy". ...
... prbool *_retval) uniform resource locators the method passes in an interface pointer of type nsiuri, which is based on the uniform resource identifier, or uri. this type is defined by the world wide web consortium as: the naming scheme of the mechanism used to access the resource. the name of the machine hosting the resource. the name of the resource itself, given as a
path. in this context, uris are the strings used refer to places or things on the web. this specific form of uri is called a uniform resource locator, or url. see the intro to the html 4 specification for more information about uris and urls. gecko encapsulates these identifiers into two interfaces, nsiuri and nsiurl. you can queryinterface between these two interfaces. the networking library, neck...
Mozilla internal string guide
codings to utf-8 and utf-16 are provided by mozilla::encoding. additonally, on windows the are some rare cases (e.g. drag&drop) where it's necessary to call a system api with data encoded in the windows locale-dependent legacy encoding instead of utf-16. in those rare cases, use multibytetowidechar/widechartomultibyte from kernel32.dll. do not use iconv on *nix. we only support utf-8-encoded file
paths on *nix, non-
path gtk strings are always utf-8 and cocoa and java strings are always utf-16. when working with existing code, it is important to examine the current usage of the strings that you are manipulating, to determine the correct conversion mechanism. when writing new code, it can be confusing to know which storage class and encoding is the most appropriate. there is no single answer t...
...ko code uses utf-16 for compatibility with js strings and dom string which are potentially-invalid utf-16. however, both dom text nodes and js strings store strings that only contain code points below u+0100 as latin1 (byte value is the unicode scalar value). windows and cocoa use utf-16. windows system apis take utf-16. cocoa nsstring is utf-16. gtk uses utf-8. gtk apis take utf-8 for non-file
paths. in the gecko case, we support only utf-8 file
paths outside windows, so all gtk strings are utf-8 for our purposes though file
paths received from gtk may not be valid utf-8. to assist with ascii, latin1, utf-8, and utf-16 conversions, there are some helper methods and classes. some of these classes look like functions, because they are most often used as temporary objects on the stack. shor...
XPCOM Stream Guide
snippets: writing to a file. ...
...anymore zipreader.close(); for writing from an input stream to a zip archive, see the nsizipwriter interface: // file is an nsifile object mapping to a zip archive var zipwriter = components.classes["@mozilla.org/zipwriter;1"] .createinstance(components.interfaces.nsizipwriter); zipwriter.open(file, ioflags); // stream is the output stream zipwriter.addentrystream("/
path/to/zipped/file", modtime, compression, stream, queueforlater); // if queued for later operations, and all operations are queued zipwriter.processqueue(); // when we don't need the zipwriter anymore zipwriter.close(); concatenating input streams var stringstream = components.constructor("@mozilla.org/io/string-input-stream;1", "nsistringinputstream"...
NS_NewLocalFile
« xpcom api reference summary the ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file
path. #include "nsxpcom.h" #include "nsilocalfile.h" nsresult ns_newlocalfile( const nsastring& a
path, prbool afollowlinks, nsilocalfile** aresult ); parameters a
path [in] a utf-16 string object that specifies an absolute filesystem
path. this
path does not need to reference an existing file. it is an error to pass a relative filesystem
path. afollowlinks [in] this attribute will determine if the nsilocalfile instance will automatically resolve symbolic links. this parameter has no effect on unix systems. on windows, passing true causes shortcuts to be automatically resolved, and on macos, passing true causes ...
...ter has no effect on unix systems. on windows, passing true causes shortcuts to be automatically resolved, and on macos, passing true causes finder aliases to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newlocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_
path indicates that the specified
path is invalid. this error is returned if a relative file
path is passed to ns_newlocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newlocalfile(nsembedstring(l"c:\\foo.txt"), pr_false, ...
Core XPCOM functions
e 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. ...
...itiates use of xpcom in the calling process with support for statically defined xpcom modules. ns_newlocalfilethe ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file
path.ns_newnativelocalfilethe ns_newnativelocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file
path.ns_reallocreallocates a block of memory using the xpcom memory manager.ns_shutdownxpcomthe ns_shutdownxpcom function terminates use of xpcom in the calling process.nsresultthe nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes. for a list of defined result values, see error codes returned by mozilla apis. ...
nsIComponentManager
rface nsilocalfile alocation ); parameters examples using addbootstrappedmanifestlocation in a bootstrapped extension for firefox 8 and 9: alocation the directory or xpi to stop reading the chrome.manifest from. ...
...g the chrome.manifest from. ...
getFile
nsifile getfile( in string aname, out boolean apersistent ); parameters aname [in] the symbolic name for a file or directory location. see symbolic names below for a list of accepted values. xpcom file system aliases apersistent [out] this output parameter indicates to the caller whether or not the returned location is persistent. ...
...rectory service will not cache the results of this method. symbolic names the list of symbolic names is subject to change, so be sure to take a look at the xpcom/io/nsdirectoryservicedefs.h file for the version of gecko you're working with for the latest list. available on all platforms these symbolic names are available on all platforms (although, of course, they may refer to different physical
paths on the storage device). c constant string value notes ns_os_home_dir "home" ns_os_temp_dir "tmpd" ns_os_current_working_dir "curworkd" ns_os_desktop_dir "desk" otherwise same as home ns_os_current_process_dir "curprocd" ns_xpcom_current_process_dir "xcurprocd" can be overriden by ...
nsIEnvironment
ich is incorrect for unix/linux!!!!) which simply checks whether the string returned by get() is empty or not. boolean exists( in astring aname ); parameters aname the variable name to probe. return value if the variable has been set, the value returned is pr_true. ...
... value if the variable has been set, the value returned is pr_true. if the variable was not defined in the environment pr_false will be returned. examples windows this example gets the
path to the porgram files directory on windows. credit to morat from mozillazine. ...
nsIINIParserFactory
e ini file. ...
...ing a parser object to obtain a parser for an ini file, you can use code that looks like this: to get an nsiiniparser instance for an ini file, you may use the following code: // create an nsilocalfile var cl = "@mozilla.org/file/local;1"; var interf = components.interfaces.nsilocalfile; var file = components.classes[cl].createinstance(interf); // init the file with the
path to your ini file var
path = "c:\\temp\\example.ini"; file.initwith
path(
path); // create the nsiiniparserfactory var cl = "@mozilla.org/xpcom/ini-parser-factory;1"; var interf = components.interfaces.nsiiniparserfactory; var inifact = components.manager.getclassobjectbycontractid(cl,interf); // get the iniparser for the ini file var iniparser = inifact.createiniparser(file); see also nsiiniparser nsilocalfile ...
nsILoginManagerStorage
always be an array; if there are no logins in the login store, it must be an empty array, not null. getloginsavingenabled() implement to report whether or not login saving has been disabled for a specific host. boolean getloginsavingenabled( in astring ahost ); parameters ahost the hostname whose login saving status should be returned. this string will be in the origin url format, without a
pathname. for example, "http://mozilla.com". return value return true if login saving is enabled for the specified host; otherwise, return false. init() implement this method to initialize the component. this is not called automatically; you must call it yourself if needed. void init(); parameters none. initwithfile() implement this method to initialize the component, overriding the default filename...
...st. when login saving is disabled for a host, the login manager will not propt the user for permission to store logins for that host. existing logins for the host should not be affected when setting this. void setloginsavingenabled( in astring ahost, in boolean isenabled ); parameters ahost the host for which to enable or disable login saving. the argument is in origin url format, without a
pathname (for example: "http://mozilla.com"). isenabled true if logins should be enabled for the host, or false if they should be disabled. remarks for methods returning count, javascript callers can simply use the length property on the returned array to find out how many logins were returned in the array, for example: var logins = pwmgr.searchlogins({}, matchdata); var numlogins = logins.length; se...
nsIMsgFolder
customidentity nsimsgidentity readonly: this allows a folder to have a special identity. e.g., you might want to associate an identity with a particular newsgroup, or for imap shared folders in the other users namespace, you might want to create a delegated identity. gettingnewmessages boolean are we running a url as a result of the user clicking get msg. file
path nsilocalfile local
path of this folder. basemessageuri acstring readonly charset acstring the charset of this folder. charsetoverride boolean biffstate unsigned long locked boolean readonly flags unsigned long direct access to the set/get all the flags at once. knowssearchnntpextension bo...
...g readonly charset acstring the charset of this folder. charsetoverride boolean biffstate unsigned long locked boolean readonly flags unsigned long direct access to the set/get all the flags at once. knowssearchnntpextension boolean readonly allowsposting boolean readonly relative
pathname acstring readonly sizeondisk unsigned long size of this folder on disk (not including .msf file) for imap, it's the sum of the size of the messages. username acstring readonly hostname acstring readonly expungedbytes unsigned long readonly deletable boolean readonly: can this folder be deleted. for example, speci...
nsIStandardURL
inherits from: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-url;1. ...
... inherits from: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-url;1. ...
nsIXMLHttpRequest
t it, so it returns string, you dont want arraybuffer. ...
...ing, you dont want arraybuffer. ...
pyxpidl
yxpidl is comprised of two utilities: header.py, which generates c++ headers from idl, and typelib.py, which generates xpt files. pyxpidl requires a directory to cache certain information in. you can use a temporary directory or the current directory or whatever works best for you. generating c++ headers to generate c++ headers, use the header.py utility: sdkdir/sdk/bin/header.py --cachedir=<
path> -o <outputfilename.h> <filename.idl> generating typelibs generating typelib files is done using the typelib.py utility: sdkdir/sdk/bin/typelib.py --cachedir=<
path> -o <outputfilename.xpt> <filename.idl> comparing pyxpidl to xpidl this table provides a mapping of old xpidl options to pyxpidl. xpidl option description pyxpidl equivalent -a emit annotations to typ...
...l equivalent -a emit annotations to typelib n/a (feature removed) -w turn on warnings n/a (this is now the default and can't be turned off) -v verbose mode (nyi) n/a (feature removed) -t creates a typelib of a specific version number n/a (feature removed, and probably never actually worked) -i add an entry to start of include
path for #include "nsifoo.idl" -i (unchanged) -o specify the base name for output (-o /tmp/nsifoo for example) -o outputfile (this isn't just the base name, but needs to include the extension; for example -o /tmp/nsifoo.idl) -e specify an explicit output file name (-e /tmp/nsifoo.idl for example) n/a (this is subsumed by -o now) -d write dependencies (requi...
Using the Multiple Accounts API
er.server.check_time - integer, number of minutes between checks for new mail preference: mail.server.server.remember_password - boolean, should we remember the password? preference: mail.server.server.download_on_biff. - boolean, should we download new messags on biff (true) or just alert user that there is new mail (false) preference: mail.server.server.directory - local platform-specific
path to store messages and folder indexes preference: mail.server.server.name - user-visible name of server the following are specific to imap: preference: mail.server.server.admin_url - administration url for server preference: mail.server.server.using_subscription - boolean, should we use subscriptions? (i.e. use lsub instead of list) preference: mail.server.server.cleanup_inbox_on_e...
...john smith preference: mail.identity.identity.useremail - the user's e-mail address, i.e. jsmith@isp.com preference: mail.identity.identity.reply_to - reply to address during message composition, should only be used if different than useremail. (replyto: header in ...
Using the Mozilla source server
using the source server in windbg in the windbg command line, type .srcfix and hit enter. this enables source server support.
... using the source server in windbg in the windbg command line, type .srcfix and hit enter. this enables source server support. ...
WebIDL bindings
rlying c++ class must also implement a method called getownpropertynames with the signature void getownpropertynames(jscontext* acx, nstarray<nsstring>& anames, errorresult& arv). this method will be called by the js engine's enumerate hook and must provide a superset of all the property names that doresolve might resolve. providing names that doresolve won't actually resolve is ok. [headerfile="
path/to/headerfile.h"] indicates where the implementation can be found. similar to the headerfile annotation in bindings.conf. just like headerfile in bindings.conf, should be avoided. [jsimplementation="@mozilla.org/some-contractid;1"] used on an interface to provide the contractid of the javascript component implementing the interface. [navigatorproperty="propname"] setting this extended attri...
...n nsstringbuffer available, and promise to hold on to the nsstringbuffer at least until the binding code comes off the stack can also take a domstring directly for their string return value and call its setstringbuffer method with the nsstringbuffer and its length. this allows the binding code to avoid extra reference-counting of the string buffer in many cases, and allows it to take a faster code
path even if it does end up having to addref the nsstringbuffer. globalobject globalobject is a class declared in bindingdeclarations.h and exported to mozilla/dom/bindingdeclarations.h that is used to represent the global object for static attributes and operations (including constructors). it has a get() method that returns the jsobject* for the global and a getassupports() method that returns an...
Standard OS Libraries
to work. the alternative to standard libraries is creating your own dll (for windows) or so (for linux) file with c functions that can be called from your add-on with js-ctypes. the dll/so/etc file you make must be shipped with your add-on. standard libraries offer the advantage of not having to ship anything. they are already available on the operating system for you. you just need to supply the
path to appropriate files and set up the proper types of values/arguments in the js-ctypes code. this article allows you to find out what types to give to values/arguments by supplying links to the documentation of the os libraries. windows windows has many standard os libraries. the most common, found on all windows os version, is "winapi". windows also has the "winapilists" and ".net framework" (i...
...the header file. the coregraphics framework is based on corefoundation framework, including coregraphics etc. the release, string, etc. comes from corefoundation. example: cgeventgetlocation for example, cgeventgetlocation function is declared in cgevent.h header file, which is contained in coregraphics.framework. so /system/library/frameworks/coregraphics.framework/coregraphics is the library
path to pass to ctypes.open function call. components.utils.import("resource://gre/modules/ctypes.jsm"); let coregraphics = ctypes.open("/system/library/frameworks/coregraphics.framework/coregraphics"); let corefoundation = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); let cgeventref = ctypes.voidptr_t; let cgeventsourceref = ctypes.voidptr_t; let cgeventcreate =...
Debugging service workers - Firefox Developer Tools
ster before you can look at your service worker in action in the applications panel, you need to successfully register it. registration is done with a block of code along these lines, using the register() method: if('serviceworker' in navigator) { navigator.serviceworker .register('sw.js') .then(function() { console.log('service worker registered'); }); } if you get the
path wrong, for example, you'll get an error in the web console giving you a hint as to what's wrong, which depends on what exactly is wrong with the code. if this is not enough to help you figure out the problem, you could also try going to the javascript debugger and stepping through your code to pinpoint exactly where it is going wrong. debugging your service worker in any case, when the service ...
...l see information about it displayed in the application > service workers view (along with any other service workers registered on the same domain): this gives you a variety of information about your service worker: the url that the service worker is registered on. that last time the service worker was updated (if the service has not been updated, this is when it was first installed). the
path to the service worker source file. the server worker’s status, which can be one of the following: stopped: the service worker is installed, but not currently running. when the service worker is stopped, a start button is provided to start it running, allowing you to trigger the service worker lifecycle. running: the service worker is running. there are a couple of other useful ...
Index - Firefox Developer Tools
e property always being "wasm" and the former having its introductiontype property never being "wasm". 25 tutorial: set a breakpoint this page shows how you can try out the debugger api yourself using firefox’s scratchpad. we use debugger to set a breakpoint in a function, and then evaluate an expression whenever it is hit. 26 tutorial: show allocations per call
path debugger, tools, tutorial this page shows how to use the debugger api to show how many objects a web page allocates, sorted by the function call
path that allocated them. 27 debugger.object a debugger.object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent. the referent's properties do not appea...
...s the grid inspector allows you to examine css grid layouts using the firefox devtools, discovering grids present on a page, examining and modifying them, debugging layout issues, and more. 58 edit css filters css, devtools, filters, page inspector, tools css filter properties in the rules view have a circular gray and white swatch next to them: 59 edit shape
paths in css css, devtools, page inspector, rules view, tools, highlighter, shapes the shape
path editor is a tool that helps you see and edit shapes created using clip-
path and also the css shape-outside property and <basic-shape> values. this guide walks you through all of the available options. 60 edit fonts fonts, guide, inspector, tools, variable fonts this article ...
Network request list - Firefox Developer Tools
. here is a list of all available columns: status: the http status code returned. the numeric code is displayed on a colored background, to help unusual ones stand out. if there was no response, this column is empty. or you might see a red circle with a diagonal slash for responses that were blocked by the browser or the server. method: the http request method used. domain: domain of the
path requested. if the request used ssl/tls and the connection had security weaknesses such as weak ciphers, you'll see a warning triangle next to the domain. y hover over the domain to see the ip address. there's an icon next to the domain that gives you extra information about the security status of that request. see security icons. file: the basename of the file requested. (...
... time exceeds a threshhold (default: 500 ms). a tooltip explains the problem. you can configure the threshhold in the configuration editor (about:config) by modifying the devtools.netmonitor.audits.slow setting. url: the url of the file requested. protocol: the network protocol used to transfer the data, this column is hidden by default. scheme: the scheme (https/http/ftp/...) of the
path requested. this column is hidden by default. remote ip: the ip address of the server answering the request. this column is hidden by default. type: content-type of the response. cookies: the number of request cookies associated to the request. this column is hidden by default. this is new in firefox 55. set-cookies: the number of response cookies associated to the request. this column is hi...
Call Tree - Firefox Developer Tools
nverted call tree is a good way to focus on these self cost values. this screenshot tells us something we probably already knew: bubble sort is a very inefficient algorithm. we have about six times as many samples in bubble sort as in selection sort, and 13 times as many as in quicksort. walking up the call tree next to each function name is a disclosure arrow: click that, and you can see the
path back up the call tree, from the function in which the sample was taken, to the root. for example, we can expand the entry for bubblesort(): so we can see the call graph is like this: sortall() -> sort() -> bubblesort() note also that self cost for sort() here is 1.45%, and note that this is the same as for the separate entry for sort() later in the list. this is telling us that...
...e entry for bubblesort(): so we can see the call graph is like this: sortall() -> sort() -> bubblesort() note also that self cost for sort() here is 1.45%, and note that this is the same as for the separate entry for sort() later in the list. this is telling us that some samples were taken in sort() itself, rather than in the functions it calls. sometimes there's more than one
path back from an entry to the top level. let's expand the entry for swap(): there were 253 samples taken inside swap(). but swap() was reached by two different
paths: both bubblesort() and selectionsort() use it. we can also see that 252 of the 253 samples in swap() were taken in the bubblesort() branch, and only one in the selectionsort() branch. this result means that bubble sort is even less e...
Debugging Firefox Desktop - Firefox Developer Tools
ave the "enable browser chrome and add-on debugging toolboxes" and "enable remote debugging" settings checked in the developer tools settings. you only need to do this once: the setting values persist across restarts. start the debugger server next, you need to start the debugger server in the debuggee. ...
... persist across restarts. start the debugger server next, you need to start the debugger server in the debuggee. run the debuggee from the command line, passing it the --start-debugger-server option: /
path/to/firefox --start-debugger-server passed with no arguments, --start-debugger-server makes the debugger server listen on port 6000. to use a different port, pass the desired port number: /
path/to/firefox --start-debugger-server 1234 note: in windows, the start-debugger-server call will only have one dash: firefox.exe -start-debugger-server 1234 note: by default, and for security reasons, the devtools.debugger.force-local option is set. if you want to debug a firefox instance from an external machine, you can change this option, but only do this on a trusted network or set a strong ...
CSS Painting API - Web APIs
log(thecolor); if ( strokewidth ) { ctx.linewidth = strokewidth; } else { ctx.linewidth = 1.0; } if ( stroketype === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.strokestyle = thecolor; } else if ( stroketype === 'filled' ) { ctx.fillstyle = thecolor; ctx.strokestyle = thecolor; } else { ctx.fillstyle = 'none'; ctx.strokestyle = 'none'; } ctx.begin
path(); ctx.moveto( x, y ); ctx.lineto( blockwidth, y ); ctx.lineto( blockwidth + blockheight, blockheight ); ctx.lineto( x, blockheight ); ctx.lineto( x, y ); ctx.close
path(); ctx.fill(); ctx.stroke(); for (let i = 0; i < 4; i++) { let start = i * 2; ctx.begin
path(); ctx.moveto( blockwidth + (start * 10) + 10, y); ctx.lineto( blockwidth + (start * 10) + 20, y); ctx...
...roke(); for (let i = 0; i < 4; i++) { let start = i * 2; ctx.begin
path(); ctx.moveto( blockwidth + (start * 10) + 10, y); ctx.lineto( blockwidth + (start * 10) + 20, y); ctx.lineto( blockwidth + (start * 10) + 20 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10, y); ctx.close
path(); ctx.fill(); ctx.stroke(); } } }); we then include the paintworklet: <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> <li>item 13</li> <li>item 14</li> <li>item 15</li> ...
CanvasRenderingContext2D.moveTo() - Web APIs
the canvasrenderingcontext2d.moveto() method of the canvas 2d api begins a new sub-
path at the point specified by the given (x, y) coordinates. syntax void ctx.moveto(x, y); parameters x the x-axis (horizontal) coordinate of the point. y the y-axis (vertical) coordinate of the point. examples creating multiple sub-
paths this example uses moveto() to create two sub-
paths within a single
path. both sub-
paths are then rendered with a single stroke() call. html <canvas id="canvas"></canvas> javascript the first line begins at (50, 50) and ends at (200, 50). the second line begins at (50, 90) and ends at (280, 120). ...
...hs this example uses moveto() to create two sub-
paths within a single
path. both sub-
paths are then rendered with a single stroke() call. html <canvas id="canvas"></canvas> javascript the first line begins at (50, 50) and ends at (200, 50). the second line begins at (50, 90) and ends at (280, 120). var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.begin
path(); ctx.moveto(50, 50); // begin first sub-
path ctx.lineto(200, 50); ctx.moveto(50, 90); // begin second sub-
path ctx.lineto(280, 120); ctx.stroke(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.moveto' in that specification. living standard ...
CanvasRenderingContext2D.setLineDash() - Web APIs
25]. if the array is empty, the line dash list is cleared and line strokes return to being solid. return value undefined. examples basic example this example uses the setlinedash() method to draw a dashed line above a solid line. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // dashed line ctx.begin
path(); ctx.setlinedash([5, 15]); ctx.moveto(0, 50); ctx.lineto(300, 50); ctx.stroke(); // solid line ctx.begin
path(); ctx.setlinedash([]); ctx.moveto(0, 100); ctx.lineto(300, 100); ctx.stroke(); result some common patterns this example illustrates a variety of common line dash patterns. html <canvas id="canvas"></canvas> javascript the drawdashedline() function created below makes the dra...
... ctx.moveto(0, 100); ctx.lineto(300, 100); ctx.stroke(); result some common patterns this example illustrates a variety of common line dash patterns. html <canvas id="canvas"></canvas> javascript the drawdashedline() function created below makes the drawing of multiple dashed lines simple. it receives a pattern array as its only parameter. ...
CustomEvent - Web APIs
le. event.composed read only a boolean indicating whether or not the event can bubble across the boundary between the shadow dom and the regular dom. event.currenttarget read only a reference to the currently registered target for the event. this is the object to which the event is currently slated to be sent. it's possible this has been changed along the way through retargeting. event.deep
path an array of dom nodes through which the event has bubbled. event.defaultprevented read only indicates whether or not the call to event.preventdefault() canceled the event. event.eventphase read only indicates which phase of the event flow is being processed. event.explicitoriginaltarget read only the explicit original target of the event (mozilla-specific.) event.originaltarget r...
...e across through the shadow root into the standard dom.) methods customevent.initcustomevent() initializes a customevent object. if the event has already being dispatched, this method does nothing. this interface inherits methods from its parent, event: event.createevent() creates a new event, which must then be initialized by calling its initevent() method. event.composed
path() returns the event’s
path (objects on which listeners will be invoked). this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. event.initevent() initializes the value of an event created. if the event has already been dispatched, this method does nothing. event.preventdefault() cancels the event (if it is cancelable). event.stopim...
DOMMatrixReadOnly.flipX() - Web APIs
nterface creates a new matrix being the result of the original matrix flipped about the x-axis. syntax dommatrix.flipx() return value returns a dommatrix containing a new matrix being the result of the original matrix flipped about the x-axis, which is equivalent to multiplying the matrix by dommatrix(-1, 0, 0, 1, 0, 0). the original matrix is not modified. ...
...-axis, which is equivalent to multiplying the matrix by dommatrix(-1, 0, 0, 1, 0, 0). the original matrix is not modified. examples this svg contains two
paths in the shape of a triangle, both drawn to the same position. note that the x co-ordinate of the viewbox attribute is negative, showing us content from both sides of the x-axis. <svg width="100" height="100" viewbox="-50 0 100 100"> <
path fill="red" d="m 0 50 l 50 0 l 50 100 z" /> <
path id="flipped" fill="blue" d="m 0 50 l 50 0 l 50 100 z" /> </svg> this javascript first creates an identity matrix, then uses the `flipx()` method to create a new matrix, which is then applied to the blue triangle, inverting it across the x-axis. the red triangle is left in place. const flipped = document.getelementbyid('flipped'); const matrix ...
DirectoryReaderSync - Web APIs
nsole.log(fileentry.name); }); }); }; worker.postmessage({'cmd': 'list'}); the following is worker.js code that gets the contents of the directory. // taking care of the browser-specific prefixes. self.requestfilesystemsync = self.webkitrequestfilesystemsync || self.requestfilesystemsync; // global for holding the list of entry file system urls. var
paths = []; function getallentries(dirreader) { var entries = dirreader.readentries(); for (var i = 0, entry; entry = entries[i]; ++i) { // stash this entry's filesystem in url
paths.push(entry.tourl()); // if this is a directory, traverse. if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the error to main app. function onerror(e) { p...
...rror to main app. function onerror(e) { postmessage('error: ' + e.tostring()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our 'list' command. if (!data.cmd || data.cmd != 'list') { return; } try { var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries:
paths}); } catch (e) { onerror(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory. call this method until an empty array is returned. entrysync readentries ( ) raises (fileexception); returns parameter none exceptions this method can raise a fileexception with the followin...
Document.createExpression() - Web APIs
this method compiles an x
pathexpression which can then be used for (repeated) evaluations. syntax x
pathexpr = document.createexpression(x
pathtext, namespaceurlmapper); parameters x
pathtext is a string which is the x
path expression to be compiled. namespaceurlmapper is a function which maps a namespace prefix to a namespace url (or null if none needed). firefox 3 note prior to firefox 3, you could call this method on documents other than the one you planned to run the x
path against. under firefox 3, you must call it on the same document. ...
...ers x
pathtext is a string which is the x
path expression to be compiled. namespaceurlmapper is a function which maps a namespace prefix to a namespace url (or null if none needed). firefox 3 note prior to firefox 3, you could call this method on documents other than the one you planned to run the x
path against. under firefox 3, you must call it on the same document. ...
Document.getElementsByTagNameNS() - Web APIs
some outer text</p> <button onclick="getallparaelems();"> show all p elements in document</button><br /> <button onclick="div1paraelems();"> show all p elements in div1 element</button><br /> <button onclick="div2paraelems();"> show all p elements in div2 element</button> </body> </html> potential workaround for other browsers which do not support if the desired browser did not support x
path, another approach (such as traversing the dom through all its children, identifying all @xmlns instances, etc.) would be necessary to find all tags with the desired local name and namespace, but x
path is much faster. (to accommodate explorer, one could call an x
path wrapper instead of the x
path in the function below (as explorer supports x
path with a different api), such as this wrapper class.) ...
...could call an x
path wrapper instead of the x
path in the function below (as explorer supports x
path with a different api), such as this wrapper class.) function getelementsbytagnamenswrapper (ns, elname, doc, context) { if (!doc) { doc = document; } if (!context) { context = doc; } var result = doc.evaluate('//*[local-name()="'+elname+'" and namespace-uri() = "'+ns+'"]', context, null, x
pathresult.ordered_node_snapshot_type, null); var a = []; for(var i = 0; i < result.snapshotlength; i++) { a[i] = result.snapshotitem(i); } return a; } specifications specification status comment domthe definition of 'document.getelementsbytagnamens' in that specification. living standard ...
Document - Web APIs
document.getelementbyid(string id) returns an object reference to the identified element. document.queryselector() returns the first element node within the document, in document order, that matches the specified selectors. document.queryselectorall() returns a list of all the element nodes within the document that match the specified selectors. the document interface is extended with the x
pathevaluator interface: document.createexpression() compiles an x
pathexpression which can then be used for (repeated) evaluations. document.creatensresolver() creates an x
pathnsresolver object. document.evaluate() evaluates an x
path expression. extension for html documents the document interface for html documents inherit from the htmldocument interface or, since html5, is extended for suc...
...'document' in that specification. working draft adds getselection(), onselectstart and onselectionchange. dom4the definition of 'document' in that specification. obsolete supersede dom 3 document object model (dom) level 3 core specificationthe definition of 'document' in that specification. obsolete supersede dom 2 document object model (dom) level 3 x
path specificationthe definition of 'x
pathevaluator' in that specification. recommendation define the x
pathevaluator interface which extend document. document object model (dom) level 2 core specificationthe definition of 'document' in that specification. obsolete supersede dom 1 document object model (dom) level 1 specificationthe definition of 'document' in that specifi...
Element: mousedown event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mouse...
... working draft document object model (dom) level 3 events specificationthe definition of 'mousedown' in that specification. obsolete ...
Element: mousemove event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mouse...
... working draft document object model (dom) level 3 events specificationthe definition of 'mousemove' in that specification. obsolete ...
Element: mouseup event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mouseup...
... working draft document object model (dom) level 3 events specificationthe definition of 'mouseup' in that specification. obsolete ...
Event - Web APIs
le. event.composed read only a boolean indicating whether or not the event can bubble across the boundary between the shadow dom and the regular dom. event.currenttarget read only a reference to the currently registered target for the event. this is the object to which the event is currently slated to be sent. it's possible this has been changed along the way through retargeting. event.deep
path an array of dom nodes through which the event has bubbled. event.defaultprevented read only indicates whether or not the call to event.preventdefault() canceled the event. event.eventphase read only indicates which phase of the event flow is being processed. event.explicitoriginaltarget read only the explicit original target of the event (mozilla-specific.) event.originaltarget r...
...ted read only indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like event.initevent). deprecated properties event.scoped read only a boolean indicating whether the given event will bubble across through the shadow root into the standard dom. use composed instead. methods event.composed
path() returns the event’s
path (objects on which listeners will be invoked). this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. event.preventdefault() cancels the event (if it is cancelable). event.stopimmediatepropagation() for this particular event, prevent all other listeners from being called. this includes listeners attached to t...
Using Fetch - Web APIs
ls policy to same-origin. firefox changed since 61.0b13.) a basic fetch request is really simple to set up. have a look at the following code: fetch('http://example.com/movies.json') .then(response => response.json()) .then(data => console.log(data)); here we are fetching a json file across the network and printing it to the console. the simplest use of fetch() takes one argument — the
path to the resource you want to fetch — and returns a promise containing the response (a response object). this is just an http response, not the actual json. to extract the json body content from the response, we use the json() method (defined on the body mixin, which is implemented by both the request and response objects.) note: the body mixin also has similar methods to extract other types o...
...: fetch('flowers.jpg') .then(response => { if (!response.ok) { throw new error('network response was not ok'); } return response.blob(); }) .then(myblob => { myimage.src = url.createobjecturl(myblob); }) .catch(error => { console.error('there has been a problem with your fetch operation:', error); }); supplying your own request object instead of passing a
path to the resource you want to request into the fetch() call, you can create a request object using the request() constructor, and pass that in as a fetch() method argument: const myheaders = new headers(); const myrequest = new request('flowers.jpg', { method: 'get', headers: myheaders, mode: 'cors', cache: 'default', }); fetch(myrequest) .then(response => response.blob()) .then(mybl...
HTMLCanvasElement.mozFetchAsStream() - Web APIs
ge/png. return value none. examples save to disk with mozfetchasstream (chrome context only) this technique also converts it to ico, however it will not work in windows xp as winxp cannot convert from png to ico. it saves to the desktop it uses fileutils.jsm. ...
...m (chrome context only) this technique also converts it to ico, however it will not work in windows xp as winxp cannot convert from png to ico. it saves to the desktop it uses fileutils.jsm. ...
HTMLImageElement.alt - Web APIs
t. in ac neque libero. vivamus consectetur rhoncus elit eget porta. etiam pulvinar ex id sapien laoreet, quis aliquet odio lobortis. nam ac mauris at risus laoreet cursus vitae et sapien. etiam molestie auctor eros, ac porta risus scelerisque sit amet. ut nunc neque, porta eu auctor at, tempor et arcu. ...
...t sapien. etiam molestie auctor eros, ac porta risus scelerisque sit amet. ut nunc neque, porta eu auctor at, tempor et arcu. </p> </div> css the main feature of the css here is the use of clip-
path and shape-outside to wrap the text around the icon in an appealing way. ...
IDBDatabase: abort event - Web APIs
it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
... // abort the transaction transaction.abort(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
IDBDatabase: close event - Web APIs
event event handler property onerror examples this example opens a database and listens for the close event: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
... console.log('database connection closed'); }); }; the same example, using the onclose property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
IDBDatabase: error event - Web APIs
ng for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
...nst objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
IDBDatabase: versionchange event - Web APIs
ndler property onversionchange examples this example opens a database and, on success, adds a listener to versionchange: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
...le.log('the version of this database has changed'); }); }); the same example, using the onversionchange event handler property: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
IDBDatabaseSync - Web APIs
for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the databasesync interface in the indexeddb api represents a synchronous connection to a database. ...
...s of the object stores that exist in the connected database. version readonly domstring the version of the connected database. has the null value when the database is first created. methods createobjectstore() creates and returns a new object store with the given name in the connected database. idbobjectstoresync createobjectstore( in domstring name, in domstring key
path, in optional boolean autoincrement ) raises (idbdatabaseexception); parameters name the name of a new object store. key
path the key
path used by the new object store. if a null
path is specified, then the object store does not have a key
path, and uses out-of-line keys. autoincrement if true, the object store uses a key generator; if false, it does not use one. returns idbobject...
IDBIndex - Web APIs
to specified upon its creation (see createindex()'s optionalparameters.) idbindex.locale read only returns the locale of the index (for example en-us, or pl) if it had a locale value specified upon its creation (see createindex()'s optionalparameters.) idbindex.name the name of this index. idbindex.objectstore read only the name of the object store referenced by this index. idbindex.key
path read only the key
path of this index. if null, this index is not auto-populated. idbindex.multientry read only affects how the index behaves when the result of evaluating the index's key
path yields an array. if true, there is one record in the index for each item in an array of keys. if false, then there is one record for each key that is an array. idbindex.unique read only if true, this...
... nochrome android no support nofirefox android full support 43opera android no support nosafari ios no support nosamsung internet android no support nokey
pathchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support ...
IDBIndexSync - Web APIs
if this attribute is null, this index is not auto-populated. name readonly domstring the name of this index. storename readonly domstring this index's referenced object store. unique readonly boolean if true, a key can have only one value within the index; if false, a key can have duplicate values. ...
...n); void openobjectcursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description key
path readonly domstring the key
path of this index. if this attribute is null, this index is not auto-populated. name readonly domstring the name of this index. storename readonly domstring this index's referenced object store. unique readonly boolean if true, a key can have only one value within the index; if false, a key can have duplicate values. methods add() stores the given...
IDBOpenDBRequest: blocked event - Web APIs
erty onblocked examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
...uest was blocked'); }); }; using the onblocked property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
IDBRequest: error event - Web APIs
cord with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }); d...
...ple, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
IDBRequest: success event - Web APIs
base and listens for the success event using addeventlistener(): // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; op...
...he same example, but using the onsuccess event handler property: // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; op...
IDBTransaction: abort event - Web APIs
abort event, then aborts the transaction to trigger the event. ...
...mple, but assigning the event handler to the onabort property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
IDBTransaction: complete event - Web APIs
perty oncomplete examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
...objectstore.add(newitem); }; using the oncomplete property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
IDBTransaction: error event - Web APIs
ng for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
...nst objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { key
path: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; db...
Transcoding assets for Media Source Extensions - Web APIs
t 2008, blender foundation / www.bigbuckbunny.org / https://peach.blender.org/about/ tools required when working with mse, the following tools are a must have: ffmpeg — a command-line utility for transcoding your media into the required formats. you can download a version for your system at the download ffmpeg page. extract the executable from the archive file and add it's location to your
path statement. osx users can also use homebrew to install ffmpeg. bento4 — a set of command-line utilities for getting asset metadata and creating content for dash. to install, you'll need to build/compile the application yourself from the provided project files/source files, depending on your os and preferences. see the building instructions for more details. the prebuilt file is here. put the co...
...et started. if you wish to employ adaptive bitrate streaming, you'll have to create encodings at multiple resolutions. while mse is flexible enough to allow you to make your implementation, it's highly recommended to use an existing dash client as dash is a well-specified application protocol. creating content for dash given that you have ffmpeg and bento4's utilities accessible through your $
path, you can run bento4's mp4-dash-encode.py python script to generate multiple encodings of your content at various resolutions. bento4's mp4-dash.py python script can then be used to generate the corresponding mpd file needed by clients. run the following commands (shown with sample output): $ python mp4-dash-encode.py -b 5 -v bunny_fragmented.mp4 encoding 5 bitrates, min bitrate = 500.0 max bitr...
URLUtilsReadOnly - Web APIs
ng containing the host, that is the hostname, a ':', and the port of the url. urlutilsreadonly.hostname read only is a domstring containing the domain of the url. urlutilsreadonly.origin read only returns a domstring containing the canonical form of the origin of the specific location. urlutilsreadonly.port read only is a domstring containing the port number of the url. urlutilsreadonly.
pathname read only is a domstring containing an initial '/' followed by the
path of the url. urlutilsreadonly.search read only is a domstring containing a '?' followed by the parameters of the url. urlutilsreadonly.hash read only is a domstring containing a '#' followed by the fragment identifier of the url. methods this interface doesn't inherit any methods. urlutilsreadonly.tostring() ...
... nochrome android no support nofirefox android full support 29opera android no support nosafari ios no support nosamsung internet android no support no
pathname experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support ...
Advanced techniques: Creating and sequencing audio - Web APIs
...
...udiobuffer; } we can then use the await operator when calling this function, which ensures that we can only run subsequent code when it has finished executing. let's create another async function to set up the sample — we can combine the two async functions in a nice promise pattern to perform further actions when this file is loaded and buffered: async function setupsample() { const file
path = 'dtmf.mp3'; const sample = await getfile(audioctx, file
path); return sample; } note: you can easily modify the above function to take an array of files and loop over them to load more than one sample. this would be very handy for more complex instruments, or gaming. we can now use setupsample() like so: setupsample() .then((sample) => { // sample is our buffered file ...
Migrating from webkitAudioContext - Web APIs
other part of your web page's code could execute in the mean time. because of these problems, this version of the createbuffer() method has been removed, and you should use the asynchronous decodeaudiodata() method instead. ...
...(); xhr.onload = function() { var decodedbuffer = context.createbuffer(xhr.response, false); if (decodedbuffer) { // decoding was successful, do something useful with the audio buffer } else { alert("decoding the audio buffer failed"); } }; converting this code to use decodeaudiodata() is relatively simple, as can be seen below: var xhr = new xmlhttprequest(); xhr.open("get", "/
path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { context.decodeaudiodata(xhr.response, function onsuccess(decodedbuffer) { // decoding was successful, do something useful with the audio buffer }, function onfailure() { alert("decoding the audio buffer failed"); }); }; note that the decodeaudiodata() method is asynchronous, which means th...
Using IIR filters - Web APIs
ffsetwidth; const height = canvascontainer.offsetheight; canvasel.width = width; canvasel.height = height; // set background fill canvasctx.fillstyle = 'white'; canvasctx.fillrect(0, 0, width, height); // set up some spacing based on size const spacing = width/16; const fontsize = math.floor(spacing/1.5); // draw our axis canvasctx.linewidth = 2; canvasctx.strokestyle = 'grey'; canvasctx.begin
path(); canvasctx.moveto(spacing, spacing); canvasctx.lineto(spacing, height-spacing); canvasctx.lineto(width-spacing, height-spacing); canvasctx.stroke(); // axis is gain by frequency -> make labels canvasctx.font = fontsize+'px sans-serif'; canvasctx.fillstyle = 'grey'; canvasctx.filltext('1', spacing-fontsize, spacing+fontsize); canvasctx.filltext('g', spacing-fontsize, (height-spacing+fontsize)/2...
...this should have shown you how to use the basics, and helpe...
Visualizations with Web Audio API - Web APIs
var slicewidth = width * 1.0 / bufferlength;...
... var slicewidth = width * 1.0 / bufferlength; var x = 0; now we run through a loop, defining the position of a small segment of th...
window.location - Web APIs
dified url. note that security settings, like cors, may prevent this to effectively happen. ...
...ppen. ...
Window.open() - Web APIs
into the new or existing browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new browsing context is opened in a new tab or a new window, and the specified resource is loaded into it. syntax var window = window.open(url, windowname, [windowfeatures]); parameters url a domstring indicating the url of the resource to be loaded. this can be a
path or url to an html page, image file, or any other resource that is supported by the browser. if the empty string ("") is specified as url, a blank page is opened into the targeted browsing context. windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new...
...hronously. examples var windowobjectreference; var windowfeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes"; function openrequestedpopup() { windowobjectreference = window.open("http://www.cnn.com/", "cnn_windowname", windowfeatures); } var windowobjectreference; function openrequestedpopup() { windowobjectreference = window.open( "http://www.domainname.ext/
path/imagefile.png", "descriptivewindowname", "resizable,scrollbars,status" ); } if a window with the name already exists, then url is loaded into the existing window. in this case the return value of the method is the existing window and windowfeatures is ignored. providing an empty string for url is a way to get a reference to an open window by its name without changing the window's locat...
Introduction - Web APIs
ent (the content) should be laid out. however, it has several limitations, such as lack of programming structures and ability to create complex layout models. css also has limited support for changing the position of an element. xsl (extensible stylesheet language) transformations are composed of two parts: xsl elements, which allow the transformation of an xml tree into another markup tree and x
path, a selection language for trees. xslt takes an xml document (the content) and creates a brand new document based on the rules in the xsl stylesheet. this allows xslt to add, remove and reorganize elements from the original xml document and thus allows more fine-grain control of the resulting document's structure. transformations in xslt are based on rules that consist of templates. each template...
...guage for trees. xslt takes an xml document (the content) and creates a brand new document based on the rules in the xsl stylesheet. this allows xslt to add, remove and reorganize elements from the original xml document and thus allows more fine-grain control of the resulting document's structure. transformations in xslt are based on rules that consist of templates. each template matches (using x
path) a certain fragment of the input xml document and then applies the substitution part on that fragment to create the new resulting document. ...
Animatable CSS properties - CSS: Cascading Style Sheets
der-left border-left-color border-left-width border-radius border-right border-right-color border-right-width border-start-end-radius border-start-start-radius border-top border-top-color border-top-left-radius border-top-right-radius border-top-width border-width bottom box-shadow caret-color clip clip-
path color column-count column-gap column-rule column-rule-color column-rule-width column-width columns filter flex flex-basis flex-grow flex-shrink font font-size font-size-adjust font-stretch font-variation-settings font-weight gap grid-column-gap grid-gap grid-row-gap grid-templat...
... margin-inline-end margin-inline-start margin-left margin-right margin-top mask mask-border mask-position mask-size max-block-size max-height max-inline-size max-lines max-width min-block-size min-height min-inline-size min-width object-position offset offset-anchor offset-distance offset-
path offset-position offset-rotate opacity order outline outline-color outline-offset outline-width padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top perspective perspective-origin right rotate row-gap ...
Linear-gradient Generator - CSS: Cascading Style Sheets
ient-axis .rotate-point { width: 25px; height: 25px; position: absolute; top: -10.5px; right: -12px; } .gradient-axis[axisid='0']:after { background-color: #da5c5c; } .gradient-axis[axisid='1']:after { background-color: #5cda9b; } .gradient-axis[axisid='2']:after { background-color: #5c9bda; } .gradient-axis[axisid='3']:after { background-color: #5c5cda; } .gradient-axis[axisid='0']
path { fill: #da5c5c; } .gradient-axis[axisid='1']
path { fill: #5cda9b; } .gradient-axis[axisid='2']
path { fill: #5c9bda; } .gradient-axis[axisid='3']
path { fill: #5c5cda; } .gradient-axis .rotate-point:hover { cursor: pointer; } /** * controls */ #controls { width: 100%; margin: 0 auto; display: table; } #controls .section { width: 50%; padding: 10px; display: table; float: l...
...s.updateonresize(); trackmouse(rotate_point, this.updateaxisangle.bind(this), this.startrotation.bind(this)); container.appendchild(axis); line.addeventlistener('click', this.placegradientpoint.bind(this)); }; gradientaxis.prototype.createsvgarrow = function createsvgarrow(id) { var xmlns = 'http://www.w3.org/2000/svg'; var svg = document.createelementns(xmlns, 'svg'); var
path = document.createelementns(xmlns, '
path'); svg.setattribute('class', 'gradient-arrow'); svg.setattribute('width', '25'); svg.setattribute('height', '25');
path.setattribute('fill', '#ccc');
path.setattribute('d', 'm 25,12.5 l 0,0 l 7.5,12.5 l 0,25'); svg.appendchild(
path); return svg; }; gradientaxis.prototype.placegradientpoint = function placegradientpoint(e) { this.updat...
clip - CSS: Cascading Style Sheets
element. the clip property applies only to absolutely positioned elements — that is, elements with position:absolute or position:fixed. /* keyword value */ clip: auto; /* <shape> values */ clip: rect(1px 10em 3rem 2ch); clip: rect(1px, 10em, 3rem, 2ch); /* global values */ clip: inherit; clip: initial; clip: unset; syntax note: where possible, authors are encouraged to use the newer clip-
path property instead. values <<shape>()> a rectangular <<shape>()> of the form rect(<top> <right> <bottom> <left>). the <top> and <bottom> values are offsets from the inside top border edge of the box, while <right> and <left> are offsets from the inside left border edge of the box — that is, the extent of the padding box. the <top>, <right>, <bottom>, and <left> values may be either a <len...
... css level 2 (revision 1)the definition of 'clip' in that specification. recommendation initial definition. ...
<shape> - CSS: Cascading Style Sheets
syntax the <shape> data type is specified using the rect() function, which produces a region in the form of a rectangle. ...
... syntax the <shape> data type is specified using the rect() function, which produces a region in the form of a rectangle. ...
Ajax - Developer guides
simplified subset of sgml, capable of describing many different kinds of data. its primary purpose is to facilitate the sharing of data across different systems, particularly systems connected via the internet. parsing and serializing xml how to parse an xml document from a string, a file or via javascript and how to serialize xml documents to strings, javascript object trees (jxon) or files. x
path x
path stands for xml
path language, it uses a non-xml syntax that provides a flexible way of addressing (pointing to) different parts of an xml document. as well as this, it can also be used to test addressed nodes within a document to determine whether they match a pattern or not. filereader api the filereader api lets web applications asynchronously read the contents of files (or raw data bu...
...xmlhttprequest specification adds html parsing support to xmlhttprequest, which originally supported only xml parsing. this feature allows web apps to obtain an html resource as a parsed dom using xmlhttprequest. view all... tools axios promise based http client, which uses xmlhttprequest internally. see also ajax: a new approach to web applications jesse james garrett, of adaptive
path, wrote this article in february 2005, introducing ajax and its related concepts. xmlhttprequest specification whatwg living standard ...
A hybrid approach - Developer guides
but even if it does not work, it is no worse with respect to performance than only using fluid images. by combining the techniques listed above, we can get a mobile web development strategy that is both more flexible than pure separate sites and has better performance than pure responsive design. the bad one downside of mixing approaches is that it can lead to an increase in the number of code
paths, both on the client and server side. this can make it more time-consuming to develop than other approaches. with proper planning, though, the code can still be organized in a maintainable way. another downside is that because this approach relies on responsive design, it typically works best on a new project or one that has an existing flexible layout, not as a retrofit. similarly, because it us...
...ion of the hybrid approach, with positive results. we used some elements of responsive web design to give the site a mobile layout, along with user-agent detection to provide mobile-friendly videos and to re-order the demos if the user is on a phone. feel free to check out the source code on github. we could also be doing more development involving this approach very soon! in fact, one potential
path for the main mozilla site is roughly outlined in the “the good” section above: using user-agent detection, route visitors to a landing page for the firefox version for their device. every page on the site should look great at a wide variety of resolutions, being built with responsive design in mind. future plans include exploring serving images based on user-agent. so far there is not ...
<a>: The Anchor element - HTML: Hypertext Markup Language
nd send us a pull request. attributes this element's attributes include the global attributes. downloadhtml5 prompts the user to save the linked url instead of navigating to it. can be used with or without a value: without a value, the browser will suggest a filename/extension, generated from various sources: the content-disposition http header the final segment in the url
path the media type (from the (content-type header, the start of a data: url, or blob.type for a blob: url) defining a value suggests it as the filename. / and \ characters are converted to underscores (_). filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary. notes: download only works for same-origin urls, or the blob: an...
...> <canvas width="300" height="300"></canvas> css html { font-family: sans-serif; } canvas { background: #fff; border: 1px dashed; } a { display: inline-block; background: #69c; color: #fff; padding: 5px 10px; } javascript var canvas = document.queryselector('canvas'), c = canvas.getcontext('2d'); c.fillstyle = 'hotpink'; function draw(x, y) { if (isdrawing) { c.begin
path(); c.arc(x, y, 10, 0, math.pi*2); c.close
path(); c.fill(); } } canvas.addeventlistener('mousemove', event => draw(event.offsetx, event.offsety) ); canvas.addeventlistener('mousedown', () => isdrawing = true); canvas.addeventlistener('mouseup', () => isdrawing = false); document.queryselector('a').addeventlistener('click', event => event.target.href = canvas.todataurl() ); re...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
t be sent. no-referrer-when-downgrade (default): the referer header will not be sent to origins without tls (https). origin: the sent referrer will be limited to the origin of the referring page: its scheme, host, and port. origin-when-cross-origin: the referrer sent to other origins will be limited to the scheme, the host, and the port. navigations on the same origin will still include the
path. same-origin: a referrer will be sent for same origin, but cross-origin requests will contain no referrer information. strict-origin: only send the origin of the document as the referrer when the protocol security level stays the same (https→https), but don't send it to a less secure destination (https→http). strict-origin-when-cross-origin: send a full url when performing a same-origin...
...level stays the same (https→https), but don't send it to a less secure destination (https→http). strict-origin-when-cross-origin: send a full url when performing a same-origin request, only send the origin when the protocol security level stays the same (https→https), and send no header to a less secure destination (https→http). unsafe-url: the referrer will include the origin and the
path (but not the fragment, password, or username). this value is unsafe, because it leaks origins and
paths from tls-protected resources to insecure origins. sandbox applies extra restrictions to the content in the frame. the value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions: allow-downloads-without-user-activatio...
<img>: The Image Embed element - HTML: Hypertext Markup Language
the html <img> element embeds an image into the document. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the above example shows usage of the <img> element: the src attribute is required, and contains the
path to the image you want to embed. the alt attribute holds a text description of the image, which isn't mandatory but is incredibly useful for accessibility — screen readers read this description out to their users so they know what the image means. alt text is also displayed on the page if the image can't be loaded for some reason: for example, network errors, content blocking, or linkrot. there are ma...
...: no referer header is sent when navigating to an origin without https. this is the default if no policy is otherwise specified. origin: the referer header will include the page's origin (scheme, host, and port). origin-when-cross-origin: navigating to other origins will limit the included referral data to the scheme, host, and port, while navigating from the same origin will include the full
path and query string. unsafe-url: the referer header will always include the origin,
path and query string, but not the fragment, password, or username. this is unsafe because it can leak information from tls-protected resources to insecure origins. sizes one or more strings separated by commas, indicating a set of source sizes. each source size consists of: a media condition. this must b...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
gs. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. to link an external stylesheet, you'd include a <link> element inside your <head> like this: <link href="main.css" rel="stylesheet"> this simple example provides the
path to the stylesheet inside an href attribute, and a rel attribute with a value of stylesheet. the rel stands for "relationship", and is probably one of the key features of the <link> element — the value denotes how the item being linked to is related to the containing document. as you'll see from our link types reference, there are many different kinds of relationship. there are a number of othe...
...out tls (https). this is a user agent’s default behavior, if no policy is otherwise specified. origin means that the referrer will be the origin of the page, which is roughly the scheme, the host, and the port. origin-when-cross-origin means that navigating to other origins will be limited to the scheme, the host, and the port, while navigating on the same origin will include the referrer's
path. unsafe-url means that the referrer will include the origin and the
path (but not the fragment, password, or username). this case is unsafe because it can leak origins and
paths from tls-protected resources to insecure origins. rel this attribute names a relationship of the linked document to the current document. the attribute must be a space-separated list of link type values. sizes t...
<script>: The Script element - HTML: Hypertext Markup Language
t be sent. no-referrer-when-downgrade (default): the referer header will not be sent to origins without tls (https). origin: the sent referrer will be limited to the origin of the referring page: its scheme, host, and port. origin-when-cross-origin: the referrer sent to other origins will be limited to the scheme, the host, and the port. navigations on the same origin will still include the
path. same-origin: a referrer will be sent for same origin, but cross-origin requests will contain no referrer information. strict-origin: only send the origin of the document as the referrer when the protocol security level stays the same (e.g. https→https), but don't send it to a less secure destination (e.g. https→http). strict-origin-when-cross-origin: send a full url when performing a s...
....g. https→https), but don't send it to a less secure destination (e.g. https→http). strict-origin-when-cross-origin: send a full url when performing a same-origin request, but only send the origin when the protocol security level stays the same (e.g.https→https), and send no header to a less secure destination (e.g. https→http). unsafe-url: the referrer will include the origin and the
path (but not the fragment, password, or username). this value is unsafe, because it leaks origins and
paths from tls-protected resources to insecure origins. note: an empty string value ("") is both the default value, and a fallback value if referrerpolicy is not supported. if referrerpolicy is not explicitly specified on the <script> element, it will adopt a higher-level referrer policy, i.e. ...
Identifying resources on the Web - HTTP
the web address. https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.mozilla.org/search?q=url any of those urls can be typed into your browser's address bar to tell it to load the associated page (resource). a url is composed of different parts, some mandatory and others are optional. a more complex example might look like this: http://www.example.com:80/
path/to/myfile.html?key1=value1&key2=value2#somewhereinthedocument urns a uniform resource name (urn) is a uri that identifies a resource by name in a particular namespace. urn:isbn:9780141036144 urn:ietf:rfc:7230 the two urns correspond to the book nineteen eighty-four by george orwell, the ietf specification 7230, hypertext transfer protocol (http/1.1): message syntax and routing. syntax ...
...ctly use an ip address, but because it is less convenient, it is not often used on the web. port :80 is the port in this instance. it indicates the technical "gate" used to access the resources on the web server. it is usually omitted if the web server uses the standard ports of the http protocol (80 for http and 443 for https) to grant access to its resources. otherwise it is mandatory.
path /
path/to/myfile.html is the
path to the resource on the web server. in the early days of the web, a
path like this represented a physical file location on the web server. nowadays, it is mostly an abstraction handled by web servers without any physical reality. query ?key1=value1&key2=value2 are extra parameters provided to the web server. those parameters are a list of key/value pair...
Content Security Policy (CSP) - HTTP
the csp specification gives an explanation of this odd behaviour. in summary, this is done to prevent leaking sensitive infor...
... "style-src cdn.example.com", "original-policy": "default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports" } } as you can see, the report includes the full
path to the violating resource in blocked-uri. this is not always the case. for example, if the signup.html attempted to load css from http://anothercdn.example.com/stylesheet.css, the browser would not include the full
path, but only the origin (http://anothercdn.example.com). the csp specification gives an explanation of this odd behaviour. in summary, this is done to prevent leaking sensitive information about cross-origin resources. ...
Content-Security-Policy-Report-Only - HTTP
this is done to prevent leaking sensitive information about cross-origin resources. specifications specificat...
...this is done to prevent leaking sensitive information about cross-origin resources. ...
Index - HTTP
ument is allowed to set document.domain. when this policy is enabled, attempting to set document.domain will fail and cause a securityerror domexception to be be thrown. 74 forwarded http, http header, reference, request header, header the forwarded header contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the
path of the request. 75 from http, reference, header the from request header contains an internet email address for a human user who controls the requesting user agent. 76 host http, reference, header the host request header specifies the domain name of the server (for virtual hosting), and (optionally) the tcp port number on which the server is listening. ...
... field. 86 location http, http header, reference, response header the location response header indicates the url to redirect a page to. it only provides a meaning when served with a 3xx (redirection) or 201 (created) status response. 87 origin http, reference, header the origin request header indicates where a fetch originates from. it doesn't include any
path information, but only the server name. it is sent with cors requests, as well as with post requests. it is similar to the referer header, but, unlike this header, it doesn't disclose the whole
path. 88 pragma caching, deprecated, http, header, request the pragma http/1.0 general header is an implementation-specific header that may have various effects along the request-respon...
HTTP headers - HTTP
algorithm. content-language describes the human language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language. content-location indicates an alternate location for the returned data. proxies forwarded contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the
path of the request. x-forwarded-for identifies the originating ip addresses of a client connecting to a web server through an http proxy or a load balancer. x-forwarded-host identifies the original host requested that a client used to connect to your proxy or load balancer. x-forwarded-proto identifies the protocol (http or https) that a client used to connect to your proxy or load balanc...
...for an exchange, each one accompanied by information about how to determine the authority of and refresh that signature. signed-headers the signed-headers header field identifies an ordered list of response header fields to include in a signature. server-timing communicates one or more metrics and descriptions for the given request-response cycle. service-worker-allowed used to remove the
path restriction by including this header in the response of the service worker script. sourcemap links generated code to a source map. upgrade the relevant rfc document for the upgrade header field is rfc 7230, section 6.7. the standard establishes rules for upgrading or changing to a different protocol on the current client, server, transport protocol connection. for example, this header standar...
Grammar and types - JavaScript
* multi-line comment */ /* you can't, however, /* nest comments */ syntaxerror */ comments behave like whitespace, and are discarded during script execution. note: you might also see a third type of comment syntax at the start of some javascript files, which looks something like this: #!/usr/bin/env node. this is called hashbang comment syntax, and is a special comment used to specify the
path to a particular javascript engine that should execute the script. see hashbang comments for more details. declarations javascript has three kinds of variable declarations. var declares a variable, optionally initializing it to a value. let declares a block-scoped, local variable, optionally initializing it to a value. const declares a block-scoped, read-only named constant. variables...
...tring by preceding it with a backslash. this is known as escaping the quotation mark. for example: var quote = "he read \"the cremation of sam mcgee\" by r.w. service."; console.log(quote); the result of this would be: he read "the cremation of sam mcgee" by r.w. service. to include a literal backslash inside a string, you must escape the backslash character. for example, to assign the file
path c:\temp to a string, use the following: var home = 'c:\\temp'; you can also escape line breaks by preceding them with backslash. the backslash and line break are both removed from the value of the string. var str = 'this string \ is broken \ across multiple \ lines.' console.log(str); // this string is broken across multiple lines. although javascript does not have "heredoc" syntax, you c...
Error.prototype.fileName - JavaScript
if called from a debugger context, the firefox developer tools for example, "debugger eval code" is returned. ...
...if called from a debugger context, the firefox developer tools for example, "debugger eval code" is returned. ...
import - JavaScript
), which does not require scripts of type="module". backward compatibility can be ensured using attribute nomodule on the <script> tag. syntax import defaultexport from "module-name"; import * as name from "module-name"; import { export1 } from "module-name"; import { export1 as alias1 } from "module-name"; import { export1 , export2 } from "module-name"; import { foo , bar } from "module-name/
path/to/specific/un-exported/file"; import { export1 , export2 as alias2 , [...] } from "module-name"; import defaultexport, { export1 [ , [...] ] } from "module-name"; import defaultexport, * as name from "module-name"; import "module-name"; var promise = import("module-name"); defaultexport name that will refer to the default export from the module. module-name the module to import from. this...
...mport { export1 , export2 as alias2 , [...] } from "module-name"; import defaultexport, { export1 [ , [...] ] } from "module-name"; import defaultexport, * as name from "module-name"; import "module-name"; var promise = import("module-name"); defaultexport name that will refer to the default export from the module. module-name the module to import from. this is often a relative or absolute
path name to the .js file containing the module. certain bundlers may permit or require the use of the extension; check your environment. only single quoted and double quoted strings are allowed. name name of the module object that will be used as a kind of namespace when referring to the imports. exportn name of the exports to be imported. aliasn names that will refer to the named imports. de...
Lazy loading - Web Performance
lazy loading can occur on different moments in the application, but it typically happens on some user interactions such as scrolling and navigation. overview as the web has evolved, we have come to see huge increases in the number and size of assets sent to users. ...
...d, we have come to see huge increases in the number and size of assets sent to users. between 2011 and 2019, the median resource weight increased from ~100kb to ~400kb for desktop and ~50kb to ~350kb for mobile. while image size has increased from ~250kb to ~900kb on desktop and ~100kb to ~850kb on mobile. one of the methods we can use to tackle this problem is to shorten the critical rendering
path length by lazy loading resources that are not critical for the first render to happen. a practical example would be when, you land on the home page of an e-commerce site which has a link to a cart page/section and all its resources (js, css, images...) are downloaded only when the user navigates to that cart page. strategies lazy loading can be applied to multiple resources and through multipl...
Progressive loading - Progressive web apps (PWAs)
thinking about optimizing the image loading using javascript. we'll expain this below. placeholder image instead of having all the screenshots of games referenced in <img> element src attributes, which will force the browser to download them automatically, we can do it selectively via javascript. the js13kpwa app uses a placeholder image instead, which is small and lightweight, while the final
paths to target images are stored in data-src attributes: <img src='data/img/placeholder.png' data-src='data/img/slug.jpg' alt='name'> those images will be loaded via javascript after the site finishes building the html structure. the placeholder image is scaled the same way the original images are, so it will take up the same space and not cause the layout to repaint as the images load. loading v...
...when each image is actually loaded, we remove its data-src attribute as it's not needed anymore. then we loop through each image and load it: imagestoload.foreach((img) => { loadimages(img); }); blur in css to make the whole process more visually appealing, the placeholder is blurred in css. we render the images with a blur at the beginning, so a transition to the sh...
alignment-baseline - SVG: Scalable Vector Graphics
roman text to stay aligned across font size changes. it defaults to the baseline with the same name as the computed value of the alignment-baseline property. note: as a presentation attribute alignment-baseline can be used as a css property. ...
..., before-edge, and after-edge have been removed. for backwards compatibility, text-before-edge may be mapped to text-top and text-after-edge to text-bottom. neither text-before-edge nor text-after-edge should be used with the vertical-align property. ...
class - SVG: Scalable Vector Graphics
troke: #006600; fill: #cc0000; } ]]> </style> <rect class="rectclass" x="10" y="10" width="100" height="100"/> <circle class="circleclass" cx="40" cy="50" r="26"/> </svg> </body> </html> elements the following elements can use the class attribute: <a> <altglyph> <circle> <clip
path> <defs> <desc> <ellipse> <feblend> <fecolormatrix> <fecomponenttransfer> <fecomposite> <feconvolvematrix> <fediffuselighting> <fedisplacementmap> <feflood> <fegaussianblur> <feimage> <femerge> <femorphology> <feoffset> <fespecularlighting> <fetile> <feturbulence> <filter> <font> <foreignobject> <g> <glyph> <glyphref> <image> <line> <lineargradient> <marker> <mask> <...
... <ellipse> <feblend> <fecolormatrix> <fecomponenttransfer> <fecomposite> <feconvolvematrix> <fediffuselighting> <fedisplacementmap> <feflood> <fegaussianblur> <feimage> <femerge> <femorphology> <feoffset> <fespecularlighting> <fetile> <feturbulence> <filter> <font> <foreignobject> <g> <glyph> <glyphref> <image> <line> <lineargradient> <marker> <mask> <missing-glyph> <
path> <pattern> <polygon> <polyline> <radialgradient> <rect> <stop> <svg> <switch> <symbol> <text> <text
path> <title> <tref> <tspan> <use> ...
color-interpolation - SVG: Scalable Vector Graphics
when animating colors, color interpolation is performed according to the value of the color-interpolation property on the element being animated. note: as a presentation attribute, color-interpolation can be used as a css property. ...
...nt being animated. note: as a presentation attribute, color-interpolation can be used as a css property. as a presentation attribute, it can be applied to any element but it only has an effect on the following 29 elements: <a>, <animate>, <animatecolor>, <circle>, <clip
path>, <defs>, <ellipse>, <foreignobject>, <g>, <glyph>, <image>, <line>, <lineargradient>, <marker>, <mask>, <missing-glyph>, <
path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <svg>, <switch>, <symbol>, <text>, <text
path>, <tspan>, and <use> usage notes value auto | srgb | linearrgb default value srgb animatable yes auto indicates that the user agent can choose either the srgb or linearrgb spaces for color interpolation. this option indicates that the author do...
fill-opacity - SVG: Scalable Vector Graphics
the fill-opacity attribute is a presentation attribute defining the opacity of the paint server (color, gradient, pattern, etc) applied to a shape. note: as a presentation attribute fill-opacity can be used as a css property. ...
...presentation attribute defining the opacity of the paint server (color, gradient, pattern, etc) applied to a shape. note: as a presentation attribute fill-opacity can be used as a css property. ...
marker-mid - SVG: Scalable Vector Graphics
the marker-mid attribute defines the arrowhead or polymarker that will be drawn at all interior vertices of the given shape. the marker is rendered on every vertex other than the first and last vertices of the
path data. note: as a presentation attribute, marker-mid can be used as a css property. ...
... polymarker that will be drawn at all interior vertices of the given shape. the marker is rendered on every vertex other than the first and last vertices of the
path data. note: as a presentation attribute, marker-mid can be used as a css property. ...
mask - SVG: Scalable Vector Graphics
ask="url(#mymask)"/> </svg> since svg2, the mask attribute is defined as a css property and is a shorthand for many other properties: mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-size, and mask-composite. ...
...fined as a css property and is a shorthand for many other properties: mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-size, and mask-composite. as a presentation attribute, it can be applied to any element but it has noticeable effects mostly on the following nineteen elements: <a>, <circle>, <clip
path>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <
path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> usage notes value see the css property mask default value none animatable yes specifications specification status comment css masking module level 1the definition of 'mask' in that specification. candidate recommendation extends its usage to ht...
method - SVG: Scalable Vector Graphics
the method attribute indicates the method by which text should be rendered along the
path of a <text
path> element. only one element is using this attribute: <text
path> text
path for <text
path>, method indicates the method by which text should be rendered along the
path. value align | stretch default value align animatable yes align this value indicates that the characters should be rendered so that they are not stretched or warped. the characters are rotated, scaled and stretched when they are rendered. as a result, for fonts with connected characters (e.g. ...
...stretch default value align animatable yes align this value indicates that the characters should be rendered so that they are not stretched or warped. the characters are rotated, scaled and stretched when they are rendered. as a result, for fonts with connected characters (e.g. cursive fonts), the connections may not align properly when text is rendered along the
path. stretch this value indicates that the character outlines will be converted into
paths, and then stretched and possibly warped. with this approach, connected characters, such as in cursive fonts, will maintain their connections. specifications specification status comment scalable vector graphics (svg) 2the definition of 'method' in that specification. candidat...
opacity - SVG: Scalable Vector Graphics
to which the background behind the element is overlaid. note: as a presentation attribute, opacity can be used as a css property. see the css opacity property for more information. ...
...on attribute, opacity can be used as a css property. see the css opacity property for more information. ...
shape-rendering - SVG: Scalable Vector Graphics
the shape-rendering attribute provides hints to the renderer about what tradeoffs to make when rendering shapes like
paths, circles, or rectangles. note: as a presentation attribute, shape-rendering can be used as a css property. ...
... the shape-rendering attribute provides hints to the renderer about what tradeoffs to make when rendering shapes like
paths, circles, or rectangles. note: as a presentation attribute, shape-rendering can be used as a css property. ...
stroke-dasharray - SVG: Scalable Vector Graphics
the stroke-dasharray attribute is a presentation attribute defining the pattern of dashes and gaps used to paint the outline of the shape; note: as a presentation attribute, stroke-dasharray can be used as a css property. ...
...ntation attribute defining the pattern of dashes and gaps used to paint the outline of the shape; note: as a presentation attribute, stroke-dasharray can be used as a css property. ...
stroke-opacity - SVG: Scalable Vector Graphics
the stroke-opacity attribute is a presentation attribute defining the opacity of the paint server (color, gradient, pattern, etc) applied to the stroke of a shape. note: as a presentation attribute stroke-opacity can be used as a css property. ...
...efining the opacity of the paint server (color, gradient, pattern, etc) applied to the stroke of a shape. note: as a presentation attribute stroke-opacity can be used as a css property. ...
stroke-width - SVG: Scalable Vector Graphics
the stroke-width attribute is a presentation attribute defining the width of the stroke to be applied to the shape. ...
... the stroke-width attribute is a presentation attribute defining the width of the stroke to be applied to the shape. ...
stroke - SVG: Scalable Vector Graphics
the stroke attribute is a presentation attribute defining the color (or any svg paint servers like gradients or patterns) used to paint the outline of the shape; note: as a presentation attribute stroke can be used as a css property. ...
... defining the color (or any svg paint servers like gradients or patterns) used to paint the outline of the shape; note: as a presentation attribute stroke can be used as a css property. ...
transform - SVG: Scalable Vector Graphics
tribute defines a list of transform definitions that are applied to an element and the element's children. html,body,svg { height:100% } <svg viewbox="-40 0 150 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g fill="grey" transform="rotate(-10 50 100) translate(-36 45.5) skewx(40) scale(1 0.5)"> <
path id="heart" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </g> <use xlink:href="#heart" fill="none" stroke="red"/> </svg> note: as of svg2, transform is a presentation attribute, meaning it can be used as a css property. however, be aware that there are some difference in syntax between the css property and the attribute. see the documentation for t...
...ttribute, meaning it can be used as a css property. however, be aware that there are some difference in syntax between the css property and the attribute. see the documentation for the css property transform for the specific syntax to use in that case. as a presentation attribute, transform can be used by any element (in svg 1.1, only these 16 elements were allowed to use it: <a>, <circle>, <clip
path>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <
path>, <polygon>, <polyline>, <rect>, <switch>, <text>, and <use>). also, as a legacy from svg 1.1, <lineargradient> and <radialgradient> support the gradienttransform attribute, and <pattern> supports the patterntransform attribute, both of which act exactly like the transform attribute. value <transform-list> de...
writing-mode - SVG: Scalable Vector Graphics
the writing-mode attribute specifies whether the initial inline-progression-direction for a <text> element shall be left-to-right, right-to-left, or top-to-bottom. the writing-mode attribute applies only to <text> elements; the attribute is ignored for <tspan>, <tref>, <altglyph> and <text
path> sub-elements. ...
...an change within a <text> element due to the unicode bidirectional algorithm and properties direction and unicode-bidi.) note: as a presentation attribute, writing-mode can be used as a css property. see the css writing-mode property for more information. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <text
path>, <tref>, and <tspan> usage notes default value horizontal-tb value horizontal-tb | vertical-rl | vertical-lr animatable yes horizontal-tb this value defines a top-to-bottom block flow direction. both the writing mode and the typographic mode are horizontal. vertical-rl this value defines a right-to-left block flow direction. both the writing mode...
xlink:arcrole - SVG: Scalable Vector Graphics
specifications specification status comment scalable vector graphics (svg) 1.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'xlink:arcrole' in tha...
xlink:title - SVG: Scalable Vector Graphics
that appears when a user lets a mouse pointer hover over a starting resource. note: new content should use a <title> child element rather than a xlink:title attribute. these elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <m
path>, <pattern>, <radialgradient>, <script>, <set>, <text
path>, <tref>, and <use> usage context value <anything> default value none animatable no <anything> this value specifies the title used to describe the meaning of the link or resource. specifications specification status comment scalable vector graphics (svg) 2the de...
... this value specifies the title used to describe the meaning of the link or resource. specifications specification status comment scalable vector graphics (svg) 2the definition of 'seed' in that specification. candidate recommendation deprecated the attribute and made it only apply to <a>, <image>, <lineargradient>, <pattern>, <radialgradient>, <script>, <text
path>, and <use> scalable vector graphics (svg) 1.1 (second edition)the definition of 'seed' in that specification. recommendation initial definition ...
<a> - SVG: Scalable Vector Graphics
value type: <url> ; default value: none; animatable: yes global attributes core attributes most notably: id, lang, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-
path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-active...
... candidate recommendation replaced xlink:href attribute by href scalable ...
<circle> - SVG: Scalable Vector Graphics
x-axis coordinate of the center of the circle. value type: <length>|<percentage> ; default value: 0; animatable: yes cy the y-axis coordinate of the center of the circle. value type: <length>|<percentage> ; default value: 0; animatable: yes r the radius of the circle. a value lower or equal to zero disables rendering of the circle. value type: <length> ; default value: 0; animatable: yes
pathlength the total length for the circle's circumference, in user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2, cx, cy, and r are geometry properties, meaning those attributes can also be used as css properties for that element. global attributes core attributes most notably: id, tabindex styling attributes class, style conditional process...
...eometry properties, meaning those attributes can also be used as css properties for that element. ...
<defs> - SVG: Scalable Vector Graphics
rgradient> </defs> <!-- using my graphical objects --> <use x="5" y="5" xlink:href="#mycircle" fill="url('#mygradient')" /> </svg> attributes global attributes core attributes most notably: id lang styling attributes class, style event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-
path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer element, structural elementpermitted co...
... candidate recommendation no change scalable vector graphics (svg) 1.1...
<ellipse> - SVG: Scalable Vector Graphics
tage> ; default value: 0; animatable: yes cy the y position of the ellipse. value type: <length>|<percentage> ; default value: 0; animatable: yes rx the radius of the ellipse on the x axis. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes ry the radius of the ellipse on the y axis. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes
pathlength this attribute lets specify the total length for the
path, in user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2 cx, cy, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element. global attributes core attributes most notably: id, tabindex styling attributes class, style condit...
...eometry properties, meaning those attributes can also be used as css properties for that element. ...
<g> - SVG: Scalable Vector Graphics
="60" cy="60" r="25" /> </g> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-
path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, a...
... candidate recommendation scalable vector graphics (svg) 1.1 (second ed...
<glyph> - SVG: Scalable Vector Graphics
a <glyph> defines a single glyph in an svg font. usage context categoriestext content elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clip
path>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y unicode glyph-name orientation arabic-form lang dom interface this element implements the svgglyphelement interface. example svg <svg width="400px" height="300px" version="1.1" ...
... <font-face font-family="super sans" font-weight="bold" font-style="normal" units-per-em="1000" cap-height="600" x-height="400" ascent="700" descent="300" alphabetic="0" mathematical="350" ideographic="400" hanging="500"> <font-face-src> <font-face-name name="super sans bold"/> </font-face-src> </font-face> <missing-glyph><
path d="m0,0h200v200h-200z"/></missing-glyph> <glyph unicode="!" horiz-adv-x="80" d="m0,0h200v200h-200z"></glyph> <glyph unicode="@" d="m0,50l100,300l400,100z"></glyph> </font> </defs> <text x="100" y="100" style="font-family: 'super sans', helvetica, sans-serif; font-weight: bold; font-style: normal">text using embe@dded font!</text> </svg> result speci...
<line> - SVG: Scalable Vector Graphics
ordinate of the line ending point. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes y1 defines the y-axis coordinate of the line starting point. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes y2 defines the y-axis coordinate of the line ending point. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes
pathlength defines the total
path length in user units. value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes mos...
...the total
path length in user units. ...
<pattern> - SVG: Scalable Vector Graphics
ly href will be used. y this attribute determines the y coordinate shift of the pattern tile. ...
... candidate recommendation scalable vector graphics (svg) 1.1 (seco...
<polygon> - SVG: Scalable Vector Graphics
n points="0,100 50,25 50,75 100,0" /> <!-- example of the same polygon shape with stroke and no fill --> <polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon. value type: <number>+ ; default value: ""; animatable: yes
pathlength this attribute lets specify the total length for the
path, in user units. value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes ...
... length for the
path, in user units. ...
<rect> - SVG: Scalable Vector Graphics
value type: auto|<length>|<percentage> ; default value: auto; animatable: yes rx the horizontal corner radius of the rect. defaults to ry if it is specified. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes ry the vertical corner radius of the rect. defaults to rx if it is specified. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes
pathlength the total length of the rectangle's perimeter, in user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2, x, y, width, height, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element. global attributes core attributes most notably: id, tabindex styling attributes class, style cond...
...eometry properties, meaning those attributes can also be used as css properties for that element. ...
<text> - SVG: Scalable Vector Graphics
if text is included in svg not inside of a <text> element, it is not rendered. this is different than being hidden by default, as setting the display property won't show the text. ...
...es global attributes core attributes most notably: id, tabindex styling attributes class, style, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-
path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, a...
<xsl:apply-templates> - XSLT: Extensible Stylesheet Language Transformations
an asterisk(*) selects the entire node-set. if this attribute is not set, all child nodes of the current node are selected. mode if there are multiple ways of processing defined for the same node, distinguishes among them. type instruction, appears within a template. ...
...an asterisk(*) selects the entire node-set. if this attribute is not set, all child nodes of the current node are selected. mode if there are multiple ways of processing defined for the same node, distinguishes among them. type instruction, appears within a template. defined xslt section 5.4. ...
<xsl:for-each> - XSLT: Extensible Stylesheet Language Transformations
optional attributes none. type instruction, appears within a template. defined xslt, section 8. gecko support supported. ...
...h of them in the same way. it is often used to iterate through a set of nodes or to change the current node. if one or more <xsl:sort> elements appear as the children of this element, sorting occurs before processing. otherwise, nodes are processed in document order. syntax <xsl:for-each select=expression> <xsl:sort> [optional] template </xsl:for-each> required attributes select uses an x
path expression to select nodes to be processed. optional attributes none. type instruction, appears within a template. defined xslt, section 8. gecko support supported. ...
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
if the value is true, the template is processed; if it is not, no action is taken. optional attributes none. ...
...a test attribute and a template. if the test evaluates to true, the template is processed. in this it is similar to an if statement in other languages. to achieve the functionality of an if-then-else statement, however, use the <xsl:choose> element with one <xsl:when> and one <xsl:otherwise> children. syntax <xsl:if test=expression> template </xsl:if> required attributes test contains an x
path expression that can be evaluated (using the rules defined for boolean( ) if necessary) to a boolean value. if the value is true, the template is processed; if it is not, no action is taken. optional attributes none. type instruction, appears within a template. defined xsl section 9.1. gecko support supported ...
<xsl:key> - XSLT: Extensible Stylesheet Language Transformations
optional attributes none. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 12.2. gecko support supported. ...
... optional attributes none. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 12.2. gecko support supported. ...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
level defines how levels of the source tree should be considered in generating sequential numbers. it has three valid values: single, multiple, and any. ...
...a number. syntax <xsl:number count=expression level="single" | "multiple" | "any" from=expression value=expression format=format-string lang=xml:lang-code letter-value="alphabetic" | "traditional" grouping-separator=character grouping-size=number /> required attributes none. optional attributes count specifies what in the source tree should be numbered sequentially. it uses an x
path expression. level defines how levels of the source tree should be considered in generating sequential numbers. it has three valid values: single, multiple, and any. the default value is single: single numbers sibling nodes sequentially, as in the items in a list. the processor goes to the first node in the ancestor-or-self axis that matches the count attribute and then counts that...
<xsl:param> - XSLT: Extensible Stylesheet Language Transformations
type instruction, can appear as a top-level element or within a template. defined xslt, section 11. ...
...r. when used as a top-level element, the parameter is global . when used inside an <xsl:template> element, the parameter is local to that template. in this case it must be the first child element of the template. syntax <xsl:param name=name select=expression> template </xsl:param> required attributes name names the parameter. this must be a qname. optional attributes select uses an x
path expression to provide a default value if none is specified. type instruction, can appear as a top-level element or within a template. defined xslt, section 11. gecko support supported. ...
<xsl:sort> - XSLT: Extensible Stylesheet Language Transformations
order specifies whether the nodes should be processed in "ascending" or "descending" order. the default is "ascending". case-order indicates whether upper- or lowercase letters are to be ordered first. ...
...xes the <xsl:sort> element defines a sort key for nodes selected by <xsl:apply-templates> or <xsl:for-each> and determines the order in which they are processed. syntax <xsl:sort select=expression order="ascending" | "descending" case-order="upper-first" | "lower-first" lang=xml:lang-code data-type="text" | "number" /> required attributes none. optional attributes select uses an x
path expression to specify the nodes to be sorted. order specifies whether the nodes should be processed in "ascending" or "descending" order. the default is "ascending". case-order indicates whether upper- or lowercase letters are to be ordered first. the allowable values are "upper-first" and "lower-first". lang specifies which language is to be used by the sort. data-type define...
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
optional attributes disable-output-escaping (netscape does not serialize the result of transformation - the "output" below - so this attribute is essentially irrelevant in context. to output html-entities, use numerical values instead, eg   for  ) specifies whether special characters are escaped when written to the output. ...
... optional attributes disable-output-escaping (netscape does not serialize the result of transformation - the "output" below - so this attribute is essentially irrelevant in context. to output html-entities, use numerical values instead, eg   for  ) specifies whether special characters are escaped when written to the output. ...
<xsl:variable> - XSLT: Extensible Stylesheet Language Transformations
if the element contains a template, this attribute is ignored. type top-level or instruction. ...
... a stylesheet and gives it a value. because xslt permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of scope syntax <xsl:variable name=name select=expression > template </xsl:variable> required attributes name gives the variable a name. optional attributes select defines the value of the variable through an x
path expression. if the element contains a template, this attribute is ignored. type top-level or instruction. if it occurs as a top-level element, the variable is global in scope, and can be accessed throughout the document. if it occurs within a template, the variable is local in scope, accessible only within the template in which it appears. defined xslt, section 11. gecko support supported.
<xsl:with-param> - XSLT: Extensible Stylesheet Language Transformations
if the element contains a template, this attribute is ignored. type subinstruction, always appears within an <xsl:apply-templates> or an <xsl:call-template> element. defined xslt 11.6 gecko support supported. ...
...if the element contains a template, this attribute is ignored. type subinstruction, always appears within an <xsl:apply-templates> or an <xsl:call-template> element. defined xslt 11.6 gecko support supported. ...
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
a top-level element must appear as the child of either <xsl:stylesheet> or <xsl:transform>. an instruction, on the other hand, is associated with a template. a stylesheet may include several templates. a third type of element, not discussed here, is the literal result element (lre). an lre also appears in a template. it consists of any non-instruction element that should be copied as-is to the result document, for example, an <hr> element in an html conversion stylesheet. ...
...te. it consists of any non-instruction element that should be copied as-is to the result document, for example, an <hr> element in an html conversion stylesheet. on a related note, any attribute in an lre and some attributes of a limited number of xslt elements can also include what is known as an attribute value template. an attribute value template is simply a string that includes an embedded x
path expression which is used to specify the value of an attribute. at run-time the expression is evaluated and the result of the evaluation is substituted for the x
path expression. for example, assume that a variable "image-dir" is defined as follows: <xsl:variable name="image-dir">/images</xsl:variable> the expression to be evaluated is placed inside curly brackets: <img src="{$image-dir}/mygraph...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
ame. no syntax checking is done on the attribute, however if it is not a valid ncname it will never match any parameter in the stylesheet. namespace the namespace of the parameter name. no syntax checking is done on the attribute. value contains the string value for the parameter. the value of the attribute is used as value for the parameter. the datatype will always bestring. select an x
path expression for the parameter. the value of the attribute is parsed as an x
path expression. the result of evaluating the expression is used as value for the parameter. if the name attribute is missing or empty the pi is ignored. if the namespace attribute is missing or empty the null namespace is used. it is not an error to specify a parameter name that does not exist in the stylesheet (or tha...
...tribute. the context node is the node used as initial current node used when executing the stylesheet. the context position is the position of the context node in the initial current node list used when executing the stylesheet. the context size is the size of the initial current node list used when executing the stylesheet. no variables are available. the function library is the standard x
path function library. the namespace declarations are determined by the xslt-param-namespace pis, see below. if the select attribute fails to parse or execute, the pi is ignored (in particular, it does not fall back to the value attribute). xslt-param-namespace the xslt-param-namespace uses two attributes: prefix the prefix that is mapped. namespace the namespace the prefix maps to. an ...
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
articles hands-on xsl author: don r. day location: http://www-106.ibm.com/developerwork...-hands-on-xsl/ understanding xslt author: jay greenspan location: http://hotwired...
... articles hands-on xsl author: don r. day location: http://www-106.ibm.com/developerwork...-hands-on-xsl/ understanding xslt author: jay greenspan location: http://hotwired.lycos.com/webmonkey/...l?tw...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
the structure of an xml document is designed to reflect and clarify important relationships among the individual aspects of the content itself, unhindered by a need to provide any indication about how this data should eventually be presented. this intelligent structuring is particularly important as more and more data transfers are automated and take place between highly heterogeneous machines linked by a network. yet eventually much of the content stored in xml documents will need to be presented to human readers. ...
...ransform and the name is apt. xslt allows a stylesheet author to transform a primary xml document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format (and in the case of firefox, the focus is on converting it on the fly into html which can then be displayed by the browser). ...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
bly. it is enabled by default in firefox 52+ and chrome 57+/latest opera (you can also run wasm code in firefox 47+ by enabling the javascript.options.wasm flag in about:config, or chrome (51+) and opera (38+) by going to chrome://flags and enabling the experimental webassembly flag.) note: if you try to open generated html file (hello.html) directly from your local hard drive (e.g. file://your_
path/hello.html), you will end up with an error message along the lines of both async and sync fetching of the wasm failed. you need to run your html file through an http server (http://) — see how do you set up a local testing server? for more information. if everything has worked as planned, you should see "hello world" output in the emscripten console appearing on the web page, and your browser...
...w), and run the following command: emcc -o hello2.html hello2.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html the options we've passed are slightly different this time: we've specified -o hello2.html, meaning that the compiler will still output the javascript glue code and .html. we've also specified --shell-file html_template/shell_minimal.html — this provides the
path to the html template you want to use to create the html you will run your example through. now let's run this example. the above command will have generated hello2.html, which will have much the same content as the template with some glue code added into load the generated wasm, run it, etc. open it in your browser and you'll see much the same output as the last example. note: you c...
Loading and running WebAssembly code - WebAssembly
sembly in javascript, you first need to pull your module into memory before compilation/instantiation. this article provides a reference for the different mechanisms that can be used to fetch webassembly bytecode, as well as how to compile/instantiate then run it. what are the options? webassembly is not yet integrated with <script type='module'> or es2015 import statements, thus there is not a
path to have the browser fetch modules for you using imports. the older webassembly.compile/webassembly.instantiate methods require you to create an arraybuffer containing your webassembly module binary after fetching the raw bytes, and then compile/instantiate it. this is analogous to new function(string), except that we are substituting a string of characters (javascript source code) with an array ...
...ead of using the webassembly javascript api, and understanding webassembly text format. using xmlhttprequest xmlhttprequest is somewhat older than fetch, but can still be happily used to get a typed array. again, assuming our module is called simple.wasm: create a new xmlhttprequest() instance, and use its open() method to open a request, setting the request method to get, and declaring the
path to the file we want to fetch. the key part of this is to set the response type to 'arraybuffer' using the responsetype property. next, send the request using xmlhttprequest.send(). we then use the onload event handler to invoke a function when the response has finished downloading — in this function we get the array buffer from the response property, and then feed that into our webassembly.i...
Testing the Add-on SDK - Archive of obsolete content
moment. from mozilla-central repository with a checkout of the mozilla-central source code, one can always cd addon-sdk/source and use any of the methods described above, but in addtion to that there are a couple of mach commands available, and ofcourse there is the try server if you have access to that. with mach there are two commands: ./mach mochitest -f jetpack-addon <optional_addon_
path>: this runs the test add-ons mentioned for cfx testaddons and gulp test:addons with the older sdk/loader/cuddlefish used with cfx. ./mach mochitest -f jetpack-package <optional_file_
path>: this runs the module unit tests mentioned for cfx testpkgs and gulp test:modules but in this case with the newer toolkit/loader used with jpm. with try server ...
XUL Migration Guide - Archive of obsolete content
e: uri, with a skin and locale, and this means you can include xul windows in an sdk-based add-on. you can keep the "chrome.manifest" file in your add-on's root directory and create a directory there called "chrome". in that directory you can keep your "content", "locale", and "skin" subdirectories: this allows you to refer to objects in these directories from "chrome.manifest" using a relative
path, like "chrome/content". this is provided only as a migration aid, and it's still a good idea to port xul windows to html. content scripts in a xul-based add-on, code that uses xpcom objects, code that manipulates the browser chrome, and code that interacts with web pages all runs in the same context. but the sdk makes a distinction between: add-on scripts, which can use the sdk apis, but...
indexed-db - Archive of obsolete content
error = function(e) { console.error(e.value) } function open(version) { var request = indexeddb.open("stuff", version); request.onupgradeneeded = function(e) { var db = e.target.result; e.target.transaction.onerror = database.onerror; if(db.objectstorenames.contains("items")) { db.deleteobjectstore("items"); } var store = db.createobjectstore("items", {key
path: "time"}); }; request.onsuccess = function(e) { database.db = e.target.result; }; request.onerror = database.onerror; }; function additem(name) { var db = database.db; var trans = db.transaction(["items"], "readwrite"); var store = trans.objectstore("items"); var time = new date().gettime(); var request = store.put({ "name": name, "time": time }); request.one...
page-mod - Archive of obsolete content
] }); content styles specified by this option are loaded after those specified by the contentstylefile option. name: attachto type: string,array if this option is not specified, content scripts: are not attached to any tabs that are already open when the page-mod is created. are attached to all documents whose url matches the rule: so if your rule matches a specific hostname and
path, and the topmost document that satisfies the rule includes ten iframes using a relative url, then your page-mod is applied eleven times. you can modify this behavior using the attachto option. it accepts the following values: "existing": the page-mod will be automatically applied on already opened tabs. "top": the page-mod will be applied to top-level tab documents "frame": the page-mod w...
simple-prefs - Archive of obsolete content
": "string", "name": "monstername", "value": "kraken", "title": "monster name" } color displayed as a colorpicker and stores a string in the #123456 format. { "type": "color", "name": "highlightcolor", "value": "#6a5acd", "title": "highlight color" } file displayed as a "browse" button that opens a file picker and stores the full
path and name of the file selected. { "type": "file", "name": "myfile", "title": "select a file" } directory displayed as a "browse" button that opens a directory picker and stores the full
path and name of the directory selected. { "type": "directory", "name": "mydirectory", "title": "select a directory" } menulist displayed...
simple-storage - Archive of obsolete content
oo = "i will not be saved! :("; simple storage and "jpm run" the simple storage module stores its data in your profile. because jpm run by default uses a fresh profile each time it runs, simple storage won't work with add-ons executed using jpm run - that is, stored data will not persist from one run to the next. the easiest solution to this problem is to use the --profile option to jpm with a
path to a profile - not just a profile name. you may also need to include the --no-copy option to prevent firefox from copying the profile to a temporarry directory each time it starts. jpm run --no-copy --profile
path/to/profile/dir if you specify a non-existent profile, the same will be created, don't worry. important: if you use this method, you must end your debugging session by quitting firef...
loader/sandbox - Archive of obsolete content
m/bar.js' and // start from 2nd line. evaluate(scope, 'a ++', 'http://foo.com/bar.js', 2); version of javascript can be also specified via an optional argument: evaluate(scope, 'let b = 2;', 'bar.js', 1, '1.5'); // throws cause `let` is not defined in js 1.5. load scripts this module provides a limited api for loading scripts from local urls. data: urls are supported. load(scope, 'resource://
path/to/my/script.js'); load(scope, 'file:///
path/to/script.js'); load(scope, 'data:,var a = 5;'); globals functions sandbox(source) make a new sandbox that inherits principals from source. parameters source : string|window|null an object that determines the privileges that will be given to the sandbox. this argument can be: a uri string, giving the sandbox the same privileges as a script lo...
platform/xpcom - Archive of obsolete content
nothing. by default, factories and services are unregistered automatically when the add-on that registered them is unloaded. parameters factory : object the factory or service to unregister. isregistered(factory) find out whether a factory or service is registered. parameters factory : object returns boolean : true if the factory or service is registered, false otherwise. autoregister(
path) register a component (.manifest) file or all component files in a directory. see nsicomponentregistrar.autoregister() for details. parameters
path : string
path to a component file to be registered or a directory containing component files to be registered. factorybyid(id) given a class id, this function returns the associated factory or service. if the factory or service isn't registered,...
system/child_process - Archive of obsolete content
documented separately here. however, there are a few differences to be aware of: you need to require() the module using require("sdk/system/child_process") fork() is not supported gid and uid are not supported in node.js, spawn() and exec() inherit the environment variables from the parent process, by default. the sdk versions don't: so when you specify a command you must pass in a complete
path to the command or use the env option to set up the child process environment. child.stdin has no write() method (see example below for writing to child process stdin) examples adaption of node's documentation for spawn(): var child_process = require("sdk/system/child_process"); var ls = child_process.spawn('/bin/ls', ['-lh', '/usr']); ls.stdout.on('data', function (data) { console.log('s...
test/httpd - Archive of obsolete content
this module was removed in firefox 36, please use the addon-httpd npm module instead. an http server for the mozilla platform, which can be used in unit tests. usage the most basic usage is: var { startserverasync } = require("sdk/test/httpd"); var srv = startserverasync(port, base
path); require("sdk/system/unload").when(function cleanup() { srv.stop(function() { // you should continue execution from this point. }) }); this starts a server in background (assuming you're running this code in an application that has an event loop, such as firefox). the server listens at http://localhost:port/ and serves files from the specified directory. you can serve static content or use sjs scripts, as described in documentation on developer.mozilla.org. you can also use nshttpserver to start th...
ui/sidebar - Archive of obsolete content
rom firefox 34, you can use "./sidebar.html" as an alias for self.data.url("sidebar.html"). so you can rewrite the above code like this: var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: "./sidebar.html" }); you can include javascript and css from the html as you would with any web page, for example using <script> and <link> tags containing a
path relative to the html file itself. <!doctype html> <html> <head> <link href="stuff.css" type="text/css" rel="stylesheet"> </head> <body> <script type="text/javascript" src="stuff.js"></script> </body> </html> you can update the sidebar's content by setting the sidebar's url property. this will change the sidebar's content across all windows. communicating with sidebar scripts ...
Low-Level APIs - Archive of obsolete content
d the firefox developer tools. event/core the event/core module allows the creation of apis to broadcast and subscribe to events. event/target create objects that broadcast events. frame/hidden-frame creates firefox frames (i.e. xul <iframe> elements) that are not displayed to the user. frame/utils provides helper functions for working with platform internals like frames and browsers. fs/
path provides access to the local filesystem with the nodejs
path module api. io/byte-streams provides streams for reading and writing bytes. io/file provides access to the local filesystem. io/text-streams provides streams for reading and writing text. lang/functional functional helper methods. lang/type functions for working with type detection. loader/cuddlefish the sdk's module loader...
Unit Testing - Archive of obsolete content
this file: exports three functions, each of which expects to receive a single argument which is an assert object. assert is supplied by the test/assert module and implements the commonjs unit testing specification. the first two functions call atob() and btoa() and use assert.ok() to check that the output is as expected. the second function tests the module'...
Bootstrapped extensions - Archive of obsolete content
on about the add-on being bootstrapped. more information about the add-on can be obtained by calling addonmanager.getaddonbyid(). the data is a simple javascript object with the following properties: property type description id string the id of the add-on being bootstrapped. version string the version of the add-on being bootstrapped. install
path nsifile the installation location of the add-on being bootstrapped. this may be a directory or an xpi file depending on whether the add-on is installed unpacked or not. resourceuri nsiuri a uri pointing at the root of the add-ons files, this may be a jar: or file: uri depending on whether the add-on is installed unpacked or not. oldversion string the previously...
Cookies - Archive of obsolete content
ements()) { var cookie = enum.getnext().queryinterface(ci.nsicookie2); dump(cookie.host + ";" + cookie.name + "=" + cookie.value + "\n"); } all cookies, regardless of host, can be enumerated using services.cookies.enumerator rather than getcookiesfromhost(). setting a cookie the following code demonstrates how to set a cookie in firefox. services.cookies.add(".host.example.com", "/cookie-
path", "cookie_name", "cookie_value", is_secure, is_http_only, is_session, expiry_date); see also document.cookie nsicookie nsicookie2 nsicookieservice nsicookiemanager nsicookiemanager2 http cookies ...
Downloading Files - Archive of obsolete content
the following methods of downloading files may not work as expected after firefox 26, and should no longer be used. please use downloads.jsm instead. downloading files to download a file, create an instance of nsiwebbrowserpersist and call its nsiwebbrowserpersist.saveuri() method, passing it a url to download and an nsifile instance representing the local file name/
path. components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = services.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); // obtain the...
Examples and demos from articles - Archive of obsolete content
to keep track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the informations needed by each animation to start, stop, etc. etc. in different objects and then to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. convert relative
paths to absolute this example show how to translate relative
paths to absolute
paths. a shortcut to massively modify the dom this example shows how to create a framework able to modify many properties of dom objects at the same time. filter the digitation into a form field, capture the digitation of a hidden word this example shows the use of the onkeypress event during a digitation into a form ...
HTML to DOM - Archive of obsolete content
listener we define for the element. let's take a look at the donkeyfire.donkeybrowser_onpageload() handler: donkeybrowser_onpageload: function(aevent) { var doc = aevent.originaltarget; var url = doc.location.href; if (aevent.originaltarget.nodename == "#document") { // ok, it's a real page, let's do our magic dump("[df] url = "+url+"\n"); var text = doc.evaluate("/html/body/h1",doc,null,x
pathresult.string_type,null).stringvalue; dump("[df] text in /html/body/h1 = "+text+"\n"); } }, as you can see, we obtain full access to the dom of the page we loaded in background, and we can even evaluate x
path expressions. in the example, we dump() to the console the page's url and the text contained in the first h1 tag of the page's <body>. but, we still need to see how to execute the famous...
Preferences - Archive of obsolete content
nsisupportsstring used to handle unicode strings in preferences. use this when the preference value may contain non-ascii characters (for example, a user's name). nsipreflocalizedstring almost the same as nsisupportsstring, but it is handled differently in getcomplexvalue() when there's no user value for the given preference; see below for details. nsilocalfile and nsirelativefilepref store
paths in preferences. nsilocalfile is used to store absolute
paths, while nsirelativefilepref is used to store
paths relative to a "special" directory, such as the profile folder. nsisupportsstring as noted above, this is used to handle unicode strings in preferences. example: // prefs is an nsiprefbranch // example 1: getting unicode value var value = prefs.getcomplexvalue("preference.with.non.a...
Running applications - Archive of obsolete content
all your target platforms support this method! this method has the same effect as if you double-clicked the file, so for executable files—it will just run the file without any parameters. for more information on nsifile/nsilocalfile, see file i/o. var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); file.initwith
path("c:\\myapp.exe"); file.launch(); references nsiprocess nsilocalfile if you need to launch an executable bundled in your xpi, see code snippets:file i/o#getting your extension's folder. launching an executable process from a web page ...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
t code, updateenabled will return false because your site isn't whitelisted, and since it was updateenabled that discovered this, not a call to install, there will be no notification to the user. thus you should only use updateenabled to display content in the page to alert the user that software installation is disabled, or your site is not in the whitelist—do not place it in the install code
path. (* by all means don't let this stop you from developing more ambitious install systems, i am providing this documentation only as a guide that i hope most extension distributors will use since it handles most cases well) ...
Migrating raw components to add-ons - Archive of obsolete content
strictly so that they can make use of third party dlls. if this is the only reason you are using a binary component instead of javascript, take a look at the new javascript c-types support introduced in firefox 3.6. it allows javascript code to load functions from dlls on windows, and should allow you to eliminate your dependence on binary components entirely. this leads to a better compatibility
path as new versions of firefox are released. ...
Chapter 1: Introduction to Extensions - Archive of obsolete content
d some actual examples of extensions. single feature extensions fixme: update this. these are relatively simple extensions that add a single feature. text link makes it so that double-clicking on an unlinked url follows that url. undo closed tabs button adds a toolbar button to re-open the most recently closed tabs to the history menu. locationbar separates a url’s domain and
path in the location bar for easier reading. feature enhancing extensions fixme: update this. these extensions enhance features that already exist in firefox. tab mix plus offers detailed tab-related settings. prefbar gives access to numerous preferences from the toolbar. noscript enables and disables javascript execution on a site-by-site basis. web application integration extensio...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
e fourth element. external entities being a form of xml, xul can also use entity references based on dtds (document type definitions) as shown in listing 26. note that external dtd files are limited to what is given in the chrome url, which will be discussed in chapter 5. please be aware that ordinary dtd files on the web or in a local directory will not be opened. note: you may use a relative
path to access a chrome url from an xul document. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://global/skin/"?> <!doctype window system "chrome://testapp/locale/testapp.dtd"> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button label="&button.1.label;"/> <button label="&button.2.label;"/> </window> listing 26: reading in external entitie...
Appendix D: Loading Scripts - Archive of obsolete content
les the following code will import a module into the current global scope. all variables named in the target script's exported_symbols global array will be copied into the current execution context. components.utils.import("resource://my-package/my-module.jsm"); the following function will import an arbitrary module into a singleton object, which it returns. if the argument is not an absolute
path, the module is imported relative to the caller's filename. function module(uri) { if (!/^[a-z-]+:/.exec(uri)) uri = /([^ ]+\/)[^\/]+$/.exec(components.stack.caller.filename)[1] + uri + ".jsm"; let obj = {}; components.utils.import(uri, obj); return obj; } given the above code, the following code will import the module "my-module.jsm" from the current directory and defi...
JavaScript Object Management - Archive of obsolete content
d they're the best tool for keeping everything in sync between windows. they're very simple to set up. the first thing you need to do is add an entry in the chrome.manifest file: resource xulschoolhello modules/ javascript code modules are accessed with the resource protocol, which is very similar to the chrome protocol. just like with the chrome, we define the package name and then a
path. to keep things simple, just locate the jsm files in a modules directory under the root of our project. in order to access a file messagecount.js in this directory, the url would be: resource://xulschoolhello/messagecount.js code modules are regular js files, so there's nothing new in regards to naming or file types. mozilla has adopted a standard of using the extension .jsm for these file...
Local Storage - Archive of obsolete content
ns, or making other changes to your db structure from one version of your extension to the next will probably cause breakage of user data in older versions. you'll need to carefully add migration code that moves the data from the old db format to the new, and this becomes increasingly complex as you add new versions and new structure changes. so, be careful and plan for the future. there are two
paths you can take when creating the local database you'll be using for your extension: generate the database file (through mozistorageservice.opendatabase(), all tables (through mozistorageconnection.createtable(), and initial data when your extension starts up for the first time. if you need a complex database this can be heavy in terms of time and code, but this will only happen once and this ca...
Mozilla Documentation Roadmap - Archive of obsolete content
navigate through the huge code base with some ease. luckily, mozilla provides exactly that in the mozilla cross-reference. the main index in this page gives you options to look into the different product branches in development at mozilla. make sure you pick the one that matches your target versions. all of these provide advanced search capabilities, including regular expression search and file
path search. you'll be able to navigate the full source tree, inspect the change history for all files, and link to specific code lines. it takes a little getting used to, specially learning how to choose the best search queries, but it's an invaluable resource of information. mozilla blogs several mozilla community members maintain blogs that are updated frequently, often including information on a...
Signing an extension - Archive of obsolete content
gn: nss-certutil -m -n "verisign class 3 public primary certification authority" -t "c,c,c" -d . nss-certutil -m -n "verisign class 3 public primary certification authority - g5 - verisign, inc." -t "c,c,c" -d . nss-certutil -m -n "verisign class 3 code signing 2010 ca - verisign, inc." -t "c,c,c" -d . it's all done. sign the basic usage of the signing tool is as follows: nss-signtool \ -d (
path to the directory that contains your certificate database files) \ -k (your certificate nickname) \ -p (your certificate password) \ -x -z (output
path/name of signed file) \ (
path to your extension working directory that contains chrome directory, chrome.manifest file, install.rdf file, etc.) writing your password directly in the script is dangerous. for production, use such a code: ech...
CSS3 - Archive of obsolete content
ty, and transition-timing-function properties. css box alignment module level 3 working draft selectors level 4 working draft css lists module level 3 working draft extends the list counter mechanism so that list markers can be styled and web developers can define new list counter schemes. ...
Creating a status bar extension - Archive of obsolete content
toolbars, status bars, menu bars, and the like. the chrome manifest file, chrome.manifest, for the sample follows. content status-bar-sample-1 chrome/content/ # firefox overlay chrome://browser/content/browser.xul chrome://status-bar-sample-1/content/status-bar-sample-1.xul the first line registers the location on disk of the contents of the extension whose id is "status-bar-sample-1". this
path is relative to the extension's root folder in this case, but can be absolute if you want it to be. the second line registers an overlay. an overlay lets you add new content to an existing document. in this case, we want to augment the ui of the firefox browser, so we specify the uri of the firefox main window's xul file, "chrome://browser/content/browser.xul", as the interface to overlay onto, an...
JXON - Archive of obsolete content
it could be useful to read the xml introduction article first. if you want a complete bidirectional jxon library (modelled on the json global object), skip to the dedicated paragraph (but please read the note about the const statement compatibility). note: if you are interested to address only some parts of an xml document (and are not starting in javascript/json for templating purposes), use x
path instead of converting the whole document into json. conversion snippets now imagine you have this sample xml document: example.xml <?xml version="1.0"?> <!doctype catalog system "catalog.dtd"> <catalog> <product description="cardigan sweater"> <catalog_item gender="men's"> <item_number>qwz5671</item_number> <price>39.95</price> <size description="medium"> <color_swa...
MMgc - Archive of obsolete content
l over how much time is spent marking without threads when smp systems become more prevalent it may be worth investigating this approach because true parallelism may afford better performance. another point to consider is whether marking should always be on or should be turned on and off at some point based on memory allocation patterns. i think we want the later because: all wb's take the fast
path when we're not marking, so the more time we spend out of the marking phase the better performance will be overall applications that have low or steady state memory requirements shouldn't suffer any marking penalty the first thing to determine is when we decide to start marking. currently we make the decision on when to do a collection based on how much memory has been allocated since the last co...
Using content preferences - Archive of obsolete content
related about:config preferences: browser.zoom.full boolean, set by the menu item view / zoom / zoom text only. despite the confusion in names, this preference is not site-specific. browser.zoom.sitespecific toolkit.zoommanager.zoomvalues zoom.maxpercent and zoom.minpercent browser.download.lastdir
path of a filesystem directory related about:config preferences: browser.download.lastdir the last directory for any site use downloadlastdir.jsm for access to these preferences. browser.upload.lastdir
path of a filesystem directory this preference is stored and retrieved automatically by file upload controls. spellcheck.lang la...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
ft used to support the np api, look for a file called plugin.ocx in your windows system directory. this 100k activex control contains the entire np api implementation and probably worked much like pluginhostctrl.dll does now. the sections below tell you how to fetch, build and use the pluginhostctrl.dll . get the source you need cvs to get the source code. assuming you have cvs somewhere in your
path, type this from a command prompt: c:\> set cvsroot=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot c:\> set home=\temp c:\> cvs login (logging in to anonymous@cvs-mirror.mozilla.org) cvs password: anonymous c:\> cvs -z3 co mozilla/embedding/browser/activex/src/pluginhostctrl this fetches the source for the control into mozilla\embedding\browser\activex\src\pluginhostctrl. you can also see th...
Structure of an installable bundle - Archive of obsolete content
xulrunner applications, extensions, and themes all share a common directory structure, and in some cases the same bundle can be used as a standalone xulrunner application as well as an installable application extension. basic structure of a bundle a bundle may include any of the following files:
path from the root of the bundle description version information /install.rdf extension/theme install manifest /application.ini application launch manifest /bootstrap.js the bootstrap script for extensions not requiring a restart (those with <em:bootstrap>true</em:bootstrap> in their install.rdf). note that other files and directories (e.g. chrome.manifest, components, defaults) in bootstrapped extensions are not processed by a...
Creating a Firefox sidebar extension - Archive of obsolete content
rlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxoverlay.xul test while you're developing your sidebar, you will need to test it frequently from firefox. there is a simple way to do this. first, we need to tell firefox about your extension. open your profile folder open the extensions folder (create it if it doesn't exist) create a new text file, and put the
path to your extension folder inside, e.g. c:\extensions\myextension or ~/extensions/myextension. save the file with the id of your extension as its name, e.g. emptysidebar@yourdomain.com now you're ready to test your extension! restart firefox and the sidebar is included in the menu. you can now go back and make changes to the xul file, close and restart firefox and they should appear. deployme...
Finding the file to modify - Archive of obsolete content
, then select the mozilla browser window item (named after the page currently loaded in the browser). the dom inspector will display the url of the xul file that defines the mozilla browser window, which is chrome://navigator/content/navigator.xul. a chrome url is a url used internally by mozilla to refer to files in the chrome subdirectory of the mozilla installation directory. chrome urls have
paths that do not necessarily refer to a precise directory hierarchy. in this case the chrome url refers to the file located at mozilla-installation-directory/chrome/content/navigator/navigator.xul. [explain further, http://www.mozilla.org/xpfe/configchromespec.html] « previousnext » ...
Getting Started - Archive of obsolete content
ion chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:messenger"/> <rdf:description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:navigator"/> save the file and exit the text editor. the jar file in the \myskin directory, you should now have the 5 sub-directories along with the contents.rdf and preview.png files. select them all and zip them up, making sure to include the
paths (do not include the \myskin directory inside of the zip, just the files inside of \myskin). once the zip is created, rename it to myskin.jar contents of myskin.jar contents.rdf preview.png \navigator\... \messenger\... \global\... \editor\... \communicator\... triggering the install from the web to install your jar fil...
Creating regular expressions for a microsummary generator - Archive of obsolete content
d understand how to create expressions that match urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. to learn how to create a microsummary generator, see creating a microsummary. urls 101 urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file
path, and some query parameters. here's a url for an auction item page on ebay: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=280018439106 in this url, the domain name is "cgi.ebay.com", the file
path is "/ws/ebayisapi.dll", and the query parameters are "?viewitem&item=280018439106". matching an ebay url to match this url with a regular expression, we need to put characters into the regular...
Download Manager preferences - Archive of obsolete content
umes the default value but doesn't necessarily add the missing preference. the following table however, includes preferences which must be included in any product for the download manager to function. preference description browser.download.dir a local folder the user may have selected for downloaded files to be saved. migration of other browser settings may also set this
path. this folder is enabled when browser.download.folderlist equals 2. browser.download.folderlist indicates the default folder to download a file to. 0 indicates the desktop; 1 indicates the systems default downloads location; 2 indicates a custom (see: browser.download.dir) folder. in firefox 3 and earlier, the default is 0 (except on windows vista, where it's toggled to 1 on ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
set, for which margins apply by default). the flag is also set when reflowing a frame whose computed bottom border padding is zero. (why?) brs_applytopmargin this flag is set if the top margin should be considered when placing a linebox that contains a block frame. it may be set as a side-effect of calling nsblockframe::shouldapplytopmargin(); once set, shouldapplytopmargin() uses it as a fast-
path way to return whether the top margin should apply. if the flag hasn't been set in the block reflow state, then shouldapplytopmargin() will crawl the line list to see if a block frame precedes the specified frame. if so, the top margin should be applied, and the flag set to cache the result. (if not, the top margin will be applied as a result of the generational margin collapsing logic in nsblockr...
Repackaging Firefox - Archive of obsolete content
nsion that you want to bundle with firefox, and don't want to bundle an extra extension solely to set a few defaults, you can do everything you need to do in your existing extension. however, it's still recommended that you look through this tutorial, as it contains tips specific for creating extensions of this type, and there are a few options that you will need to set to ensure a smooth upgrade
path for users. at the very least, don't skip the "important extension preferences" section below. sample dex the best way to get started is probably to look at a simple dex and modify it for your own purposes. download the sample. xpi files are specially crafted zip files in disguise. you can use any zip program (winzip on windows, zip on mac or linux, etc) to extract it. this xpi has the followi...
Metro browser chrome tests - Archive of obsolete content
est test framework. running the metro browser chrome tests to run mochitest, first build mozilla with your changes; then run ./mach mochitest-metro this will launch metro browser chrome tests in the default immersive browser. for information on setting your local build as the default, visit the windows 8 integration wiki page. it is possible to run individual tests as well. as with mochitest, the
path given as an argument is the
path to a test file within the mozilla source tree. if the
path points to the root tests directory, then all metro browser chrome tests will be run. for example, to run a specific test the command would be: ./mach mochitest-metro browser/metro/base/tests/mochitest/(testfile) writing browser chrome tests metro browser chrome tests make use of a common framework for def...
Mozilla Application Framework in Detail - Archive of obsolete content
s) performinstall(); else { alert("error detected: "+getlasterror()); cancelinstall(); } other features a resource description framework (rdf) parser with support for creating rdf graphs programmatically or by parsing files, compositing multiple sources into a single rdf graph, querying and manipulating graphs, and populating xul widgets (trees, menus, etc.) with graph data; an xslt/x
path processor; scalable vector graphics (svg) rendering with support for a usable subset of the standard including all basic shapes, beziers, stroking and filling with opacity, and much of the dom; mathml rendering; an ecma-262 edition 3-compliant javascript engine; java integration with a bridge to xpcom, a java dom api, the open jvm integration (oji) facility, a java webclient api, and java plu...
New Security Model for Web Services - Archive of obsolete content
cess. delegation with mixed ownership independent owners of subdirectories cannot grant web script access to these subdirectories without getting the owner of the root directory to post a delegating access file. normally a server will be either inside or outside of a firewall, so this is not a problem. where a server spans multiple owners, the alternative would be to scan all directories in the
path looking for a web scripts access file, which seems undesirable. on the other hand, perhaps it is not so bad, since it permits independent management in domains where the top level owner may not care about providing access to web services. adjustments as this new model is applied to soap, and potentially document.load or xml-request, it may be desirable to eliminate the same source security bypa...
Bundles - Archive of obsolete content
e webapp. how-to here is a simple way to build a basic web application bundle: create file called webapp.ini that contains something like: [parameters] id=unique-app-id@unique-author-id.whatever name=webapp name uri=http://[the-url-what-you-want-to-connect-to]/ status=yes location=no sidebar=no navigation=no zip the file to [whatever].webapp double-click the webapp bundle or use prism -webapp [
path-to-webapp] structure a bundle can contain the following files. any other files in the .webapp file will be ignored. after the .webapp file is executed the first time, these files will be unzipped and "cached" to a local directory structure. / webapp.ini webapp.js webapp.css winnt/ webapp.css darwin/ webapp.css linux/ webapp.css [icon].ico [icon].png [icon].icns ...
Hacking wiki - Archive of obsolete content
de("extensions/abbr.php"); include("extensions/object.php"); include("extensions/kbd.php"); ?> tbd installing/configuring rss and doxygen extensions - anything special needs to be done? the title-override / breadcrumbs extensions need an additional table created. to configure it, run <tt>update-devmo.php</tt> from the command line. the following worked for me (from the <tt>www</tt> directory): /
path/to/php -f ./maintenance/update-devmo.php done you should have a working install of the mdc wiki now. if you have problems with setting up the mdc wiki (and not the web server or php or mediawiki), feel free to ask in #devmo. random tips you can set the file to log by putting something like this in your localsettings.php: $wgdebuglogfile = 'c:\\123'; you can then use wfdebug() function to ...
RDF Datasource How-To - Archive of obsolete content
from the repository. constructing a dll for a component is beyond the scope of this document; the reader is referred to the rdf factory as a guideline. registering an rdf datasource is fairly simple: in the dll's nsregisterself() method, you simply call the component manager's registercomponent() method: extern "c" pr_implement(nsresult) nsregisterself(nsisupports* aservicemanager, const char* a
path) { nsresult rv; ... // assume compmgr refers to the component manager rv = compmgr->registercomponent(kmydatasourcecid, "my data source", ns_rdf_datasource_progid_prefix "my-datasource", a
path, pr_true, pr_true); ... } replace kmydatasourcecid with your datasource's clsid. replace "my data source" with a descriptive string that should appear in ...
Actionscript Performance Tests - Archive of obsolete content
[], faster time is displayed in the output column, and the 95% confidence interval is calculated. the 95% confidence interval is the calculated percentage of the mean value to fall within 95% of the measured results. for example if the mean is 100 and the 95% confidence interval is 2%, 95% of the expected values should fall between 98 and 102. to compare two vms against each other export avm2=<
path to 2nd vm> or use --avm2=<
path to 2nd vm>. the percentage difference is calculated between the two vms. see the --help usage for more details about performance tests. # to run a group of tests (e.g. sunspider) $ ./runtests.py sunspider/*.as sunspider/as3/*.as test avm metric sunspider/access-binary-trees.as 584 time sun...
Tamarin Build System Documentation - Archive of obsolete content
he tamarin repository, get a current copy in your test repository cd into the build/buildbot/slaves directory: cd build/buildbot/slaves copy the your platform scripts directory into the scripts directory and cd into the new scripts directory: cp -r mac-intel-10_5/scripts . ...
Tamarin mercurial commit hook - Archive of obsolete content
\n) "mark_security_change" - looks for this text and warns user as security changes should not be checked into the public tamarin-redux repository. installing the commit hook the easiest way to implement the hook is to sync to the tip of tamarin-redux then add the following to your tamarin-redux/.hg/hgrc file (or to ~/.hgrc to implement for all local repos): [hooks] pretxncommit.commit = python:/
path/to/tamarin-redux/utils/hooks/tamarin-commit-hook.py:master_hook once added, all commits will run the commit hook. hook use on every commit to your local repository, the hook will only check for violations in any new / changed code. any untouched lines of code that violate the check will be ignored. when a violation is found the following will be displayed: > hg commit -m "change with a tab" t...
The Download Manager schema - Archive of obsolete content
the table, you can do so using the storage api. the schema table field name type description id integer a unique id for the download. this field is the primary key for the table. name text the download's file name. source text the source uri for the download. target text the destination uri for the download. temp
path text the
path of the temporary file being used for the download. starttime integer the download's start time. endtime integer the download's end time. state integer the download's current state. see the constants list in the nsidownloadmanager documentation. referrer text the referrer for the download. entityid text ...
Treehydra Manual - Archive of obsolete content
tructor that should return the intersection of two abstract values. it is also acceptable for meet to return a value that contains the intersection--this may cause the analysis to have more false positives but will not introduce false negatives. join. join is a relation on abstract values used to merge states at control flow merge points. for example, if esp reaches a point where two control flow
paths merge, and on one side the abstract value of x is 1, and on the other side, the abstract value of x is 2, then the new abstract value of x will be 1 join 2. esp uses a built-in join function where join(a,a) -> a and join(a,b) -> top for a != b. ...
Using gdb on wimpy computers - Archive of obsolete content
t. the best way to do this is to set a breakpoint in main, let the program run until main and then turn off automatic library loading. from there you can allow the program to continue running. here's an example: [blizzard@gunhead mozilla]$ cd dist/bin/ [blizzard@gunhead bin]$ ./mozilla -g .//run-mozilla.sh -g ./mozilla-bin mozilla_five_home=/home/blizzard/src/mozilla/mozilla/dist/bin ld_library_
path=/home/blizzard/src/mozilla/mozilla/dist/bin shlib_
path=/home/blizzard/src/mozilla/mozilla/dist/bin lib
path=/home/blizzard/src/mozilla/mozilla/dist/bin moz_program=./mozilla-bin moz_toolkit= moz_debug=1 moz_debugger= /usr/bin/gdb ./mozilla-bin -x /tmp/mozargs22288 gnu gdb 19991004 copyright 1998 free software foundation, inc. gdb is free software, covered ...
Venkman Introduction - Archive of obsolete content
fishes have paused. in addition to step in, which will execute a single line of javascript and stop, step over can be used to step over a impending function call, and return control to the debugger when the call returns. step out executes until the current function call exits. click the "pause" link again on the fishcam page to resume the demo. this starts the dhtml down the other code
path in start() and makes the fishes start swimming again. as you can see, this is a very modest introduction to the functionality of the javascript debugger and the complexity that scripts can have. but the steps described here can give you a basic feel for the debugger if you haven't already had some experience using it, and they provide the basis for the more interesting and practical examples ...
Using XPInstall to Install Plugins - Archive of obsolete content
plugin again? in order to address this issue, plugin vendors are encouraged to: install the plugin software components for the browser (e.g. dlls on windows, and xpt files if applicable) to a secondary location, in addition to that of the plugins directory of the current browser. write keys in the windows registry which store information about this secondary location, in particular the plugin
path and the xpt
path (if applicable) so that netscape gecko browsers can pick up the plugin from the secondary location if they are installed after the plugin is (and thus, if a particular netscape gecko browser follows or replaces the current browser). the keys to write and the information they should contain is discussed in detail in the specification posted on mozilla.org. there is also a sample r...
InstallTrigger.startSoftwareUpdate - Archive of obsolete content
installtrigger.startsoftwareupdate this is a very simple example of the installtrigger object's principal method, startsoftwareupdate, which takes a string representing the
path to the xpi and installs that xpi on the local machine. function triggerurl(url) { installtrigger.startsoftwareupdtate(url); } // get the url to the .xpi from either a form // or text field entry. then do: ... onclick="triggerurl(this.form.url.value); ...
dirCreate - Archive of obsolete content
returns an integer error code. for a list of possible values, see return codes. description the input parameter is a filespecobject that you have already created with the install object's getfolder method. ...
dirGetParent - Archive of obsolete content
dirgetparent returns an object representing the parent directory of the current directory or file. method of file object syntax filespecobject dirgetparent( filespecobject fileordir ); parameters the dirgetparent method has the following parameters: fileordir a filespecobject representing the
pathname of the file or directory whose parent is being requested. returns a filespecobject if successful; null if not successful. example f = getfolder("program", "mynewdirectory"); err = file.dircreate(f); err = file.getparent(f) // returns "program" ...
isDirectory - Archive of obsolete content
summary returns a boolean value indicating whether the specified filespecobject is a directory. method of file object syntax boolean isdirectory ( filespecobject nativefolder
path ); parameters the isdirectory method has the following parameters: nativefolder
path a filespecobject representing the queried directory. returns a boolean value indicating whether the object is a directory or not. ...
isFile - Archive of obsolete content
summary returns a boolean value indicating whether the given filespecobject is a file. method of file object syntax boolean isfile (filespecobject nativefolder
path); parameters the isfile method has the following parameter: nativefolder
path a filespecobject representing the queried file object. returns a boolean value indicating whether the filespecobject is a file or not. example f = getfolder( "program", "sample.txt" ); if ( file.isfile(f) ) // the object represents a file ...
size - Archive of obsolete content
summary return the size of the given file in bytes. method of file object syntax int size (string nativefolder
path); parameters the size method has the following parameters: nativefolder
path the full
pathname to the file. returns a number representing the size, in bytes, of the queried file. ...
isKeyWritable - Archive of obsolete content
iskeywritable returns whether the given registry key is writable or not. method of winreg object syntax boolean iskeywritable( string key); parameters the method has the following parameter: key a string representing the
path to the key returns a boolean value: true if the key is writable; false if not. example winreg = getwinregistry(); if ( winreg != null ) { winreg.setrootkey ( winreg.hkey_local_machine ); if(winreg.iskeywritable("software")) { //iskeywritable returned true } else { //iskeywritable returned false } ...
keyExists - Archive of obsolete content
keyexists returns whether the key exists. method of winreg object syntax boolean keyexists ( string key); parameters the method has the following parameter: key a string representing the
path to the key returns boolean value description if the user does not have read access to the given key, this will also return false. example winreg = getwinregistry(); if ( winreg != null ) { winreg.setrootkey( winreg.hkey_local_machine); if(winreg.keyexists("software\\mozilla")) { //keyexists returned true } else { //keyexists returned false } } ...
A XUL Bestiary - Archive of obsolete content
content/help.xul', '_blank', 'chrome,all,dialog=no')" /> in this example, the chrome url is being used to point to a chrome within the package hierarchy of the mozilla application. a help chrome defined in mozilla/bin/chrome/help/ is being invoked from the help menu. note that when no file name is specified after the chrome directory
path, a file name with the same name as the package is assumed. in other words, a chrome url like the global pointer above picks up a file called global.css, and the help pointer above could also be written as chrome://help/content, because the name of the package itself is "help." viewing chromes other than mozilla's there is a special flag you can use to start mozilla with some chrome other than t...
expr - Archive of obsolete content
« xul reference home expr type: string for xml queries, an x
path expression which returns results. any namespace prefixes declared on the element may be used within the expression. ...
preference.type - Archive of obsolete content
« xul reference home type type: one of the values below the preference type which should be one of the following values. bool a boolean set to either true or false. usually a checkbox would be connected to these preferences. int an integer string a string unichar a unicode string wstring a localized string. in this situation the preference will save the
path to a property file which contains the actual value of the preference. file a file. the file
path will be stored in the preferences. ...
Accessing Files - Archive of obsolete content
ry much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. accessing files this section describes how to create a file reference. retrieving a file when working with files, usage is always done via a file object and not via string
paths. this allows files to used in a portable way. because string
paths are not used, references to files in a file object are made relative to some starting directory. a number of starting directories may be used, for instance, the user's home directory, the desktop, the system's temporary folder, and so forth. once one of these starting directories is determined, a file reference may be created rel...
Working With Directories - Archive of obsolete content
d argument, or refer to one of the special directories by supplying a null string for the second argument. the first line below with retrieve the directory corresponding to the user's home directory, while the second will retrieve the directory 'myfiles' on the desktop. var dir1 = io.getfile("home", ""); var dir2 = io.getfile("desktop", "myfiles"); to refer to a subdirectory, rather than using a
path, use nsifile.append() to build up a
path. for instance: var dir2 = io.getfile("desktop", "myfiles"); dir2.append("pictures"); dir2.append("vacations"); in this example, a subdirectory several levels down is referenced. each call to nsifile.append() navigates to a further subdirectory. the result is a subdirectory three levels below the desktop directory. these directories do not need to exist ye...
Attribute Substitution - Archive of obsolete content
bug can make this appear to not work at times. recall that the template builder doesn't load the datasource before processing a template. as the datasource loads, the query and rules are examined with the new data as it arrives. this causes rules to create matches as the data loads. however, variables determined from a binding are evaluated using a much simpler process. the bug is that this code
path for bindings doesn't handle the textnode element properly. thus, if you use a variable set in a binding, you must ensure the datasource is loaded before the template is built, or just rebuild the template. another possibilty is to rearrange the rdf such that the values, in this example, the descriptions, are specified before the containers. this issue is fixed in firefox 3 (mozilla 1.9) and later...
Building Hierarchical Trees - Archive of obsolete content
se to appear. to be able to do this, the tree builder must know that an item is a container. with an rdf datasource, this would usually be an rdf container such as a seq and the tree would display its children. for an xml datasource, the tree might display a node's children as the children in the tree, making the tree display a hierarchy similar to that in the xml document. or, with more complex x
path expressions, a template could display a tree where the hierarchy wasn't directly like the xml document. if a node is a container, the tree item becomes a container, and the user may open the row by double-clicking it. note that this test is done on the member value not the reference value. for instance, in the photo example, we have a container 'http://www.xulplanet.com/rdf/myphotos' with three p...
Multiple Rules - Archive of obsolete content
ich has the effect of selecting only those people with multiple names. people with only a single name, as 'cleopatra' in this example, won't match any rule so won't have any content at all generated for it. this is an effective way to filter out results that you don't want. in this simple example with one rule though, it would likely be simpler and faster to just filter these out using the query x
path expression rather than generating the results then using a condition to filter them. rules and conditions are more useful when using multiple rules. we can add multiple where elements if we want to check additional conditions. when multiple conditions are present, they must all match for the rule to apply. adding to the previous example, here we check for people with a space in their name, and a ...
SQLite Templates - Archive of obsolete content
. to do this, set the querytype attribute on the root node of the template to the value storage. this will cause the datasource to be treated as an sqlite database. the datasources attribute may be set to one of two possible types of values. first, it may a file url pointing to a file on disk. in this case, you will often be setting the datasources attribute dynamically after determining the file
path. (if you intend to set it by script, you must set datasources in the xul to rdf:null). the second method involves using a special url form: profile:filename.sqlite this form with the 'profile' prefix is used to refer to files in the profile directory. this is useful for user data, and is suitable as you do not need to calculate where this directory is located. the file within this directory is ...
Sorting Results - Archive of obsolete content
for an sqlite datasource, the generated content corresponds to the order of results of the sql query. for an rdf datasource, again, the results are in the order the query generates them, although except in the case of an rdf seq, this order is arbitrary as rdf triples don't occur in any particular order. ...
Template Builder Interface - Archive of obsolete content
even if you don't specify it. this is something to watch out for if you are going to be manipulating the composite datasource. one more note: the datasources attribute may use either absolute or relative urls. relative urls are relative to the xul document the corresponding element is in. the rdf service's getdatasource method however, only accepts absolute urls. so you will need to use the full
path in this situation. « previousnext » ...
Template Logging - Archive of obsolete content
example, a particular container has no children; it means that a logic error in the query implies that a variable could never be computed properly. an example is given below this list of errors. neither subject or object variables of <triple> has a value similar to the previous error but for the <triple> element. either the subject or object variables could never be set to a value for a result. x
path expression in query could not be parsed for xml datasources, a query attribute has an x
path expression that is not valid. x
path expression in <assign> could not be parsed </assign> for xml datasources, an <assign> element has an x
path expression that is not valid. x
path expression in <binding> could not be parsed for xml datasources, a <binding> element has an x
path expression that is not valid. ...
Code Samples - Archive of obsolete content
file on your computer, use code like this. change the first line to specify the file that you want to launch. you can launch an executable file or some other file that your operating system knows how to open. note: on operating systems that use backslash characters, double each backslash character. on operating systems that use forward-slash characters, specify the file in the normal way. const
path = "c:\\windows\\charmap.exe" var file = components .classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile) file.initwith
path(
path) file.launch() open a web page if your button is in firefox or seamonkey, use code like this to open a web page. change the first line to specify the page that you want to open: const url = "http://www.mozilla.org/" document ...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
d seamonkey, then go to the chrome directory there. note: for information about how to find the directory where you installed seamonkey, see: installation directory if you cannot easily find the directory, you can use the following method to find it. from seamonkey's menu bar, choose tools – web development – javascript console. copy the following code. it is one very long line ending in
path—make sure that you get all of it: components.classes["@mozilla.org/file/directory_service;1"].getservice( components.interfaces.nsiproperties).get("achrom", components.interfaces.nsifile).
path in the javascript console window, paste the code in the field near the top. presss the return or enter key, or the evaluate button. the console displays the location of seamonkey's chrome directory. ...
Grids - Archive of obsolete content
sted hbox or other box element. an hbox is a single element but you can put as many elements that you want inside it. for example: example 2 : source view <grid flex="1"> <columns> <column/> <column flex="1"/> </columns> <rows> <row> <label control="doctitle" value="document title:"/> <textbox id="doctitle" flex="1"/> </row> <row> <label control="doc
path" value="
path:"/> <hbox flex="1"> <textbox id="doc
path" flex="1"/> <button label="browse..."/> </hbox> </row> </rows> </grid> notice in the image how the first column of elements containing the labels has only a single element in each row. the second column contains a box in its second row, which in turn contains two elements, a textbox and a button. you coul...
Install Scripts - Archive of obsolete content
xul applications unless you are creating your own xpcom components. what you do need to know for an installation is that the registry stores a set of information about your application, such as the file list and versions. all of this information is stored in a key (and within subkeys) that you provide in the installation script (in step 1 mentioned above). this key is structured as directory-like
path of the following form: /author/package name replace the word author with your name and replace the package name with the name of the package that you are installing. for example: /xulplanet/find files /netscape/personal security manager the first example is what we'll use for the find files dialog. the second is the key used for the personal security manager. install initialization the install...
Tree View Details - Archive of obsolete content
+ i + 1, 0, [toinsert[i], false]); } this.treebox.rowcountchanged(idx + 1, toinsert.length); } this.treebox.invalidaterow(idx); } first we will need to check if the row is a container. if not, the function just returns since non-containers cannot be opened or closed. since the third element in the item array (with an index of 2) holds whether the row is open or not, we use two code
paths, the first to close a row and the second to open a row. let's examine each block of code, but let's look at the second block for opening a row first. item[2] = true; var label = this.visibledata[idx][0]; var toinsert = this.childdata[label]; for (var i = 0; i < toinsert.length; i++) { this.visibledata.splice(idx + i + 1, 0, [toinsert[i], false]); } this.treebox.rowcountchanged(idx + 1, toins...
XUL Structure - Archive of obsolete content
y for a particular user. just copying a xul file into the chrome directory doesn't give the file any extra permissions, nor can it be accessed via a chrome url. to gain the extra privileges, you will need to create a manifest file and put that in the chrome directory. this file is easy to create, as it is typically only a couple of lines long. it is used to map a chrome url to a file or directory
path on the disk where the xul files are located. details of how to create this file will be discussed in a later section. the only way to create content that can be accessed through a chrome url is by creating a package as described in the next few sections. this directory is called 'chrome' probably because it seemed like a convenient name to use in keeping with the chrome packages that are include...
Using the Editor from XUL - Archive of obsolete content
s an odd-man-out event listener, in that it's registered from the editorshell, rather than internally to the editor. note: this is ugly, and should probably be redesigned to work on callbacks out of the editor, or moved entirely to javascript. the nseditorshellmouselistener essentially calls nseditorshell::handlemouseclickonelement to show property dialogs for items that you double-click on. the
path of a key press so what happens to a key press once it's got to the nstexteditorkeylistener? how does that end up in the document? let's trace through. nstexteditorkeylistener::keypress() gets the key press event. for normal character keys, that falls into nshtmleditor::editorkeypress(). nshtmleditor::editorkeypress() gets the character code from the key event, puts that into a string...
preference - Archive of obsolete content
are later in the tab sequence. type type: one of the values below the preference type which should be one of the following values. bool a boolean set to either true or false. usually a checkbox would be connected to these preferences. int an integer string a string unichar a unicode string wstring a localized string. in this situation the preference will save the
path to a property file which contains the actual value of the preference. file a file. the file
path will be stored in the preferences. properties defaultvalue (readonly) returns the default value of the preference. the type of the property depends on the value of the type property. if the preference has no default value, this property returns null. disabled type: ...
prefpane - Archive of obsolete content
will be loaded as an overlay to the main preferences window. more information is available in the preferences system article. attributes helpuri, image, label, onpaneload, selected, src properties image, label, preferenceelements, preferences, selected, src examples methods preferenceforelement <prefpane id="panegeneral" label="general" src="chrome://
path/to/paneoverlay.xul"/> or <prefpane id="panegeneral" label="general" onpaneload="ongeneralpaneload(event);"> <preferences> <preference id="pref_one" name="extensions.myextension.one" type="bool"/> ... more preferences ... </preferences> <checkbox label="number one?" preference="pref_one"/> ... more ui elements ... </prefpane> attributes helpuri type: uri th...
query - Archive of obsolete content
ed. for rdf datasources, the query should contain one content element as well as member and/or triple elements. for xml datasources, the query should have an expr attribute and may optionally contain assign elements. for sql datasources, the query should contain an sql statement as text. attributes expr examples (example needed) attributes expr type: string for xml queries, an x
path expression which returns results. any namespace prefixes declared on the element may be used within the expression. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwi...
Building XULRunner with Python - Archive of obsolete content
pecify that python is used withtype="application/x-python" attribute. dom scripting is pretty much as with java script. for example def onload(): btntest = document.getelementbyid("btntest") btntest.addeventlistener('command', ontest, false) def ontest(): window.alert('button activated') window.addeventlistener('load', onload, false) one possible gotcha is that the default python
path used to find modules that areimported explicitly includes the xulrunner executable directory and the directory that is current when xulrunner launches. however it does not include any
path related to the xul application being run. some work around will need to be found. unhandled exceptions are displayed in the javascript error console which can be opened usingxulrunner -jsconsole. one solution ...
Using LDAP XPCOM with XULRunner - Archive of obsolete content
he component library is just a loader of the real library and all its dependencies, so as all the needed libraries are loaded. create a subdirectory extensions/ldapstub in the mozilla source code directory, containing two files, makefile.in and ldapstubloader.cpp: makefile.in: # copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> depth = ../.. ...
MacFAQ - Archive of obsolete content
ramework directory to /library/frameworks. note that in order to copy the framework while keeping the relative soft-links in the framework, do something like: % ( cd dist ; gnutar cf - xul.framework | ( cd /library/frameworks ; gnutar xf - )) installing your application your application must be installed as a xulrunner app before you can open it. to do this, type: xulrunner-bin --install-app /
path/to/appdir note the
path to your application must end with the directory containing application.ini; you should not reference application.ini in this command. this command will place a copy of your application in /applications/(vendor)/(name) , where (vendor) is the vendor field in your application.ini and (name) is the name field. opening your application for ordinary work, you can just navigate ...
XUL Application Packaging - Archive of obsolete content
required the application id, like extension ids, can be formatted either like an email applicationname@vendor.tld or a uuid {12345678-1234-1234-1234-123456789abc}. the email format is recommended for newly developed applications. example: id=testapplication@example.tld vendor specifies the application vendor optional example: vendor=grinch productions profile specifies the
path to use for the application's profile, based within the user's application data directory optional example: profile=myappdata the [gecko] section the gecko section specifies what version of xulrunner is required by the application. minversion specifies the minimum xulrunner version needed by this application. if there are binary components, minversion must equal the version of the li...
application/http-index-format specification - Archive of obsolete content
unquoted. unquoted tokens may not contain white space. quoted tokens are terminated by the next quote but may not contain carrage returns or new lines. any illegal characters must be escaped via the url escaping syntax defined by rfc 1738. note that a 201 line encountered before a 200 line should be ignored. 300 a url pointing to the directory represented by the index if there is one. a valid
path token must be url escaped. valid 200 tokens note that all tokens are case insensitive. filename the name of file that can be used to retrieve the file when combined with the full
path provided by the 300 line. white space and 8 bit characters must be url encoded. content-length base 10 digits representing the size of the file in bytes. only digits are legal. last-modified rfc 1123 dat...
Mozprocess - Archive of obsolete content
. basic usage: process = processhandler(['command', '-line', 'arguments'], cwd=none, # working directory for cmd; defaults to none env={}, # environment to use for the process; defaults to os.environ ) exit_code = process.waitforfinish(timeout=60) # seconds see an example in https://github.com/mozilla/mozbase/b...profile
path.py processhandler may be subclassed to handle process timeouts (by overriding the ontimeout() method), process completion (by overriding onfinish()), and to process the command output (by overriding processoutputline()). todo document improvements over subprocess.popen.kill ...
Mozrunner - Archive of obsolete content
zrunner is a python package which handles running of mozilla applications. mozrunner utilizes mozprofile for managing application profiles and mozprocess for robust process control. mozrunner may be used from the command line or programmatically as an api. command line usage the mozrunner command will launch the application (specified by --app) from a binary specified with -b or as located on the
path. mozrunner takes the command line options from mozprofile for constructing the profile to be used by the application. run mozrunner --help for detailed information on the command line program. api usage mozrunner features a base class, mozrunner.runner.runner which is an integration layer api for interfacing with mozilla applications. mozrunner also exposes two application specific classes, firef...
nsIContentPolicy - Archive of obsolete content
ra an optional argument, pass-through for non-gecko callers to pass extra data to callees. arequestprincipal optional. the requesting principal. return value accept or reject_* example you can implement this interface easily by including the nsicontentpolicy.h header file and implementing public nsicontentpolicy into your class, like this: // put this into your header file #include "_
path_to_sdk/include/content/nsicontentpolicy.h" class myclass: public nsisupports, public nsicontentpolicy { ... ns_decl_nsicontentpolicy ... } // and this into your implementation file ns_impl_isupportsn(myclass, nsisupports, nsicontentpolicy, ...) note: before you can recieve notifications, you must register your plugin with nsicategorymanager. see example below. char* previous = nsnull...
Mozilla release FAQ - Archive of obsolete content
owing format: cpu/mhz, architecture, ram, disk type, os version, compiler version, build type, tree date -- build time example: 21164/533, alpha, 512m edo, ultra2 scsi, linux kernel 2.2.11, gcc 2.95, non-debug, 19 august 1999 cvs -- 25 minutes how do i run the binary on unix? i get library errors in dist/bin there's a script called mozilla. use that to launch mozilla for you -- it sets ld_library_
path automatically. to launch other binaries from dist/bin with the correct environment, use run-mozilla.sh ./your_binary features, patches what platforms is mozilla available for? mozilla is currently targeted for win32, macos, and unix/x systems. mozilla also runs on mac os x, os/2, and beos, and ports exist for some other platforms. what does mozilla lack that netscape 7 has? netscape 7 has version...
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - november 17, 2006 - november 24, 2006 announcements none this week. discussions microsummary w/ script a user created patch that will allow script to run in a sandbox during the update of a microsummary. they would like to discuss the use of it in bug 361026 rich results for searches a proposal for a search tool that gives users a quicker
path to specific information they are looking for. trunk builds + winxp update = broken? a user questions if there is something broken in a nightly build since the user keeps getting this error from the trunk: "firefox.exe - application error: the application failed to initialize properly." removal of false positives in firefox 2 phishing a user inquires how to remove false positives from the fi...
2006-09-29 - Archive of obsolete content
ailable for download discussions xulrunner fails without feedback on osx intel 10.4.7 will morton is trying to port a xul application to osx. when he runs xulrunner from the command line, it fails silently without any errors. this happens with all his xulrunner ports, with xulrunner 1.8.0.1, 1.8.0.4 and nightly 1.8. benjamin smedberg was able to point out one possible flaw. instead of using /
path/to/xulrunner-bin.ini (which will was doing) applications on a mac must be in an application bundle (foo.app). then use xulrunner -install-app to "unpack" the xul app into the mac structure. meetings no meetings this week ...
2006-10-20 - Archive of obsolete content
summary: mozilla.dev.platform - october 14th to october 20th 2006 announcements no announcements this week. traffic october 14, 2006, 6:53pm - ed notes that, on windows, composer 0.1's reccomended install directory needs to be different than those noted in the release notes. this is a xulrunner 1.8.0.4 application. benjamin smedberg would like to know what
paths were used. started wed, oct 18 2006 9:38 am - a xulrunner developer, frank, discusses his desire to make xul/browser based applications. he wants to be able to build applications that will run inside the browser. nickolay ponomarev, benjamin smedberg, axel hecht clarify some misconceptions about front-end and back-end programming with xulrunner, including the difficulty of writing the backends in c++ (since that would requi...
2006-09-06 - Archive of obsolete content
eading in xpcom or to firefox extensions. how to build xpcom component on mac os x a tutorial on how to build xpcom component on mac os x firefox crashes when calling a function provided by a .so library a solution to the problem loading a shared library when using xpcom firefoxes crashes while getting url in xpcom solutions to resolve the problem of the firefox crash when trying to get the
path and the pre
path of the url of the current page in xpcom meetings none during this week. ...
NPN_PostURLNotify - Archive of obsolete content
void* notifydata); parameters the function has the following parameters: instance current plug-in instance, specified by the plug-in. url url of the post request, specified by the plug-in. target target window, specified by the plug-in. for values, see npn_geturl. len length of the buffer buf. buf
path to local temporary file or data buffer that contains the data to post. file whether to post a file. values: true: post the local file whose
path is specified in buf, then delete the file. false: post the raw data in buf. notifydata plug-in-private value for associating the request with the subsequent npp_urlnotify call, which returns this value...
NPP_StreamAsFile - Archive of obsolete content
api summary provides a local file name for the data from a stream. syntax #include <npapi.h> void npp_streamasfile(npp instance, npstream* stream, const char* fname); parameters the function has the following parameters: instance pointer to current plug-in instance. stream pointer to current stream. fname pointer to full
path to a local file. if an error occurs while retrieving the data or writing the file, fname may be null. description when the stream is complete, the browser calls npp_streamasfile to provide the instance with a full
path name for a local file for the stream. npp_streamasfile is called for streams whose mode is set to np_asfileonly or np_asfile only in a previous call to npp_newstream. if an err...
.htaccess ( hypertext access ) - Archive of obsolete content
rom 146.0.74.205 # blocks all access from 146.0.74.205 to the directory ssi or server side include : include external files to each file requested by the user without the need to write include statements in the file; you can have them automatically attached to all the files, whether at top or bottom, automatically through your .htaccess file. php_value auto_prepend_file "/real/
path/to/file/functions.php" # adds function.php at the top of requested document php_value auto_append_file "/real/
path/to/file/footer.php" # adds footer.html at bottom of requested document customized error responses : user can be directed to different pages depending on the error they caused or by the webserver. errordocument 404 /notfound.html # redirects traffic to notfound.html in case of a 40...
Introduction to Public-Key Cryptography - Archive of obsolete content
ssible. certificate chains ca hierarchies are reflected in certificate chains. a certificate chain is series of certificates issued by successive cas. figure 7 shows a certificate chain leading from a certificate that identifies some entity through two subordinate ca certificates to the ca certificate for the root ca (based on the ca hierarchy shown in figure 6). a certificate chain traces a
path of certificates from a branch in the hierarchy to the root of the hierarchy. in a certificate chain, the following occur: each certificate is followed by the certificate of its issuer. each certificate contains the name (dn) of that certificate's issuer, which is the same as the subject name of the next certificate in the chain. in figure 7, the engineering ca certificate contains the dn of...
Table Reflow Internals - Archive of obsolete content
nue (split) breaking status (in the case of some inline frames) if there is truncation (it can't fit in the space and can't split). this is just a convience mechanism. kinds of reflows initial - reflowee's first reflow must be of this type (reflower's responsibility). resize - reflowee gets a change in available space only. similar to initial, except it can reoccur. incremental - has a reflow
path (tree) where each node has a command with a target frame, reflow command types are: dirty - something changed inside a target (e.g. it gains, loses children) style changed - a target changed stylisticly (recall, size is a style property) content changed - a target's content changed (e.g. a text run) user defined - currently only used for fixed positioned frames kinds of reflows incremental r...
Processing XML with E4X - Archive of obsolete content
)); // alerts 3 searching and filtering e4x provides special operators for selecting nodes within a document that match specific criteria. these filter operations are specified using an expression contained in parentheses: var html = <html> <p id="p1">first paragraph</p> <p id="p2">second paragraph</p> </html>; alert(html.p.(@id == "p1")); // alerts "first paragraph" nodes matching the
path before the expression (in this case the paragraph elements) are added to the scope chain before the expression is evaluated, as if they had been specified using the with statement. consequently, filters can also run against the value of a single node contained within the current element: var people = <people> <person> <name>bob</name> <age>32</age> </person> <person> <name>joe...
Enumerator.atEnd - Archive of obsolete content
ple in following code, the atend method is used to determine if the end of a list of drives has been reached: function showdrives() { var s = ""; var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); var e = new enumerator(fso.drives); e.movefirst(); while (e.atend() == false) { var drv = e.item(); s += drv.
path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } req...
Enumerator.moveFirst - Archive of obsolete content
mple, the movefirst method is used to evaluate members of the drivescollection from the beginning of the list: function showdrives() { var s = ""; var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); var e = new enumerator(fso.drives); e.movefirst(); while (e.atend() == false) { var drv = e.item(); s += drv.
path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } req...
Enumerator.moveNext - Archive of obsolete content
example in following example, the movenext method is used to move to the next drive in the drives collection: function showdrives() { var s = ""; var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); var e = new enumerator(fso.drives); e.movefirst(); while (e.atend() == false) { var drv = e.item(); s += drv.
path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } req...
Packages - Archive of obsolete content
ows: var theframe = new packages.java.awt.frame(); for convenience, javascript provides the top-level netscape, sun, and java objects that are synonyms for the packages properties with the same names. consequently, you can access java classes in these packages without the packages keyword, as follows: var theframe = new java.awt.frame(); the classname property represents the fully qualified
path name of any other java class that is available to javascript. you must use the packages object to access classes outside the netscape, sun, and java packages. properties classname: the fully qualified name of a java class in a package other than netscape, java, or sun that is available to javascript. java: any class in the java package java.*. netscape: any class in the java package netscape.
Troubleshooting XForms Forms - Archive of obsolete content
heck the following: as with inline instance, make sure the instance of the form control ref binding expression matches the namespace of the data. if form controls are within repeat, check that you are using attribute nodeset for the repeat instead of attribute ref. if the instance is not in the empty namespace (xmlns=""), then all binding expressions must use a prefix bound to the namespace. x
path 1.0 expressions do not have a default namespace, so a prefix must always be specified if the namespace is not the empty namespace. if your binding expression starts with a /, make sure the first thing is the name of the root node of the instance. if your binding expression contains a /, look for any containing xf:group, xf:repeat, xf:input or other elements that set the context node. instance...
Mozilla XForms Specials - Archive of obsolete content
). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an input control use: @namespace xf url("http://www.w3.org/2002/xforms"); xf|input .xf-value { ... } the pseudo elements are defined in the css3 basic user interface specification . (limitation tracked in bug 271724) optional parameters in x
path functions optional parameters in x
path functions are not supported, you will have to specify all parameters when calling a function. this affects functions like hmac() or digest(). instead of using digest('abc', 'sha-1') explicitly use the third parameter (the results are equal): digest('abc', 'sha-1', 'base64') (limitation tracked in bug 477857) extensions enumerating instances the standardi...
XForms Output Element - Archive of obsolete content
bound to in a read-only manner (see the spec). to see how they work you can try an xhtml example or a xul example. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding special value - x
path expression whose evaluation result is used as the output's value. if binding attributes are present on the control then the value attribute is is ignored. type restrictions the output element can be bound to a node containing simple content of any data type. representations the xforms output element can be represented by the following widgets for the specified data types (or types derive...
Archived open Web documentation - Archive of obsolete content
g(). instead of opening a new window, it merges the specified xul dialog into the main window. writing javascript for xhtml technical review completed. editorial review completed. xforms xforms were envisioned as the future of online forms as envisioned by the w3c. drawing on other w3c standards like xml schema, x
path, and xml events, xforms tried to address some of the limitations of the current html forms model. however, xforms never gained traction and is now considered obsolete. ...
XQuery - Archive of obsolete content
xquery is a w3c standard language which is meant to be for xml what sql is for relational data--i.e., the ability to search, sort, extract, and remold data. it offers powerful and yet intuitive searching based on x
path, has sql-like syntax for the query portion, and has scripting features such as function and variable definitions, xml-inclusion, etc. while xquery is currently not supported in firefox (whether through javascript to developers or to browser users), at least one extension has been developed to give a preliminary support for xquery for browser users (and serving as a simple model for how xquery can be implemented within extensions). xquseme is a working proof-of-concept (so far tested on windows and linux with java installed; mac does not work) extension which allows one...
Archive of obsolete content
using javascript and provides working examples. this article deals uniquely with netscape 7.1 running on the windows operating system. xquery xquery is a w3c standard language which is meant to be for xml what sql is for relational data--i.e., the ability to search, sort, extract, and remold data. it offers powerful and yet intuitive searching based on x
path, has sql-like syntax for the query portion, and has scripting features such as function and variable definitions, xml-inclusion, etc. xul booster xul booster is a third party eclipse / webtools build that offers some support for xul editing and awesome support for extension packaging. xul parser in python v.00001 ...
Anatomy of a video game - Game development
several other optimizations are possible and it really depends on what your game attempts to accomplish. your game genre will obviously make a difference but it could even be more subtle than that. you could draw every pixel individually on a canvas or you could layer dom elements (including multiple webgl canvases with transparent backgrounds if you want) into a complex hierarchy. each of these
paths will lead to different opportunities and constraints. it is decision... time you will need to make hard decisions about your main loop: how to simulate the accurate progress of time. if you demand per-frame control then you will need to determine how frequently your game will update and draw. you might even want update and draw to occur at different rates. you will also need to consider how gr...
Index - Game development
tion games, html5, javascript, monetization, advertisements, branding, iap, licensing there are many ways to earn money — everything that applies to the "normal" aaa gaming world can be, more or less, applied to casual html5 games. you might however also focus on selling licenses, doing branding, or earning on a revenue share basis from the advertisements. it's totally up to you which
path you're going to follow. 10 game promotion community, games, javascript, promotion, blog, competitions, youtube any way of promoting your game is good. you have a whole lot of options to chose from with most of them being free, so it's only about your enthusiasm and available time. sometimes you have to spend more time promoting a game than actually developing it. remember tha...
Publishing games - Game development
people know about your great new game. promoting the game helps a lot in monetizing it later on too, so it's important to do it effectively. game monetization when you spend your time building, publishing and promoting your game, you will at some point consider earning money out of it. game monetization is essential to anyone who considers their game development work a serious endeavour on the
path to becoming an independent game developer able to make a living, so read on and see what your options are. the technology is mature enough; it's just a matter of chosing the right approach. ...
2D collision detection - Game development
= {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() { var ctx = crafty.canvas.context; ctx.save(); ctx.fillstyle = this.color; ctx.begin
path(); ctx.arc( this.x + this.radius, this.y + this.radius, this.radius, 0, math.pi * 2 ); ctx.close
path(); ctx.fill(); ctx.restore(); } }); var circle1 = crafty.e("2d, canvas, circle").attr(dim1).circle(15, "red"); var circle2 = crafty.e("2d, canvas, circle, fourway").fourway(2).attr(dim2).circle(20, "blu...
Collision detection - Game development
icks() { for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { if(bricks[c][r].status == 1) { var brickx = (c*(brickwidth+brickpadding))+brickoffsetleft; var bricky = (r*(brickheight+brickpadding))+brickoffsettop; bricks[c][r].x = brickx; bricks[c][r].y = bricky; ctx.begin
path(); ctx.rect(brickx, bricky, brickwidth, brickheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.close
path(); } } } } tracking and updating the status in the collision detection function now we need to involve the brick status property in the collisiondetection() function: if the brick is active (its status ...
Paddle and keyboard controls - Game development
ables: var paddleheight = 10; var paddlewidth = 75; var paddlex = (canvas.width-paddlewidth) / 2; here we're defining the height and width of the paddle and its starting point on the x axis for use in calculations further on down the code. let's create a function that will draw the paddle on the screen. add the following just below your drawball() function: function drawpaddle() { ctx.begin
path(); ctx.rect(paddlex, canvas.height-paddleheight, paddlewidth, paddleheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.close
path(); } allowing the user to control the paddle we can draw the paddle wherever we want, but it should respond to the user's actions. it's time to implement some keyboard controls. we will need the following: two variables for storing information on w...
Load the assets and print them on screen - Game development
ad.image() method. add the following new line just inside the preload() function, at the bottom: function preload() { // ... game.load.image('ball', 'img/ball.png'); } the first parameter we want to give the asset is the name that will be used across our game code — for example, in our ball variable name — so we need to make sure it is the same. the second parameter is the relative
path to the graphic asset. in our case, we will load the image for our ball. (note that the file name does not also have to be the same, but we'd recommend it, as it makes everything easier to follow.) of course, to load the image, it must be available in our code directory. grab the ball image from github, and save it inside an /img directory in the same place as your index.html file. now, to show ...
2D breakout game using Phaser - Game development
if you are not already familiar with pure javascript game development, we would suggest that you first work through this series' counterpart, 2d breakout game using pure javascript. after that, you can pick any framework you like and use it for your projects; we have chosen phaser as it is a good...
Algorithm - MDN Web Docs Glossary: Definitions of Web-related terms
way to solve a problem so that it can be solved repeatedly, by humans or machines. computer scientists compare the efficiency of algorithms through the concept of "algorithmic complexity" or "big o" notation. for example: a cooking recipe is a simple algorithm for humans. a sorting algorithm is often used in computer programming to explain a machine how to sort data. common algorithms are
pathfinding algorithms such as the traveling salesman problem, tree traversal algorithms and so on. there are also machine learning algorithms such as linear regression, logistic regression, decision tree, random forest, support vector machine, recurrent neural network (rnn), long short term memory (lstm) neural network, convolutional neural network (cnn), deep convolutional neural network and so on.
CSS Object Model (CSSOM) - MDN Web Docs Glossary: Definitions of Web-related terms
the css object model (cssom) is a map of all css selectors and relevant properties for each selector in the form of a tree, with a root node, sibling, descendant, child, and other relationship. the cssom is very similar to the document object model (dom). both of them are part of the critical rendering
path which is a series of steps that must happen to properly render a website. the cssom, together with the dom, to build the render tree, which is in turn used by the browser to layout and paint the web page. cssom api the css object model is also a set of apis allowing the manipulation of css from javascript. it is much like the dom, but for the css rather than the html. it allows users to read and modify the css style dynamically. see also populating the page: how browsers work...
Dominator - MDN Web Docs Glossary: Definitions of Web-related terms
this concept is important for garbage collection because it means that b is only reachable through a. so if the garbage collector found a to be unreachable and eligible for reclaiming, than b would also be unreachable and eligible for reclaiming. so objects that a dominates contribute to the retained size of a: that is, the total amount of memory that could be freed if a itself were freed. ...
ICE - MDN Web Docs Glossary: Definitions of Web-related terms
ng other technologies) for connecting two peers, regardless of network topology (usually for audio and video chat). this protocol lets two peers find and establish a connection with one another even though they may both be using network address translator (nat) to share a global ip address with other devices on their respective local networks. ...
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
entity header: 200 ok access-control-allow-origin: * connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: mon, 18 jul 2016 16:06:00 gmt etag: "c561c68d0ba92bbeb8b0f612a9199f722e3a621a" keep-alive: timeout=5, max=997 last-modified: mon, 18 jul 2016 02:36:04 gmt server: apache set-cookie: mykey=myvalue; expires=mon, 17-jul-2017 16:06:00 gmt; max-age=31449600;
path=/; secure transfer-encoding: chunked vary: cookie, accept-encoding x-backend-server: developer2.webapp.scl3.mozilla.com x-cache-info: not cacheable; meta data too large x-kuma-revision: 1085259 x-frame-options: deny ...
Synthetic monitoring - MDN Web Docs Glossary: Definitions of Web-related terms
toring the performance of a page in a 'laboratory' environment, typically with automation tooling in an environment that is as consistent as possible. with a consistent baseline, synthetic monitoring is good for measuring the effects of code changes on performance. however, it doesn't necessarily reflect what users are experiencing. synthetic monitoring involves deploying scripts to simulate the
path an end-user might take through a web application, reporting back the performance of the simulator experiences. examples of popular synthetic monitoring tools include webpagetest and lighthouse. the traffic measured is not of your actual users, but rather synthetically generated traffic collecting data on page performance. unlike rum, synthetic monitoring provides a narrow view of performance tha...
WebRTC - MDN Web Docs Glossary: Definitions of Web-related terms
nication) is an api that can be used by video-chat, voice-calling, and p2p-file-sharing web apps. webrtc consists mainly of these parts: getusermedia() grants access to a device's camera and/or microphone, and can plug in their signals to a rtc connection. rtcpeerconnection an interface to configure video chat or voice calls. rtcdatachannel provides a method to set up a peer-to-peer data
pathway between browsers. learn more webrtc on wikipedia webrtc api on mdn browser support for webrtc ...
XSLT - MDN Web Docs Glossary: Definitions of Web-related terms
extensible stylesheet language transformations (xslt) is a declarative language used to convert xml documents into other xml documents, html, pdf, plain text, and so on. xslt has its own processor that accepts xml input, or any format convertible to an xquery and x
path data model. the xslt processor produces a new document based on the xml document and an xslt stylesheet, making no changes to the original files in the process. learn more technical reference xslt on wikipedia xslt documentation on mdn ...
Routers - MDN Web Docs Glossary: Definitions of Web-related terms
re two definitions for routers on the web: for the network layer, the router is a networking device that decides data packets directions. they are distributed by retailers allowing user interaction to the internet. for spa in application layer, router is a library that decides what web page is presented by a given url. this middleware module is used for all url functions, as these are given a
path to a file that is rendered to open the next page. learn more general knowledge for network layer context: router (computing) on wikipedia for spa in application layer context, most of the popular spa frameworks has its routing library: angular router react router vue router ...
MDN Web Docs Glossary: Definitions of Web-related terms
webassembly webdav webextensions webgl webidl webkit webm webp webrtc websockets webvtt whatwg whitespace world wide web wrapper x xforms xhr (xmlhttprequest) xhtml xinclude xlink xml x
path xquery xslt other 404 502 alpn at-rule attack byte-order mark character set client cryptosystem debug digital signature execution flex-direction glsl interface library memory management routers ...
What is accessibility? - Learn web development
visually impaired people, given that it is an entirely visual medium. to show that you care and have thought about accessibility, publish an accessibility statement on your site that details what your policy is toward accessibility, and what steps you have taken toward making the site accessible. if someone does complain that your site has an accessibility problem, start a dialog with them, be em
pathic, and take reasonable steps to try to fix the problem. note: our handling common accessibility problems article covers accessibility specifics that should be tested in more detail. to summarize: consider accessibility from the start of a project, and test early and often. just like any other bug, an accessibility problem becomes more expensive to fix the later it is discovered. bear in m...
How CSS is structured - Learn web development
ss example</p> </body> </html> the css stylesheet file might look like this: h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } the href attribute of the <link> element needs to reference a file on your file system. in the example above, the css file is in the same folder as the html document, but you could place it somewhere else and adjust the
path. here are three examples: <!-- inside a subdirectory called styles inside the current directory --> <link rel="stylesheet" href="styles/style.css"> <!-- inside a subdirectory called general, which is in a subdirectory called styles, inside the current directory --> <link rel="stylesheet" href="styles/general/style.css"> <!-- go up one directory level, then inside a subdirectory called styles -...
CSS first steps - Learn web development
css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your
path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e. looking at it, consuming the content.) a basic work environment set up as ...
CSS FAQ - Learn web development
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> when at all possible, you should just use the html5 doctype. why doesn't my css, which is valid, render at all? here are some possible causes: you've got the
path to css file wrong. to be applied, a css stylesheet must be served with a text/css mime type. if the web server doesn't serve it with this type, it won't be applied. what is the difference between id and class? html elements can have an id and/or class attribute. the id attribute assigns a name to the element it is applied to, and for valid markup, there can be only one element with that name.
Styling links - Learn web development
on here? we'll skip over most of the css, as it's just the same information you've looked at before. the last rule however is interesting — here we are inserting a custom background image on external links in a similar manner to how we handled custom bullets on list items in the last article — this time however we are using background shorthand instead of the individual properties. we set the
path to the image we want to insert, specify no-repeat so we only get one copy inserted, and then specify the position as 100% of the way over to the right of the text content, and 0 pixels from the top. we also use background-size to specify the size we want the background image to be shown at — it is useful to have a larger icon and then resize it like this as needed for responsive web design pur...
Styling lists - Learn web development
to sit inside. if we didn't do this, the background images would overlap with the list item text, which would look messy. set the list-style-type to none, so that no bullet appears by default. we're going to use background properties to handle the bullets instead. inserted a bullet onto each unordered list item. the relevant properties are as follows: background-image: this references the
path to the image file you want to use as the bullet. background-position: this defines where in the background of the selected element the image will appear — in this case we are saying 0 0, which means the bullet will appear in the very top left of each list item. background-size: this sets the size of the background image. we ideally want the bullets to be the same size as the list items (o...
Learn to style HTML using CSS - Learn web development
modules, in a suggested order for working through them. you should definitely start with the first one. css first steps css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your
path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. css building blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. this module looks at the cascade and inhe...
How do you make sure your website works properly? - Learn web development
ss we wanted to type http://demozilla.examplehostingprovider.net/ but typed too fast and forgot an “l”: the address cannot be found. indeed. 404 errors many times the error just results just from a typo, but sometimes maybe you either forgot to upload a resource or you lost your network connection while you were uploading your resources. first check the spelling and accuracy of the file
path, and if there's still a problem, upload your files again. that will likely fix the problem. javascript errors someone (possibly you) added a script to the page and made a mistake. this will not prevent the page from loading but you will feel something went wrong. open the console (tools ➤ web developer ➤ web console) and reload the page: in this example, we learn (quite clearly) what th...
How do I start to design my website? - Learn web development
tical. musicians must master their instrument. but good musicians can never produce good music without an idea. therefore, before jumping into the technical side—for example, code and tools—you must first step back and decide in detail what you want to do. an hour's discussion with friends is a good start, but inadequate. you must sit down and structure your ideas to get a clear view of what
path you must take to make your ideas a reality. to do this, you need only pen and paper and some time to answer at least the following questions. note: there are countless ways to carry out project ideation. we cannot lay them all out here (a whole book wouldn't be enough). what we will present here is a simple method to handle what professionals call project ideation, project planning, and project...
How do you upload your files to a web server? - Learn web development
o. it is seen as a more advanced tool than sftp, beause by default it is used on the command line. a basic command looks like so: rsync [-options] source user@x.x.x.x:destination -options is a dash followed by a one or more letters, for example -v for verbose error messages, and -b to make backups. you can see the full list at the rsync man page (search for "options summary"). source is the
path to the local file or directory that you want to copy files over from. user@ is the credentials of the user on the remote server you want to copy files over to. x.x.x.x is the ip address of the remote server. destination is the
path to the location you want to copy your directory or files to on the remote server. you'd need to get such details from your hosting provider. for more information...
What are browser developer tools? - Learn web development
mes delete element). deletes the current element. edit as html (sometimes add attribute/edit text). lets you change the html and see the results on the fly. very useful for debugging and testing. :hover/:active/:focus. forces element states to be toggled on, so you can see what their styling would look like. copy/copy as html. copy the currently selected html. some browsers also have copy css
path and copy x
path available, to allow you to copy the css selector or x
path expression that would select the current html element. try editing some of your dom now. double-click an element, or right-click it and choose edit as html from the context menu. you can make any changes you'd like, but you cannot save your changes. exploring the css editor by default, the css editor displays the css rul...
Common questions - Learn web development
the html or css learning articles.) these articles are designed to work on their own. how the web works this section covers web mechanics —questions relating to general knowledge of the web ecosystem and how it works. how does the internet work? the internet is the backbone of the web, the technical infrastructure that makes the web possible. at its most basic, the internet is a massive network of computers communicating with each other. ...
Web forms — Working with user data - Learn web development
on helps us achieve these goals — this article tells you what you need to know. sending form data this article looks at what happens when a user submits a form — where does the data go, and how do we handle it when it gets there? we also look at some of the security concerns associated with sending form data. advanced articles the following articles aren't essential to the learning
pathway, but they'll prove interesting and useful when you've mastered the above techniques and want to know more. how to build custom form controls you'll come across some cases where the native form widgets just don't provide what you need, e.g. because of styling or functionality. in such cases, you may need to build your own form widget out of raw html. this article explains how you'd do this ...
JavaScript basics - Learn web development
other one. this is what happened. you stored a reference to your <img> element in the myimage variable. next, you made this variable's onclick event handler property equal to a function with no name (an "anonymous" function). so every time this element is clicked: the code retrieves the value of the image's src attribute. the code uses a conditional to check if the src value is equal to the
path of the original image: if it is, the code changes the src value to the
path of the second image, forcing the other image to be loaded inside the <img> element. if it isn't (meaning it must already have changed), the src value swaps back to the original image
path, to the original state. adding a personalized welcome message next, let's change the page title to a personalized welc...
Use JavaScript within a webpage - Learn web development
the <script> element. there are two ways to use script, depending on whether you're linking to an external script or embedding a script right in your webpage. linking an external script usually, you'll be writing scripts in their own .js files. if you want to execute a .js script from your webpage, just use <script> with an src attribute pointing to the script file, using its url: <script src="
path/to/my/script.js"></script> writing javascript within html you may also add javascript code between <script> tags rather than providing an src attribute. <script> window.addeventlistener('load', function () { console.log('this function is executed once the page is fully loaded'); }); </script> that's convenient when you just need a small bit of javascript, but if you keep javascript in separ...
What’s in the head? Metadata in HTML - Learn web development
pt to power interactive functionality, such as video players, maps, games, and more. these are most commonly applied to a web page using the <link> element and the <script> element, respectively. the <link> element should always go inside the head of your document. this takes two attributes, rel="stylesheet", which indicates that it is the document's stylesheet, and href, which contains the
path to the stylesheet file: <link rel="stylesheet" href="my-css-file.css"> the <script> element should also go into the head, and should include a src attribute containing the
path to the javascript you want to load, and defer, which basically instructs the browser to load the javascript at the same time as the page's html. this is useful as it makes sure that the html is all loaded before t...
Adding vector graphics to the Web - Learn web development
— raster images, and vector images: raster images are defined using a grid of pixels — a raster image file contains information showing exactly where each pixel is to be placed, and exactly what color it should be. popular web raster formats include bitmap (.bmp), png (.png), jpeg (.jpg), and gif (.gif.) vector images are defined using algorithms — a vector image file contains shape and
path definitions that the computer can use to work out what the image should look like when rendered on the screen. the svg format allows us to create powerful vector graphics for use on the web. to give you an idea of the difference between the two, let's look at an example. you can find this example live on our github repo as vector-versus-raster.html — it shows two seemingly identical images si...
Test your skills: HTML images - Learn web development
e interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. html images 1 in this task we want you to embed a simple image of some blueberries into the page. you need to: add the
path to the image to an appropriate attribute to embed it on the page. the image is called blueberries.jpg, and it is in a folder inside the current folder called images. add some alternative text to an appropriate attribute to describe the image, for people that cannot see it. give the <img> element an appropriate width and height so that it displays at the correct aspect ratio, and enough space is...
From object to iframe — other embedding technologies - Learn web development
ng the full screen api (somewhat beyond scope for this article.) frameborder if set to 1, this tells the browser to draw a border between this frame and other frames, which is the default behaviour. 0 removes the border. using this isn't really recommended any more, as the same effect can be better achieved using border: none; in your css. src this attribute, as with <video>/<img>, contains a
path pointing to the url of the document to be embedded. width and height these attributes specify the width and height you want the iframe to be. fallback content in the same way as other similar elements like <video>, you can include fallback content between the opening and closing <iframe></iframe> tags that will appear if the browser doesn't support the <iframe>. in this case, we have included...
Responsive images - Learn web development
e that contains a media condition — as with the first srcset example, these conditions are tests that decide which image is shown — the first one that returns true will be displayed. in this case, if the viewport width is 799px wide or less, the first <source> element's image will be displayed. if the viewport width is 800px or more, it'll be the second one. the srcset attributes contain the
path to the image to display. just as we saw with <img> above, <source> can take a srcset attribute with multiple images referenced, as well as a sizes attribute. so, you could offer multiple images via a <picture> element, but then also offer multiple resolutions of each one. realistically, you probably won't want to do this kind of thing very often. in all cases, you must provide an <img> element, ...
Video and audio content - Learn web development
<video> element the <video> element allows you to embed a video very easily. a really simple example looks like this: <video src="rabbit320.webm" controls> <p>your browser doesn't support html5 video. here is a <a href="rabbit320.webm">link to the video</a> instead.</p> </video> the features of note are: src in the same way as for the <img> element, the src (source) attribute contains a
path to the video you want to embed. it works in exactly the same way. controls users must be able to control video and audio playback (it's especially critical for people who have epilepsy.) you must either use the controls attribute to include the browser's own control interface, or build your interface using the appropriate javascript api. at a minimum, the interface must include a way to start a...
General asynchronous programming concepts - Learn web development
e. we block user interactivity with the rendering of the ui. in this example, we have two buttons: a "fill canvas" button that when clicked fills the available <canvas> with 1 million blue circles. a "click me for alert" button that when clicked shows an alert message. ...
Functions — reusable blocks of code - Learn web development
ed in your code, not inside the browser. anytime you saw a custom name with parentheses straight after it, you were using a custom function. in our random-canvas-circles.html example (see also the full source code) from our loops article, we included a custom draw() function that looked like this: function draw() { ctx.clearrect(0,0,width,height); for (let i = 0; i < 100; i++) { ctx.begin
path(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } this function draws 100 random circles inside a <canvas> element. every time we want to do that, we can just invoke the function with this: draw(); rather than having to write all that code out again every time we want to repeat it. and functions can contain...
Image gallery - Learn web development
et its src attribute to a placeholder value xxx, and append this new <img> element inside thumbbar. you need to: put the section of code below the "looping through images" comment inside a loop that loops through all 5 images — you just need to loop through five numbers, one representing each image. in each loop iteration, replace the xxx placeholder value with a string that will equal the
path to the image in each case. we are setting the value of the src attribute to this value in each case. bear in mind that in each case, the image is inside the images directory and its name is pic1.jpg, pic2.jpg, etc. adding an onclick handler to each thumbnail image in each loop iteration, you need to add an onclick handler to the current newimage — this handler should find the value of the sr...
Function return values - Learn web development
age of the calculation. using return values in your own functions to return a value from a custom function, you need to use the return keyword. we saw this in action recently in our random-canvas-circles.html example. our draw() function draws 100 random circles somewhere on an html <canvas>: function draw() { ctx.clearrect(0, 0, width, height); for (let i = 0; i < 100; i++) { ctx.begin
path(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } inside each loop iteration, three calls are made to the random() function, to generate a random value for the current circle's x-coordinate, y-coordinate, and radius, respectively. the random() function takes one parameter — a whole number — and it returns...
Fetching data from the server - Learn web development
fully by displaying a message on the user's screen and perhaps offering options to remedy the situation, but we don't need anything more than a simple console.log(). you can test the fail case yourself: make a local copy of the example files (download and unpack the can-store zip file). run the code through a web server (as described above, in serving your example from a server). modify the
path to the file being fetched, to something like 'produc.json' (make sure it is misspelled). now load the index file in your browser (via localhost:8000) and look in your browser developer console. you'll see a message similar to "network request for produc.json failed with response 404: file not found". the second fetch block can be found inside the fetchblob() function: fetch(url).then(function...
Introduction to web APIs - Learn web development
they use events to handle changes in state we already discussed events earlier on in the course in our introduction to events article, which looks in detail at what client-side web events are and h...
Adding features to our bouncing balls demo - Learn web development
n. you should then make the following changes: we want the evil circle to not be filled in, but rather just have an outer line (stroke). you can achieve this by updating fillstyle and fill() to strokestyle and stroke(). we also want to make the stroke a bit thicker, so you can see the evil circle a bit more easily. this can be achieved by setting a value for linewidth somewhere after the begin
path() call (3 will do). checkbounds() this method will do the same thing as the first part of ball()'s update() function — look to see whether the evil circle is going to go off the edge of the screen, and stop it from doing so. again, you can mostly just copy the ball.prototype.update definition, but there are a few changes you should make: get rid of the last two lines — we don't want to ...
Web performance - Learn web development
o user interaction. this is known as web performance, and in this module you'll focus on the fundamentals of how to create performant websites. the rest of our beginner's learning material tried to stick to web best practices such as performance and accessibility as much as possible, however, it is good to focus specifically on such topics too, and make sure you are familiar with them. learning
pathway while knowing html, css, and javascript is needed for implementing many web performance improvement recommendations, knowing how to build applications is not a necessary pre-condition for understanding and measuring web performance. we do however recommend that before you work through this module, you at least get a basic idea of web development by working through our getting started with the...
Learning area release notes - Learn web development
this page details significant changes made to the learning area. check back here if you want to know what new content is available, and what existing content has been improved. if you want to give feedback on any of these new additions, please leave comments in our discourse forum. june 2020 our front-end web developer learning
pathway is officially launched! check it out for an opinionated
pathway to follow for learning front-end development! also see our hacks post — introducing the mdn web docs front-end developer learning
pathway — for more information about the rationale behind it. may 2020 our understanding client-side javascript frameworks module is now available. learn why frameworks exist, when you should use one (and when you shouldn't), what kinds of features are common to...
Server-side website programming - Learn web development
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. in the modern world of web development, learning about server-side development is highly recommended. ...
Routing in Ember - Learn web development
lates (also found in the templates directory) we can for now just enter the todolist component invocation. in each case, replace {{outlet}} with <todolist /> so at this point, if you try the app again and visit any of the three routes localhost:4200 localhost:4200/active localhost:4200/completed you'll see exactly the same thing. at each url, the template that corresponds to the specific
path ("active", "completed", or "index"), will render the <todolist /> component. the location in the page where <todolist /> is rendered is determined by the {{ outlet }} inside the parent route, which in this case is application.hbs. so we have our routes in place. great! but now we need a way to differentiate between each of these routes, so that they show what they are supposed to show. first of...
Getting started with React - Learn web development
t from 'react'; import logo from './logo.svg'; import './app.css'; the first statement imports the react library itself. because react turns the jsx we write into react.createelement(), all react components must import the react module. if you skip this step, your application will produce an error. the second statement imports a logo from './logo.svg'. note the use of ./ at the beginning of the
path, and the .svg extension at the end — these tell us that the file is local and that it is not a javascript file. indeed, the logo.svg file lives in our source directory. we don't write a
path or extension when importing the react module — this is not a local file; instead, it is listed as a dependency in our package.json file. be careful of this distinction as you work through this lesson! t...
Working with Svelte stores - Learn web development
nds } } $: onmessagechange($alert, ms) // whenever the alert store or the ms props changes run onmessagechange ondestroy(()=> cleartimeout(timeout)) // make sure we clean-up the timeout </script> and update the alert.svelte markup section like so: {#if visible} <div on:click={() => visible = false}> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 20 20"><
path d="m12.432 0c1.34 0 2.01.912 2.01 1.957 0 1.305-1.164 2.512-2.679 2.512-1.269 0-2.009-.75-1.974-1.99c9.789 1.436 10.67 0 12.432 0zm8.309 20c-1.058 0-1.833-.652-1.093-3.524l1.214-5.092c.211-.814.246-1.141 0-1.141-.317 0-1.689.562-2.502 1.117l-.528-.88c2.572-2.186 5.531-3.467 6.801-3.467 1.057 0 1.233 1.273.705 3.23l-1.391 5.352c-.246.945-.141 1.271.106 1.271.317 0 1.357-.392 2.379-1.207l.6.814c12.
Styling Vue components with CSS - Learn web development
enter; } [class*="__lg"] { display: inline-block; width: 100%; font-size: 1.9rem; } [class*="__lg"]:not(:last-child) { margin-bottom: 1rem; } @media screen and (min-width: 620px) { [class*="__lg"] { font-size: 2.4rem; } } .visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); clip-
path: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [class*="stack"] > * { margin-top: 0; margin-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small > * + * { margin-top: 1.4rem; } .stack-large > * + * { margin-top: 2.8rem; } } /* end global styles */ #app { background...
Introduction to cross browser testing - Learn web development
t, payment workflow, etc. you might then further subdivide these — implement common site header and footer, implement product page detail view, implement persistent shopping cart widget, etc. there are multiple general strategies to cross browser development, for example: get all the functionality working as closely as possible in all target browsers. this may involve writing different code
paths that reproduce functionality in different ways aimed at different browsers, or using a polyfill to mimic any missing support using javascript or other technologies, or using a library that allows you to write a single bit of code and then does different things in the background depending on what the browser supports. accept that some things aren't going to work the same on all browsers, and pro...
Handling common JavaScript problems - Learn web development
he loading has finished. loadscript() looks like this: function loadscript(src, done) { const js = document.createelement('script'); js.src = src; js.onload = function() { done(); }; js.onerror = function() { done(new error('failed to load script ' + src)); }; document.head.appendchild(js); } this function creates a new <script> element, then sets its src attribute to the
path we specified as the first argument ('polyfills.js' when we called it in the code above). when it has loaded, we run the function we specified as the second argument (main()). if an error occurs in the loading of the script, we still call the function, but with a custom error that we can retrieve to help debug a problem if it occurs. note that polyfills.js is basically the two polyfills we are us...
Git and GitHub - Learn web development
dge, you don't need to know anything about web development, git/github or vcses to start this module. however, it is recommended that you know some coding so that you have reasonable computer literacy, and some code to store in your repositories! it is also preferrable that you have some basic terminal knowledge, so for example moving between directories, creating files, and modifying the system
path. note: github is not the only site/toolset you can use with git. there are other alternatives such as gitlab that you could try, and you could also try setting your own git server up and using it instead of github. we've only stuck with github in this course to provide a single way that works. guides note that the links below take you to resources on external sites. eventually we will are ai...
Deploying our app - Learn web development
github. to add changes, run the following command: git add . note the period at the end, it means “everything in this directory”. the git add . command is a bit of a sledgehammer approach — it will add all local changes you’ve worked on in one go. if you want finer control over what you add, then use git add -p for an interactive process, or add individual files using git add
path/to/file. now all the code is staged, we can commit; run the following command: git commit -m ’committing initial code’ note: although you're free to write whatever you wish in the commit message, there's some useful tips around the web on good commit messages. keep them short, concise, and descriptive, so they clearly describe what the change does. finally the code n...
omni.ja (formerly omni.jar)
omni.ja is also incompatible with zip files in the other direction; editing extracted files won't affect firefox, and repacking edited files may break firefox if you do not use the right options when packing the extracted files. the correct command to pack omni.ja is: zip -0dxqr omni.ja * the working directory must be at the root directory of the files from the omni.ja file. zip -0dxqr omni.ja
path/to/omni/* will not work. note: prior to firefox 10 and thunderbird 10, omni.ja was called omni.jar. omni.ja contents the omni.ja file contains assorted application resources: chrome.manifest the chrome manifest file. /chrome/ user interface files for the application /chrome/localized.manifest manifest of localized content; referenced by the main chrome manifest file. /chrome/nonlocali...
Gecko info for Windows accessibility vendors
whether, we will support svg accessibility until a better implementation comes along. firefox 1.5 supports svg. potentially it can make use of the same namespaced role and state attributes as dhtml accessibility, but it may require more powerful author-definable relationships. xforms: xforms is the future of online forms as envisioned by the w3c. drawing on other w3c standards like xml schema, x
path, and xml events, xforms tries to address some of the limitations with the current html forms model. one of the key features of xforms is accessibility. xul: the xml-based language used by firefox and mozilla to develop the ui. similar to html in that it can be combined with css and javascript to make powerful applications. contains more desktop-style widgets than html and follows a box layout m...
Adding a new event
if you're creating simple dom event class, it might be generated automatically. if it's possible, you just need to add an entry to generated_events_webidl_files in dom/webidl/moz.build. define and create dom event class manually otherwise, you need to implement a dom event class yourself. the best place to create fooevent.h and fooevent.cpp is in dom/events/. otherwise, you need to specify the
path to the header file in dom/bindings/bindings.conf. when you create a dom event class, its name should be same as the name defined in its standard specification. and it should be in mozilla::dom namespace. for example, keyboardevent which is defined in dom level 3 events should be implemented as mozilla::dom::keyboardevent. and the header file should be exported as "mozilla/dom/fooevent.h". add t...
Creating a Language Pack
date. please consult the documentation on localized builds on firefox-source-docs. to create a language pack, or a localization repack, you first need to go through the initial setup process. pre-build steps in the .mozconfig, you want to have mk_add_options moz_objdir=@topsrcdir@/obj-firefox-build ac_add_options --disable-compile-environment ac_add_options --with-l10n-base=../l10n-central #
path relative to moz_objdir ac_add_options --enable-application=[browser or mail] the given
path should have your localization directory as child (i.e., a subdirectory ab-cd where ab-cd is your locale code). you still need to specify which application you're localizing (e.g., for firefox, that's browser, thunderbird would be mail). configure step you need to prepare the build directory, which is ...
Debugging Frame Reflow
. element width maximum width frame status overflow area getting the log make sure that your build is a debug build (in short you need ac_add_options --enable-debug in your .mozconfig file). create a text file (for instance reflow_rules.txt). enter this line in the text file * 1 this should look like: point the gecko_display_reflow_rules_file environment variable to the
path of the reflow_rules.txt file. run the debug build, saving stdout to a file. on mac this is accomplished with: $ env dyld_library_
path="`pwd`/obj-ff-dbg/dist/nightlydebug.app/contents/macos" \ ./obj-ff-dbg/dist/nightlydebug.app/contents/macos/firefox-bin > logfile.txt after loading your testcase, the log file will contain the promised information. log ...
Debugging JavaScript
de. to enable it, go to about:config in the url bar and set devtools.chrome.enabled to true, or set the "enable chrome and add-on debugging" option in the developer tool settings. activate it through with the menu tools > web developer > browser console. you can also start the browser console when you launch firefox, by launching firefox from the command line and passing --jsconsole as a flag: /
path/to/firefox --jsconsole log to the browser console using the standard console api after importing console.jsm: let console = (cu.import("resource://gre/modules/console.jsm", {})).console; console.log("hello from firefox code"); error console this is obsolete and is no longer enabled in firefox by default. use the web console or the browser console instead. browser debugger (built-in) on fire...
Debugging on Windows
/422970/hang-loading-rasapi32-pdb-when-using-symbol-server. there are two ways to work around this problem: turn off automatic symbol downloading for system libraries: in tools > options > debugging > symbols, uncheck the microsoft symbol server. pre-load all the windows debug symbols. these instructions apply to visual studio 10 on windows 7; other software versions likely need to have file
paths adjusted. locate the microsoft utility "symchk.exe" on your system (it will likely be in the installation directory of your windows debugging tools). find the directory where visual studio caches downloaded symbols; in vc++ 10 open the menu to tools > options > debugging > symbols and copy the field "cache symbols in this directory". in a command window, run symchk.exe /r c:\win...
Makefiles - Best practices and suggestions
laundry list makefiles should remove all content that it will generate. prefer library rules whenever possible or create library rules that are missing. dependency builds - a second invocation of make within a sandbox should always be a nop. hardcoded values - avoid them like the plague. use variable assignments, autogen
paths and dynamic file gathering. platform specific - avoid this logic whenever possible. code as little platform specific logic within a makefile as possible, a conditional and compiler flags at most should be needed. for ex use defines within sources to shift platform logic into your source code. if a unit test is platform specific write your makefile so it can be used on all platforms but only do w...
Updating NSPR or NSS in mozilla-central
ew the output to make sure it looks correct update the minimum required system nss version in old-configure.in. this is for builds with --with-system-nss. for example, in the following, "3.16.1" would be replaced with the new nss version. moz_arg_with_bool(system-nss, [ --with-system-nss use system installed nss], _use_system_nss=1 ) if test -n "$_use_system_nss"; then am_
path_nss(3.16.1, [moz_native_nss=1], [ac_msg_error([you don't have nss installed or your version is too old])]) fi commit the update: $ hg commit -a in order to eliminate any problems related to how nss and nspr are built differently in firefox than they are standalone, you should push your commit to try first. if your update fails linking because of missing nss or nspr symbols, add the miss...
Windows SDK versions
a 64 bit version of windows you may require the "amd" version of the sdk even if you have an intel processor, and you may need to deselect the documentation component in the installer in order to avoid an installation error. (this was certainly the case for 64 bit windows 7 on a late 2008 macbook pro.) warning: due to a bug in windows 7 sdk, if you get "sdksetup encountered an error: expecting
path %systemroot% to represent a valid system volume" error you may require to set environmental variable %windir% to something like "c:\windows" instead of "%systemroot%". older sdks these are no longer supported, further information is available at obsolete build caveats and tips [en-us] under the windows sdk article. troubleshooting help! i know i have the correct sdk, but configure.in's still fail...
Limitations of chrome scripts
ent; var browsermm = topframeelement.messagemanager; console.log("browsermm: " + browsermm); } } however, before firefox 38, this technique will not work if multiprocess firefox is disabled: specifically, topframeelement will be null. this means that if you need to write code that works before firefox 38 and on both multiprocess and non-multiprocess variants, you need to implement both
paths: test whether topframeelement is null if it is, you're running in single-process firefox, and should use the old way if it isn't, you're running in multiprocess firefox and should use the new way from firefox 38 onwards, the topframeelement approach always works. dom events without the shim in multiprocess firefox, if you want to register an event listener on some content dom node, tha...
Performance best practices for Firefox front-end engineers
our panels if you’re adding a new xul <xul:popup> or <xul:panel> to a document, set the hidden attribute to true by default. by doing so, you cause the binding applied on demand rather than at load time, which makes initial construction of the xul document faster. get familiar with the pipeline that gets pixels to the screen learn how pixels you draw make their way to the screen. knowing the
path they will take through the various layers of the browser engine will help you optimize your code to avoid pitfalls. the rendering process goes through the following steps: the above image is used under creative commons attribution 3.0, courtesy of this page from our friends at google, which itself is well worth the read. for a very down-to-earth explanation of the style, layout, paint and c...
mozbrowsericonchange
ing the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: href a domstring representing the
path to the new icon. sizes a domstring listing the sizes the new icon is available in, e.g. "16x16" or "16x16 32x32". the any keyword can also be used, to represent "any size." rel a domstring representing the rel attribute value from the <link> element used to link to the icon. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsericonchange", function(...
ChromeWorker
vailabe on github and are linked to from the see also section below. to use a postmessage with callback version of chromeworker that features promises, see promiseworker. addons must use absolute urls to load their workers, and those urls have to be using a chrome:// or resource:// protocol (file:// is not accepted). addons that wish to use file:// urls must first register a resource replacement
path, using code like this: var fileuri = services.io.newfileuri(file); services.io.getprotocolhandler('resource'). queryinterface(ci.nsiresprotocolhandler). setsubstitution('my-cool-addon', fileuri); var worker = new worker('resource://my-cool-addon/worker.js'); more references: you can use chromeworker from javascript code modules. see using workers in javascript c...
Embedding Tips
ion. your own implementation should pose this dialog, or fill in the values that are needed for the upload to succeed. how do i know when saving is done, monitor progress etc.? register your ownnsiwebprogresslistener object to listen for progress and state notifications. here is a simple example which demonstrates the principle. the simplepersist() function takes a string url and a string file
path. in response it creates a persist object, creates a listener and starts the operation. as the operation progresses, methods on the listener such as onstatechange, onprogresschange etc. are called, allowing the embedder to know what is happening. when the operation is completed, the onstatechange will be notified by a combination of state_stop | state_is_network state flags. you may also use the ...
Roll your own browser: An embedding how-to
must be done to start up event queues and load some string bundles. 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. just link this library to your application. there are two functions that are needed: nsresult ns_initembedding(const char *a
path); nsresult ns_termembedding(); pretty self-explanatory. the a
path parameter will be passed to ns_initxpcom. ns_initembedding() must be called from the main thread of your application, otherwise it won't work. do you have any simple examples of embedding mozilla? there are many examples of products already using gecko for embedding. here's a partial list. the sections marked 'mozilla examples'...
Geckoview-Junit Tests
han one test: mozilla-central$ mach geckoview-junit <class1>#<test1> <class2>#<test2> mach geckoview-junit also supports running a list of tests that are specified in a text file. each test must be listed on its own line. for example: <class1>#<test1> <class2> <class3>#<test2> <class3>#<test3> to run the tests specified in the file: mozilla-central$ mach geckoview-junit --test-filters-file <
path-to-filter-file> disabling one failing test there is no manifest listing the geckoview junit tests. to disable a single test, edit the source code and insert junit's @ignore annotation before the existing @test annotation. for example: import org.junit.ignore ... @runwith(testrunner.class) public class testsomethings { @ignore @test public void testsomething() { ... tests can ...
How to add a build-time test
, to add an xpcshell test to a module, do the following: copy tools/test-harness/xpcshell-simple/example to yourmoduledir/tests_type, wheretests_type is something that describes your tests. you can of course use unit or test if you're not feeling creative. in <tt>yourmoduledir/tests_type/makefile.in</tt> change depth, module, and xpcshell_tests appropriately: depth should be a relative
path pointing to <tt>mozilla/</tt>, e.g. if you're in <tt>netwerk/test</tt>, set depth = ../.. module should be defined to test_yourmodule or just yourmodule -- either will work fine. xpcshell_tests be a list of subdirectories of the current directory which contain xpcshell tests. you can of course just use the onetests_type directory here, but if you want to subdivide your tests by functionalit...
How to get a stacktrace with WinDbg
file on a bug or via the support site, even if nothing seems to happen during the debug process start debugging now that firefox is opened in the debugger, you need to configure your windbg to download symbols from the mozilla symbol server. to load the symbols, enter the three commands below, pressing enter after each one. (more details are available at using the mozilla symbol server.) .sym
path srv*c:\symbols*http://symbols.mozilla.org/firefox;srv*c:\symbols*http://msdl.microsoft.com/download/symbols .symfix+ c:\symbols .reload /f now wait for the symbols to download. this may take some time depending on your connection speed; the total size of the mozilla and microsoft symbols download is around 1.4gb. windbg will show "busy" at the bottom of the application window until the download...
How to implement a custom autocomplete search component
rl history (firefox: 1.0+; seamonkey: 1.1+) form-history: search the values that the user has entered into form fields. (firefox: 1.0+; seamonkey: 2.0+) file: search file names (firefox: 2.0+; thunderbird: 2.0+; seamonkey: 1.1+; gtk builds only). the component uses the autocompletesearchparam attribute or searchparam property to allow the developer to define the default directory otherwise only
paths beginning with / or ~/ will be autocompleted. building your custom autocomplete search components sometimes, you may want to build your own autocomplete source. to do so you need the following: create an xpcom component that implements the nsiautocompletesearch interface. make sure the contract id of your xpcom component follows the following form: "@mozilla.org/autocomplete/search;1?name=xx...
Introduction to Layout in Mozilla
l reflow recursively descend to target recovering reflow state child rs.reason set to incremental incremental reflow process reflow “normally” at target frame child rs.reason set based on rc’s type incremental reflow propagate damage to frames later “in the flow” incremental reflow multiple reflow commands are batched nsreflow
path maintains a tree of target frames amortize state recovery and damage propagation cost painting as reflow proceeds through the frame hierarchy, areas are invalidated via nsiviewmanager::updateview unless immediate, invalid areas are coalesced and processed asynchronously via os expose event native expose event dispatched to widget; widget delegates to the view manager view man...
Code Samples
u need to determine the directory in which your add-on is installed, code like the following will do the trick. simply replace yourextensionid with your add-on's id. ...
DownloadTarget
operties attribute type description exists read only boolean indicates whether or not the target file exists. this is a dynamic property, which is updated when the download is completed or when the download.refresh() method is called. you can use this instead of using file system calls to check for the existence of the file in order to reduce io overhead.
path read only string the
path of the target file. partfile
path read only string the
path of the ".part" file containing the data downloaded so far, or null to disable the use of a ".part" file to keep partially downloaded data. size read only number the size of the target file, in bytes, or zero if the download has not yet been completed. it is possib...
Promise.jsm
didn't conform to the promises/a+ proposal until gecko 25: components.utils.import("resource://gre/modules/commonjs/promise/core.js"); // gecko 17 to 20 components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js"); // gecko 21 to 24 this implementation also includes helper functions that are specific to the add-on sdk. while you may still import this module from the above
paths, the recommended way for loading it is through the add-on sdk loader. introduction for an introduction to promises, you may start from the add-on sdk documentation, keeping in mind that only the core subset is implemented in this module. a promise is an object representing a value that may not be available yet. internally, a promise can be in one of three states: pending, when the final v...
JavaScript code modules
iles. ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an xpcom component. customizableui.jsm allows you to interact with customizable buttons and items in firefox's main window ui. deferredtask.jsm run a task after a delay. dict.jsm provides an api for key/value pair dictionaries. downloadlastdir.jsm supplies the
path to the directory into which the last download occurred. downloads.jsm provides a single entry point to interact with the downloading capabilities of the platform. fileutils.jsm provides helpers for dealing with files. geometry.jsm provides routines for performing basic geometric operations on points and rectangles. http.jsm a wrapper for xmlhttprequest that provides convenient and simplif...
Localizing with Koala
> new project from template... choose "koala" in the categories list. choose "koala" in the templates list. choose a name for your project (e.g. l10n.kpf). choose the directory in which the project will live in (e.g. c:\mozilla\l10n on windows, /home/user/mozilla/l10n on linux or /users/user/mozilla/l10n on mac os x). due to a bug in koala (bug 21930), it is recommended that you don't choose a
path that contains spaces (like c:\documents and settings\user\...). click "open" to create the project. koala will check for mercurial. make sure that your mercurial installation is in your system's $
path. setup wizard will open. configure the application choose "firefox" as the application. version: 3.6. appname: browser. included locale: en-us (this is the original locale you're translating ...
Localizing with Mozilla Translator
if you are using a filesystem with symbolic links support (i.e., linux or mac), you can create symbolic links in a separate directory so it contains just the locale part. thanks to alexandru szasz, from narro, [http://groups.google.com/group/mozil...bbffa5402ec819 for this inspiration]. see this example for browser. for the last two options, you should be able to adjust your current mt product
paths so you can keep using it just like with cvs. keep in mind that mt doesn't really know if you are using cvs, svn, or mercurial. it is just instructed to read directory subtrees and ignore "cvs" and ".svn" directories it finds. if you have opted for the first solution, you will find yourself with some new products completely untranslated (once you update each of them). to migrate the existing tra...
Release phase
unt name: host hg.mozilla.org user user@host.domain if you have already cloned the remote repository using the http protocol using this command: $ hg clone http://hg.mozilla.org/releases/l10n-central/x-testing then you will need to edit the .hg/hgrc file (inside the x-testing local clone) to tell mercurial to push using ssh. ...
SVN for Localizers
through a secure connection. open the files you want to translate with your favorite text editor. translate the content in those files, save them and check for differences by entering this command from the command-line: svn diff this command produces output with every change made to each file. it's a bit hard to read, but you can also create a diff file (aka a diff patch) use svn diff > /
path/to/output/file.diff to save the output to a file. note that
path/to/output is meant to indicate the directory on your computer where you wish to store the diff file. you can also run svn status to check the list of modified files (they'll display a m before the name) you're about to commit. once you're satisfied with changes, commit them to the appropriate mozilla svn repository by entering...
Writing localizable code
processing into the content code and reference different key-value pairs in l10n. use a good source directory structure be sure to put the localizable files in the right place. the addition of new top-level directories is a compromise between module ownership in the cvsroot repository and the ease of localization. use a good chrome directory structure for a particular module mod, a target
path jar:ab-cd.jar!/locale/ab-cd/mod/foo.dtd has been widely tested and is a good place for your files referenced as chrome://mod/locale/foo.dtd. using a directory structure like this eases the localization process without the source code and is especcially recommended to extension authors. jar manifests can make this easy. l10n impact on frozen trees, there is the rule to not check in l10n-impact ch...
Mozilla Framework Based on Templates (MFBT)
it is fairly new, so its functionality is currently sparse. feel free to file bugs to add new functionality to it, or to move existing functionality into it, as needed. ...
Fonts for Mozilla 2.0's MathML engine
test.xpi -o mathml-fonts.zip; \ unzip mathml-fonts.zip -d mathml-fonts then copy the mathml-fonts/resource/ directory somewhere on your web site and ensure that the woff files are served with the correct mime type. finally, include the mathml-fonts/resource/mathml.css style sheet in your web pages, for example by adding the following rule to the default style sheet of your web site: @import url('/
path/to/resource/mathml.css'); browsers have default font-families in their user agent stylesheets. if necessary, you might want to modify the font-family on the <math> elements and, for gecko, the on ::-moz-math-stretchy pseudo element too. for example to force the use of stix fonts: math { font-family: stixgeneral; } ::-moz-math-stretchy { font-family: stixnonunicode, stixsizeonesym, stixsize1,...
Mozilla DOM Hacking Guide
and class prototypes. finally it sets sisinitialized to true. the actions that concern the dom are described below. first, the call to callgetservice() initializes sxpconnect. then the script security manager (ssecman) is initialized. getsafejscontext() grabs us a cool js context to run our javascript code in. the part about componentregistrar is designed to allow external modules (in this case x
path) to be included in domclassinfo and as such benefit from the javascript benefits it provides. after that, we fill the blanks in the sclassinfodata array. if you remember the discussion in the introduction to class info, there is the main array, sclassinfodata, filled with objects of type nsdomclassinfodata. however when the array is created, three data members of the structure are left as null p...
Mozilla Port Blocking
37 time 42 name 43 nicname 53 domain 77 priv-rjs 79 finger 87 ttylink 95 supdup 101 hostriame 102 iso-tsap 103 gppitnp 104 acr-nema 109 pop2 110 pop3 111 sunrpc 113 auth 115 sftp 117 uucp-
path 119 nntp 123 ntp 135 loc-srv / epmap 139 netbios 143 imap2 179 bgp 389 ldap 465 smtp+ssl 512 print / exec 513 login 514 shell 515 printer 526 tempo 530 courier 531 chat 532 netnews 540 uucp ...
Investigating leaks using DMD heap scan mode
ogs the next step is to generate a number of log files. you need to get a shutdown cc log and a dmd log, for a single run. definitions i'll write $objdir for the object directory for your firefox dmd build, $srcdir for the top level of the firefox source directory, and $heapgraph for the location of the heapgraph repo, and $logdir for the location you want logs to go to. $logdir should end in a
path separator. for instance, ~/logs/leak/. the command you need to run firefox will look something like this: xpcom_mem_bloat_log=1 moz_cc_log_shutdown=1 moz_disable_content_sandbox=t moz_cc_log_directory=$logdir moz_cc_log_process=content moz_cc_log_thread=main moz_dmd_shutdown_log=$logdir moz_dmd_log_process=tab ./mach run --dmd --mode=scan breaking this down: xpcom_mem_bloat_log=1: this repo...
Memory reporting
sly used in about:memory and telemetry. this document describes things that you should know when writing a memory reporter. memory reporters a memory reporter makes one or more memory measurements (a.k.a. reports). each reporter implements a collectreports function which takes a nsimemoryreportercallback argument; for each measurement the reporter must pass in several values, including: a
path (which identifies the report); an amount (the most important thing); a unit (most commonly bytes, but sometimes a unitless count or percentage); a description of what is measured. see the nsimemoryreporter documentation and nsimemoryreporter.idl for full details. making measurements nsimemoryreporter provides the high-level interface for a memory reporter, but the heart of a memory reporte...
Profiling with the Gecko Profiler and Local Symbols on Windows
./mach build. generate the breakpad symbol files by running ./mach buildsymbols: https://developer.mozilla.org/en/building_firefox_with_debug_symbols#breakpad_symbol_files this will have created symbols under $objdir/dist/ , named after the binary name, architecture and version, so something like "firefox-40.0a1.en-us-win32.crashreporter-symbols.zip" point talos to this zipfile by passing its
path to the --symbols
path flag. ...
browser.dom.window.dump.file
ied in this preference if browser.dom.window.dump.enabled is set to true. changes require an application restart. type:string default value:none exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-03-18 introduction: pushed to nightly on 2009-04-24 bugs: bug 489938 values the value holds the file system
path for the file in which the content of the window.dump() calls get written, e.g. c:\dump.txt . it will be created if it doesn't exist yet. the line breaks have to be in the argument of the dump function, else successive dump calls will get logged into the same line. related browser.dom.window.dump.enabled ...
Patches and pushes
's short for nit-picky requests), fix those before committing. also, no new patch attachment will be needed. commit the patch to your aurora repo. only commit the changes you have reviewed. use a commit message that mentions the bug number, describes the change, and mentions the reviewer. for example: hg ci -m "bug 654321, copied the comment from the doc without reading, r=nobody"
path-to-changed-files close the bug, copying the url to your change in the closing comment. write up something like this for your comment: landed this on aurora, http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-cd/rev/adfe1234feac, marking fixed. update your sign-offs on the l10n dashboard to include the change into the next release. and that's it! it can be considered a bit complicated ...
Research and prep
g as your informed recommendations. if there's no existing collaboration with the site provider and mozilla, ask for permission from the site provider to include it. ensure that your suggestions follow these parameters: search there are typically five search plug-ins listed for firefox desktop (only four for firefox mobile): generic search the default option should expose the quickest
path to the best result on the world wide web for the user (indexing a large portion of the global www). global search the second position can be used for the next best local language provider, meaning coverage within the local language and/or locale (indexing a smaller portion of the www but producing better local language results). local search a good test is if you were to run a set...
Debugging out-of-memory problems
ly. firefox android on firefox android, an about:memory dump may be triggered from a connect desktop machine with the command: adb shell am broadcast -a org.mozilla.gecko.memory_dump the location of the dump file will be printed to the android log (viewed with adb logcat | grep geckoconsole) and can be retrieved via adb pull. note: replace "/storage/emulated/0/download/" in the reported file
path with the device's download
path (e.g. "/sdcard/download/") when calling adb pull. ...
About NSPR
nnels as non-blocking in the traditional sense. network addresses part of nspr deals with manipulation of network addresses. nspr defines a network address object that is internet protocol (ip) centric. while the object is not declared as opaque, the api provides methods that allow and encourage clients to treat the addresses as polymorphic items. the goal in this area is to provide a migration
path between ipv4 and ipv6. to that end it is possible to perform translations of ascii strings (dns names) into nspr's network address structures, with no regard to whether the addressing technology is ipv4 or ipv6. time timing facilities are available in two forms: interval timing and calendar functions. interval timers are based on a free running, 32-bit, platform dependent resolution timer. suc...
NSPR build instructions
library by default. to generate a debug build that uses the debug c run-time library, specify the --enable-debug-rtl configure option. makefile targets all (default) clean realclean distclean install release running the test programs the tests were built above, in the pr/tests directory. on mac os x, they can be executed with the following: /bin/sh: $ cd pr/tests $ dyld_library_
path=../../dist/lib ./accept pass $ $ # to run all the nspr tests... $ $ dyld_library_
path=../../dist/lib ../../../nspr/pr/tests/runtests.sh ../.. ...
PR_Access
how specifies which access permission to check for. use one of the following values: pr_access_read_ok. test for read permission. pr_access_write_ok. test for write permission. ...
PR_Delete
syntax #include <prio.h> prstatus pr_delete(const char *name); parameters the function has the following parameter: name the
pathname of the file to be deleted. returns one of the following values: if file is deleted successfully, pr_success. if the file is not deleted, pr_failure. description pr_delete deletes a file with the specified
pathname name. if the function fails, the error code can then be retrieved via pr_geterror. ...
PR_FreeLibraryName
syntax #include <prlink.h> void pr_freelibraryname(char *mem); parameters the function has this parameter: mem a reference to a character array that was previously allocated by the dynamic library runtime. returns nothing. description this function deletes the storage allocated by the runtime in the functions described previously. ...
PR_GetFileInfo
gets information about a file with a specified
pathname. file size is expressed as a 32-bit integer. syntax #include <prio.h> prstatus pr_getfileinfo( const char *fn, prfileinfo *info); parameters the function has the following parameters: fn the
pathname of the file to get information about. info a pointer to a file information object (see prfileinfo). on output, pr_getfileinfo writes information about the given file to the file information object. returns one of the following values: if the file information is successfully obtained, pr_success. if the file information is not successfully obtained, pr_failure. description pr_getfileinfo stores information about the file with the specified
pathname in the prfileinfo structure pointed to by info. the file size is retu...
PR_GetFileInfo64
gets information about a file with a specified
pathname. file size is expressed as a 64-bit integer. syntax #include <prio.h> prstatus pr_getfileinfo64( const char *fn, prfileinfo64 *info); parameters the function has the following parameters: fn the
pathname of the file to get information about. info a pointer to a 64-bit file information object (see prfileinfo64). on output, pr_getfileinfo64 writes information about the given file to the file information object. returns one of the following values: if the file information is successfully obtained, pr_success. if the file information is not successfully obtained, pr_failure. description pr_getfileinfo64 stores information about the file with the specified
pathname in the prfileinfo64 structure pointed to by info. th...
PR_OpenDir
opens the directory with the specified
pathname. syntax #include <prio.h> prdir* pr_opendir(const char *name); parameter the function has the following parameter: name the
pathname of the directory to be opened. returns if the directory is successfully opened, a prdir object is dynamically allocated and the function returns a pointer to it. if the directory cannot be opened, the function returns null. description pr_opendir opens the directory specified by the
pathname name and returns a pointer to a directory stream (a prdir object) that can be passed to subsequent pr_readdir calls to get the directory entries (files and subdirectories) in the directory. the prdir pointer should eventually be closed by a call to pr_closedir. ...
PR_RmDir
removes a directory with a specified name. syntax #include <prio.h> prstatus pr_rmdir(const char *name); parameter the function has the following parameter: name the name of the directory to be removed. returns if successful, pr_success. if unsuccessful, pr_failure. the actual reason can be retrieved via pr_geterror. description pr_rmdir removes the directory specified by the
pathname name. the directory must be empty. if the directory is not empty, pr_rmdir fails and pr_geterror returns the error code pr_directory_not_empty_error. see also pr_mkdir ...
An overview of NSS Internals
iod; however, it works only in a limited amount of more advanced scenarios. unfortunately, the world of certificates has become more complex in the recent past. new certificate authorities enter the global pki market, and in order to get started with their business, they might make deals with established cas and receive so-called cross-signing-certificates. as a result, when searching for a trust
path from (a) to a trusted anchor (root) certificate (z), the set of candidate issuer certificates might have different issuer names (referring to the second or higher issuer level). as a consequence, it will be necessary to try multiple different alternative routes while searching for (z), in a recursive manner. only the newer verification engine (internally named libpkix) is capable of doing that pr...
Building NSS
m library that builds on many different platforms and has many options, it may be complex to build. please read these instructions carefully before attempting to build. build environment nss needs a c and c++ compiler. it has minimal dependencies, including only standard c and c++ libraries, plus zlib. for building, you also need make. ideally, also install gyp and ninja and put them on your
path. this is recommended, as the build is faster and more reliable. windows nss compilation on windows uses the same shared build system as mozilla firefox. you must first install the windows prerequisites, including mozillabuild. you can also build nss on the windows subsystem for linux, but the resulting binaries aren't usable by other windows applications. get the source nss and nspr use mer...
Cryptography functions
t mxr 3.2 and later pk11_paramfromiv mxr 3.2 and later pk11_paramfromalgid mxr 3.2 and later pk11_paramtoalgid mxr 3.2 and later pk11_pbekeygen mxr 3.2 and later pk11_privdecryptpkcs1 mxr 3.9.3 and later pk11_protectedauthentication
path mxr 3.4 and later pk11_pubdecryptraw mxr 3.2 and later pk11_pubderive mxr 3.2 and later pk11_pubderivewithkdf mxr 3.9 and later pk11_pubencryptpkcs1 mxr 3.9.3 and later pk11_pubencryptraw mxr 3.2 and later pk11_pubunwrapsymkey ...
Encrypt Decrypt MAC Keys As Session Objects
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, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-2...
Encrypt and decrypt MAC using token
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, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-2...
Build instructions for JSS 4.3.x
ppropriate directory and check out jss from the root of your source tree. cvs co -r jss_4_3_1_rtm mozilla/security/jss or cvs co -r jss_4_3_rtm mozilla/security/jss setup environment variables needed for compiling java source. the java_home variable indicates the directory containing your java sdk installation. note, on windows platforms it is best to have java_home set to a directory
path that doest not have spaces. unix setenv java_home /usr/local/jdk1.5.0 (or wherever your jdk is installed) windows set java_home=c:\programs\jdk1.5.0 (or wherever your jdk is installed) windows (cygnus) java_home=/cygdrive/c/programs/jdk1.5.0 (or wherever your jdk is installed) export java_home windows build configurations winnt vs win95 as of nss 3.15.4, nsp...
NSS_3.11.10_release_notes.html
get the nspr 4.7.1 header files and shared libraries, which nss 3.11.10 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. bugs fixed the following bugs have been fixed in nss 3.11.10. bug 291384: certutil -k behavior doesn't match usage bug 374247: modutil -disable command not disabling modules' slots bug 384459: certification
path validation fails when authority key identifier extension contains key identifier bug 385946: can't import certificate into cert database in fips mode (certutil). bug 387892: add entrust root ca certificate(s) to nss bug 396999: pk11_authenticate bug 397478: lock from ssl_initsymwrapkeyslock not freed on selfserv shutdown. bug 397486: session cache locks not freed on strsclnt shutdown. ...
NSS_3.12.1_release_notes.html
not produced by cert_pkixverifycert bug 430743: update ssltap to understand the tls session ticket extension bug 430859: pkix: policy mapping fails verification with error invalid arguments bug 430875: document the policy for the order of cipher suites in ssl_implementedciphers. ...
NSS_3.12.2_release_notes.html
ertpackage does not set nspr error code upon error bug 457980: hundreds of kilobytes of useless strings in libpkix bug 457984: enable pkcs11 module logging in optimized builds bug 458905: memory leaks in pkix bridge certificates. bug 459231: memory leak in cert fetching - aia extension. bug 459248: support intel aes extensions. bug 459359: forwardbuilderstate object is leaked when aia
path incorrect bug 459481: nss build problem with gcc 3.4.6 on os/2 documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation. new and revised documents available since the release of nss 3.11 include the following: build instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.2 shared libraries are backward compatible with a...
NSS 3.12.4 release notes
ss_initreadwrite(sql:<configdir>) leaves behind a pkcs11.txu file if libnssckbi.so is in <configdir>. bug 495717: unable to compile nss/cmd/certutil/keystuff.c on wince bug 496961: provide truncated hmac support for testing tool fipstest bug 497002: lab required nspr-free freebl changes. bug 497217: the first random value ever generated by the rng should be discarded bug 498163: assert if profile
path contains cyrillic chars. [[@isspace - secmod_argisblank - secmod_arghasblanks - secmod_formatpair - secmod_mknewmodulespec] bug 498509: produce debuggable optimized builds for mozilla on macosx bug 498511: produce debuggable optimized nss builds for mozilla on linux bug 499385: drbg reseed function needs to be tested on post bug 499825: utilrename.h is missing from solaris packages bug 502961: al...
NSS 3.14 release notes
ificate chain validation callback when using libpkix to better support per-application security policies, a new callback has been added for applications that use libpkix to verify certificates. applications may use this callback to inform libpkix whether or not candidate certificate chains meet application-specific security policies, allowing libpkix to continue discovering certificate
paths until it can find a chain that satisfies the policies. the following types have been added in nss 3.14 certchainverifycallback (in certt.h) certchainverifycallbackfunc (in certt.h) cert_pi_chainverifycallback, a new option for certvalparamintype (in certt.h) a new error code: sec_error_application_callback_error (in secerr.h) new for ...
NSS 3.16.4 release notes
o mitigate the effects of the previous removal of the 1024-bit entrust.net root certificate, because many public internet sites still use the "usertrust legacy secure server ca" intermediate certificate that is signed by the 1024-bit entrust.net root certificate. the inclusion of the intermediate certificate is a temporary measure to allow those sites to function, by allowing them to find a trust
path to another 2048-bit root ca certificate. the temporarily included intermediate certificate expires november 1, 2015. bugs fixed in nss 3.16.4 this bugzilla query returns all the bugs fixed in nss 3.16.4: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.16.4 ...
NSS 3.31 release notes
entified by the given uri. pk11_getmoduleuri - retrieve the uri of the given module. pk11_gettokenuri - retrieve the uri of a token based on the given slot information. in pkcs11uri.h pk11uri_createuri - create a new pk11uri object from a set of attributes. pk11uri_destroyuri - destroy a pk11uri object. pk11uri_formaturi - format a pk11uri object to a string. pk11uri_get
pathattribute - retrieve a
path attribute with the given name. pk11uri_getqueryattribute - retrieve a query attribute with the given name. pk11uri_parseuri - parse pkcs#11 uri and return a new pk11uri object. new macros in pkcs11uri.h several new macros that start with pk11uri_pattr_ for
path attributes defined in rfc7512. several new macros that start with pk11uri_qattr_ for...
NSS 3.40 release notes
rg/pub/mozilla.org/security/nss/releases/nss_3_40_rtm/src/ new in nss 3.40 new functionality the draft-00 version of encrypted sni support is implemented tstclnt now takes -n option to specify encrypted sni key new functions none notable changes in nss 3.40 the mozilla::pkix library has been ported from mozilla psm to nss. this is a c++ library for building certification
paths. mozilla::pkix apis are not exposed in the libraries nss builds. it is easier to build nss on windows in mozilla-build environments. the following ca certificates were removed: cn = visa ecommerce root sha-256 fingerprint: 69fac9bd55fb0ac78d53bbee5cf1d597989fd0aaab20a25151bdf1733ee7d122 bugs fixed in nss 3.40 bug 1478698 - ffdhe key exchange sometimes fails with...
NSS 3.46 release notes
s-kw bug 1571316 - curve25519_32.c:280: undefined reference to `pr_assert' when building nss 3.45 on armhf-linux bug 1516593 - client to generate new random during renegotiation bug 1563258 - fips.sh fails due to non-existent "resp" directories bug 1561598 - remove -wmaybe-uninitialized warning in pqg.c bug 1560806 - increase softoken password max size to 500 characters bug 1568776 - output
paths relative to repository in nss coverity bug 1453408 - modutil -changepw fails in fips mode if password is an empty string bug 1564727 - use a pss spki when possible for delegated credentials bug 1493916 - fix ppc64 inline assembler for clang bug 1561588 - remove -wmaybe-uninitialized warning in p7env.c bug 1561548 - remove -wmaybe-uninitialized warning in pkix_pl_ldapdefaultclient.c bug 151...
Enc Dec MAC Output Public Key as CSR
"[-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 operation\n\n", "d"); fprintf(stderr, "%-20s specify db directory
path\n\n", "-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p "); fprintf(stderr, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify subject\n\n", "-s "); fprintf(stderr, "%-21s specify ...
EncDecMAC using token object - sample 3
y = 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, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes...
NSS sources building testing
low directory dist/?, where ? will be a name dynamically derived from your system's architecture. exported header files for nss applications can be found in directory "include", library files in directory "lib", and the tools in directory "bin". in order to run the tools, you should set your system environment to use the libraries of your build from the "lib" directory, e.g., using the ld_library_
path or dyld_library_
path environment variable. running the nss test suite this is an important part of development work, in order to ensure your changes don't introduce regressions. when adding new features to nss, tests for the new feature should be added as well. you must build nss prior to running the tests. after the build on your computer has succeeded, before you can run the tests on your co...
nss tech note2
rv = 0x0 4. collect performance data. this mode is most useful in optimized builds. the number of calls to each pkcs #11 function will be counted, and the time spent in each function as well. a summary of performance data is dumped during nss shutdown. no additional environment variables are required for this mode. if the environment variable nss_output_file is set, its value will be used as the
path name of the file to which the final output will be written. otherwise, the output will be written to stdout. ...
nss tech note6
, libfreebl_32fpu_3.so, libfreebl_64int_3.so, libfreebl_64fpu_3.so, libfreebl_32int_3.sl, libfreebl_32fpu_3.sl; or 2. use shlibsign to regenerate the .chk files. for example, on 32-bit solaris sparc for nss 3.11, say shlibsign -v -i libsoftokn3.so shlibsign -v -i libfreebl_32int64_3.so shlibsign -v -i libfreebl_32fpu_3.soshlibsign -v -i libfreebl_32int_3.so (you need to set ld_library_
path appropriately and specify the correct
pathnames of the libraries.) option 1 is simpler and highly preferred. ...
PKCS11 Implement
cryptographic modules portion of the communicator security info window. to do so, the user should follow these steps: click the security icon near the top of any communicator window. in the security info window, click cryptographic modules. in the cryptographic modules frame, click add. in the create a new security module dialog box, add the security module name for your module and the full
pathname for the security module file. to avoid requiring the user to type long
pathnames, make sure your module is not buried too deeply. semantics unique to nss these sections describe semantics required by nss but not specified by pkcs #11. supporting multiple sessions if you support multiple sessions simultaneously and if you wish to support c_initpin, c_setpin, or c_generatekeypair, you mu...
NSS functions
t mxr 3.2 and later pk11_paramfromiv mxr 3.2 and later pk11_paramfromalgid mxr 3.2 and later pk11_paramtoalgid mxr 3.2 and later pk11_pbekeygen mxr 3.2 and later pk11_privdecryptpkcs1 mxr 3.9.3 and later pk11_protectedauthentication
path mxr 3.4 and later pk11_pubdecryptraw mxr 3.2 and later pk11_pubderive mxr 3.2 and later pk11_pubderivewithkdf mxr 3.9 and later pk11_pubencryptpkcs1 mxr 3.9.3 and later pk11_pubencryptraw mxr 3.2 and later pk11_pubunwrapsymkey ...
troubleshoot.html
troubleshooting nss and jss builds newsgroup: mozilla.dev.tech.crypto this page summarizes information on troubleshooting the nss and jss build and test systems, including known problems and configuration suggestions. if you have suggestions for this page, please post them to mozilla.dev.tech.crypto. building nss having /usr/ucb/bin in the
path before /usr/ccs/bin breaks the build on 64-bit solaris. the solaris compiler needs to be workshop-5.0 or greater. the 64-bit builds don't support gcc. if the build fails early on the gmakein coreconf try updating your cvs tree with -p: cd mozilla cvs update -p building a 32-bit version on a 64-bit may fail with: /usr/include/features.h:324:26: fatal error: bits/predefs.h: no such file or directory in this case remember to s...
NSS_3.12.3_release_notes.html
bug 464406: fix signtool regressions bug 465270: uninitialised value in devutil.c::create_object() bug 465273: dead assignment in devutil.c::nssslotarray_clone() bug 465926: during import of pkcs #12 files bug 466180: ssl_configmp...
Necko Architecture
urls necko's primary responsibility is moving data from one location, to another location. these locations are represented in the form we have all grown to know and love as uris. a url implements the uri interface. the uri interface does resource-generic things like getting/setting the scheme, or getting/setting the spec (everything beyond the first colon ':'). urls provide getting/setting of
paths, hosts, ports, filenames, etc. urls are the most commonly used form of a uri. because of their importance, necko provides its own standard implementation of urls (with class id ns_standardurl_cid), which does all of the standard parsing necessary for most urls. necko also provides a simple uri implementation for convenience. uris (recall that a url is just one implementation of a uri) can be cre...
Necko Interfaces Overview
y be out of date. it was last updated in 2001. nsiioservice central necko service manages protocol handlers thin layer over protocol handlers provides interface for creating uri objects from uri strings maps uri scheme to appropriate nsiprotocolhandler impl nsiuri (nsiurl, nsifileurl, nsistandardurl) represents an uri, with getters and setters for various uri parts (eg. scheme, host,
path, ...) per protocol implementation necko provides uri impl's for common uri formats (see nsstandardurl, nssimpleuri) nsichannel : nsirequest represents a logical connection to the resource identified by a nsiuri per protocol implementation single use (ie. channel is used to download the resource once) download initiated via nsichannel::asyncopen method can be canceled via nsirequest::can...
Rhino downloads archive
no15r3.zip rhino 1.5r2 2001-07-27 changes in 1.5r2 rhino15r2.zip rhino 1.5r1 2000-09-10 changes in 1.5r1 rhino15r1.zip rhino 1.4r3 1999-05-10 initial public release rhino14r3.zip rhino 1.6r1 through 1.6r6 implement e4x using xmlbeans library. if you would like to use e4x you need to add xbean.jar from xmlbeans distribution to your class
path. in rhino 1.6r6 and later the e4x support has been rewritten to rely solely on the dom3 apis supported natively by java 1.5. (pre-java 1.5 users can use dom3 using java's endorsed standards override mechanism if they have a dom3-capable xml parser.) if neither xmlbeans nor dom3 are present, e4x is not available. if you are looking for js.jar for xslt or for ibm's bean scripting framework (bsf),...
Rhino FAQ
of primitive types is slightly different: you must use the type field. for example, creating an array of seven ints can be done with the code var intarray = java.lang.reflect.array.newinstance(java.lang.integer.type, 7); when i try to execute a script i get the exception required security context missing. what's going on? you've likely missed placing the security.properties file in your class
path at org.mozilla.javascript.resources. can i use rhino in a web browser? rhino is a library for java use, and not for general web browsers. however, a java-based browser may use rhino with scripts from a page in the same manner that any other java program would. ...
Scripting Java
pts to load a class named java.myclass. if that load fails, it assumes that java.myclass is a package name, and no error is reported: js> java.myclass [javapackage java.myclass] only if you attempt to use this object as a class will an error be reported. external packages and classes external packages and classes can also be used as in rhino. make sure your .jar or .class file is on you class
path then you may import them into your javascript application. these packages are likely not in the java package, so you'll need to prefix the package name with "packages." for example, to import the org.mozilla.javascript package you could use importpackage() as follows: $ java org.mozilla.javascript.tools.shell.main js> importpackage(packages.org.mozilla.javascript); js> context.currentcontext; or...
Rhino serialization
on:c1 the problem is that java serialization has no built-in way to serialize java classes themselves. (it might be possible to save the java bytecodes in an array and then load the class upon deserialization, but at best that would eat up a lot of memory for just this feature.) one way around this is to compile the functions using the jsc tool: $ cat f.js function f() { return 3; } $ java -class
path js.jarorg.mozilla.javascript.tools.jsc.main f.js $ cat test2.js loadclass("f"); serialize(f, "f.ser"); g = deserialize("f.ser"); print(g()); $ java -class
path 'js.jar;.'org.mozilla.javascript.tools.shell.main test2.js 3 now the function f is compiled to a java class, but that class is then made available in the class
path so serialization works. this isn't that interesting an example since compili...
Rhino shell
given, each file is read in and executed in turn. loadclass(classname) load and execute the class named by the string argument classname. the class must be a class that implements the script interface, as will any script compiled by rhino javascript compiler. print([expr ...]) evaluate and print expressions. evaluates each expression, converts the result to a string, and prints it. readfile(
path [, charactercoding]) read given file and convert its bytes to a string using the specified character coding or default character coding if explicit coding argument is not given. readurl(url [, charactercoding]) open an input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if explicit coding arg...
Creating JavaScript jstest reftests
ecial requirement: the call to reportcompare in every jstest is required by the test harness. except in old tests or super strange new tests, it should be the last line of the test. comparison functions and shared test functionality the jstest runner loads the code in js/src/tests/shell.js for every test. additionally, it loads every shell.js and broswer.js file in the subdirectories on the
path from js/src/tests to the location of your test. if you have functionality several tests share in a given folder, you can add the functionality to the shell.js or broswer.js file in the directory. asserteq asserteq(v1, v2[, message]) checks that v1 and v2 are the same value. if they're not, throw an exception (which will cause the test to fail). reportcompare reportcompare(expected, actual, de...
GCIntegration - SpiderMonkey Redirect 1
gh, there hasn't been much use for this class—there aren't many places outside of spidermonkey where a write barrier is required. read barriers "weak pointers" are a major complication to the scheme described above. for the purposes of this article, a weak pointer is one that is not traced during gc. at the end of the gc, if the pointer refers to an object that is not reachable via some other
path, then it will be nulled out or dropped in some way. if the object is still reachable, then the pointer will be left alone. to see how weak pointers can cause trouble, consider the following situation: {{ svg{source: "http://people.mozilla.org/~wmccloskey/incremental2.svg", embedding: "iframe", height:"130"} }} in the left frame, a has a weak pointer to c. assume that an incremental gc has alrea...
Hacking Tips
erator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 (gdb) iongraph mir function 0 (asm.js compilation): success; 1 passes. /* open your png viewer with the result of iongraph */ this gdb instrumentation is supposed to work with debug builds, or with optimized build compiled with --enable-jitspew configure flag. external programs such as iongraph, dot, and your png viewer are search into the
path, otherwise custom one can either be configured with environment variables (gdb_iongraph, gdb_dot, gdb_pngviewer) before starting gdb, or with gdb parameters (set iongraph-bin <
path>, set dot-bin <
path>, set pngviewer-bin <
path>) within gdb. enabling gdb instrumentation may require launching a js shell executable that shares a directory with a file name "js-gdb.py". if js/src/js does not provide...
Bytecode Descriptions
urns" to the jsop::gosub and picks up at the next instruction, like a function call but within a single script and stack frame. (it's named after the thing in basic.) we need this because a try block can terminate in several different ways: control can flow off the end, return, throw an exception, break with or without a label, or continue. exceptions are handled separately; but all those success
paths are written as bytecode, and each one needs to run the finally block before continuing with whatever they were doing. they use jsop::gosub for this. it is thus normal for multiple gosub instructions in a script to target the same finally block. rules: forwardoffset must be positive and must target a jsop::jumptarget instruction followed by jsop::finally. the instruction immediately following jso...
Exact Stack Rooting
e stack so that the conservative scanner will find it. this distinction should not be noticable to the end user. performance tweaking in aggregate, exact and conservate stack rooting should have similar performance. the performance tradeoffs that these techniques make, however, are quite different. if the extra overhead of exact rooting does end up adding an unacceptable cost to a specific code
path that is not mitigated by a faster gc, there are some tricks you can use to get better performance at the cost of more complex code. move js::rootedt declarations above loops. modern c++ compilers are not smart enough to do licm on js::rootedt, so forward declaring a single js::rootedt above the loop and re-using it on every iteration can save some cycles. raw pointers. if you are 100% sure th...
Property cache
nt chain and then protoindex steps up the prototype chain. if pobj exists (that is, both the parent chain and the prototype chain are long enough) and it has the shape vshape, then it contains the desired property. furthermore, the .vword field describes the property in detail, as described in the next section. if a property with the same name is ever added to an object anywhere along the search
path, then this cache entry becomes invalid: the property described by this property cache entry has been shadowed. the two shadowing guarantees ensure that if this happens, the shape of pobj changes, invalidating the entry. setting. for jof_set instructions, this makes two additional guarantees: first, vword.issprop(); second, the correct behavior is to set the property described by vword.tosprop(),...
Introduction to the JavaScript shell
d line, a javascript program file to run, in which case the program is run automatically. after following the build documentation and installing the built shell using make install, you can run the shell in interactive mode using the command: js [ if you get " symbol lookup error: ./js: undefined symbol: pr_setcurrentthreadname" e.g. ...
JS::PersistentRooted
plies not only to js objects (which obviously are managed by the gc) but also to c++ objects owned by js objects. if you put a persistentrooted in such a c++ object, that is almost certainly a leak. when a gc begins, the referent of the persistentrooted is treated as live, unconditionally (because a persistentrooted is a *root*), even if the js object that owns it is unreachable. if there is any
path from that referent back to the js object, then the c++ object containing the persistentrooted will not be destructed, and the whole blob of objects will not be freed, even if there are no references to them from the outside. in the context of firefox, this is a severe restriction: almost everything in firefox is owned by some js object or another, so using persistentrooted in such objects would ...
JS_DumpHeap
ter to pass here). when null, dump all things reachable from the runtime roots. when non-null, dump only things reachable from the object indicated. startkind jsgctracekind trace kind of startthing, if startthing is not null. must be jstrace_object when startthing is null. thingtofind void * null or a pointer to a gc thing. if this is non-null, js_dumpheap only dumps
paths in the object graph leading to the specified thing. maxdepth size_t the upper bound on the number of edges to descend from the graph roots. thingtoignore void * null or a pointer to a gc thing that will be ignored during graph traversal. enum jsgctracekind { // these trace kinds have a publicly exposed, although opaque, c++ type. // note: the order he...
Parser API
parsed abstract syntax tree (ast). additional options may be provided via the options object, which can include any of the following properties: loc boolean default: true when loc is true, the parser includes source location information in the returned ast nodes. source string default: null a description of the input source; typically a filename,
path, or url. this string is not meaningful to the parsing process, but is produced as part of the source location information in the returned ast nodes. line number default: 1 the initial line number to use for source location information. builder builder default: null a builder object, which can be used to produce ast nodes in custom data formats.
WebReplayRoadmap
te graphics with the effects of those changes. object watching (not yet implemented) it would be nice to log the changes to a specific object or one of its properties, so that the points of those changes can be seeked to later. bookmarks (not yet implemented) it would be nice to be able to bookmark points in the recording so that they show up on the timeline and can be seeked to later. code
path highlighting (not yet implemented) when paused in a frame, the code
path taken through the frame (the lines/expressions executed) could be highlighted somehow, which would make it easier to see what happened in the frame. points on the
path could be clicked to seek there, which should offer faster and less clunky navigation than stepping buttons. hide unsupported developer tool features (not y...
compare-locales
tion compare-locales needs to be installed, and it requires that you have python 2.7 or 3.5+ installed on your machine. the easiest way is to just run $ pip install -u compare-locales running it compare-locales gathers the directories to compare from a toml file, usually found in $app/locales/l10n.toml. the details of the configuration file are described in the l10n-config docs. you pass the
path to the toml file and the parent dir of the localizations as first arguments, followed by the locale codes of the locales you want to compare. if you want to test the localization for de, run $ compare-locales browser/locales/l10n.toml ./l10n/ de to check mobile, replace the previous line with: $ compare-locales mobile/android/locales/l10n.toml ./l10n/ zh-tw to check mail, suite, calendar th...
Redis Tips
d benefits of redis are lost when you overflow into disk memory. as a conservative calculation, i multiply all the bytes i think i might store and multiply by 10, which antirez once recommended as a worst-case factor for data structure overhead. ...
Embedded Dialog API
xecutable, not as a separate library. this is perfectly workable, as the example illustrates. the mfc example implements its promptservice in a separate dll, and overrides the default promptservice only if it is able to load the override dll at application startup. its promptservice dialogs can be switched between default and overridden by moving the override dll into or out of the library search
path. other sets of dialogs and alerts, implemented in other components,can be overridden in exactly the same fashion. responsibilities of mozilla/gecko component authors writing replaceable dialogs dialogs posed by the browser ("up calls") any component which may be included in an embedded browser distribution and wishes to pose a dialog must group its ui (code which runs its dialogs) into a unique ...
History Service Design
lgorithm (aka: the awesomebar) allows searchs through bookmarks, history, keywords (and much more) detaching the user from the old long searches through tree views. this is possible through a relevance algorithm that assigns a param called frecency to every page in history, see the places frecency algorithm for major informations. history service provides the basics to create such adaptive search
paths, allowing for a better browsing experience through a common interface. long term objectives include the ability to index more informations from the visited pages, through fulltext indexes, and the possibility to generalize the frecency algorithm to allow for its use in user's queries. might be also nice to provide a hook for third-party products so they can provide text searching capabilities t...
Using the Places annotation service
notation name, you should use the format <namespace>/<name>. for example, "my_extension/page_state". the annotation service does not currently enforce the annotation name format, but this may change in the future. also, we may add functions to get all of "your" annotations matching a given namespace. you should not use any characters in your annotation names that are not valid as part of an html
path. this includes colons, spaces, most punctuation, and non-ascii characters. you should try to have relatively few annotation names. the service stores these names in a separate table, and the fewer names there are, the more efficient retrieving names will be. you should not design your service so that you require hundreds of unique annotation names. setting an annotation the annotation provides...
Using the Places history service
ns a reference to the url table for the page, the visit date, the transition type (typed, click, redirect, bookmark, etc.), a reference to the referring visit, and the session id. this separation of the global page information and the visit allows us to store information about each time the page was visited instead of just the last time. using the referrer information in each visit, the browsing
path can be reconstructed at any time. the "session id" allows these
paths to be reconstructed more easily. when the user starts browsing (for example, by typing in a link or following a bookmark), a new session id is created. new visits get the same session id as their referrer. this means that one "session" is comprised of going to a new page, and following a bunch of links or redirects. a session ...
Creating a Python XPCOM component
ing.) preparation if a binary of pyxpcom is not available, you will need to build it - see building pyxpcom. tip: you can achieve a copy of binary of pyxpcom from pythonext; simply unpack xpi and take everything you need. if you wish to use pyxpcom from a normal python executable, you will need to tell python where it can find the pyxpcom library. this is probably best done by setting a python
path variable pointing at the 'bin/python' directory in the application. this is not necessary when your components are loaded by mozilla as the python loader modifies sys.
path. then you can import xpcom in any python module (mostly, in your component). defining the interface make a file named "nsipysimple.idl" to define the interface: #include "nsisupports.idl" [scriptable, uuid(2b324e9d-a322-44a7-b...
XPCOM changes in Gecko 2.0
used to register components. all existing xpcom components will need to be updated to support this. however, it's very easy to do, and you can actually support both types of registration for backward compatibility. component manifests all component registration is now handled through manifest files. for extensions, this is the same chrome.manifest currently used to register chrome. xpt files the
path of any xpt files must be listed explicitly in a manifest using an interfaces directive: interfaces components/mycomponent.xpt javascript components the registration information for javascript components is no longer located in the component itself; instead, it's located in the manifest. the component is loaded only when the xpcom component manager needs to create a component. chrome.manifest: # t...
Component Internals
onent manifest maps component files to unique identifiers for the specific implementations (class ids), which in turn are mapped to more general component identifiers (contract ids). type library manifests another important file that xpcom reads in is the type library manifest file. this file is also located in the components directory and is named xpti.dat. it includes the location and search
paths of all type library files on the system. this file also lists all known interfaces and links to the type library files that define these interface structures. these type library files are at the core of xpcom scriptablity and the binary component architecture of xpcom. type library manifests type library manifests contain the following information: location of all type library files mappi...
Creating XPCOM components
weblock programming interface defining the weblock interface in xpidl the xpidl syntax scriptable interfaces subclassing nsisupports the web locking interface implementing weblock declaration macros representing return values in xpcom xpidl code generation getting the weblock service from a client implementing the iweblock interface the directory service modifying
paths with nsifile manipulating files with nsifile using nsilocalfile for reading data processing the white list data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your build environment implementing the nsicontentpolicy interface ...
How to build a binary XPCOM component using Visual Studio
hing : nsisupports { attribute astring name; long add(in long a, in long b); }; remember to generate your own guid. the next step is to compile the idl into a type-library (*.xpt) and a c++ header file (*.h), which we can use to define our implementation object. the blank vc++ project has a bat file that will create the xpt and the h files. the command executes xpidl.exe twice, like this: {
path_to_geckosdk}\bin\xpidl.exe -m header -i..\gecko-sdk\idl {your_idl_file} {
path_to_geckosdk}\bin\xpidl.exe -m typelib -i..\gecko-sdk\idl {your_idl_file} the generated h file actually has a skeleton implementation (commented out). you can take the code and create implementation h and cpp files. they could look like this: h file: #ifndef __specialthing_impl_h__ #define __specialthing_impl_h__ #inc...
Components.utils.Sandbox
in as this parameter, in order to ensure that the script is cleaned up at the same time as the content itself. sandboxname a string value which identifies the sandbox in about:memory (and possibly other places in the future). this property is optional, but very useful for tracking memory usage of add-ons and other javascript compartments. a recommended value for this property is an absolute
path to the script responsible for creating the sandbox. as of gecko 13 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), if you don't specify a sandbox name it will default to the caller's filename. sandboxprototype a prototype object for the sandbox. the sandbox will inherit the contents of this object if it's provided. passing a content window object, setting wantxrays:true (default) and ...
Components.utils.importGlobalProperties
ownside of using hiddendomwindow is that on startup of firefox, the hiddendomwindow objects cannot be accessed until it is fully loaded. therefore readystate must be checked, if it is not complete, then a load listener must be attached. once readystate is complete then the objects can be used. for example this is how to ues the file object. ...
nsDirectoryService
class id f00152d0-b40b-11d3-8c9c-000064657374 contractid @mozilla.org/file/directory_service;1 supported interfaces nsiproperties nsidirectoryservice remarks this component is a singleton and should therefore be accessed via the xpcom service manager. ...
Standard XPCOM components
there are a number of components provided in the standard implementation of xpcom; these are as follows. nscategorymanagerthe xpcom category manager.nsdirectoryservicethe xpcom directory service. this service returns the locations of "well known" directories in an os-independent manner. for instance, it can give you the
path of the system's temporary directory, desktop directory, current working directory, and so on.nslocalfilea component implementing nsilocalfile. nsobserverservicethe xpcom observer service.nsscriptableinputstreama component implementing nsiscriptableinputstream. ...
nsICommandLineRunner
ain. it assumes a native character set. on windows the character set is utf-8, not the native codepage. void init( in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state ); parameters argc the number of arguments being passed. argv an array storing pointers to the arguments workingdir directory where the command will run. this is used to resolve file and uri
paths. state the type of command line being processed. this is an nsicommandline state flag. run() processes the command-line handlers in the proper order, and calls nsicommandlinehandler.handle() on each. void run(); parameters none. exceptions thrown ns_error_abort thrown when the handler aborts. all other errors thrown by handlers will be silently ignored. setwindowcontext() sets the windowcont...
nsICookie
cookie. expires = 1 represents an expiration time earlier than jan 1, 1970. read only. host autf8string the host (possibly fully qualified) of the cookie. read only. isdomain boolean true if the cookie is a domain cookie, false otherwise. read only. issecure boolean true if the cookie was transmitted over ssl, false otherwise. read only. name acstring the name of the cookie. read only.
path autf8string the
path pertaining to the cookie. read only. policy nscookiepolicy holds the sites compact policy value. read only. status nscookiestatus holds the p3p status of cookie. read only. value acstring the cookie value. read only. constants constant value description status_unknown 0 the cookie collected in a previous session, and its information no longer exists. available ...
nsICrashReporter
void annotatecrashreport(in acstring key, in acstring data); void appendappnotestocrashreport(in acstring data); void appendobjcexceptioninfotoappnotes(in voidptr aexception); native code only! void writeminidumpforexception(in voidptr aexceptioninfo); native code only! attributes attribute type description enabled boolean enable or disable the crashreporter at runtime. minidump
path nsilocalfile get or set the
path on the local system to which minidumps will be written when a crash happens. exceptions thrown ns_error_not_initialized if crash reporting is not initialized. serverurl nsiurl get or set the url to which crash reports will be submitted. only https and http urls are allowed, as the submission is handled by os-native networking libraries. exceptions thrown n...
nsIDirectoryServiceProvider
read-only string called currdir with the value of the current working directory. __definegetter__("currdir", function getcurrdir() { return components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsidirectoryserviceprovider) .getfile("curworkd",{}).
path; }); test it with to see the magic happen. alert(currdir); see also nsdirectoryservice nsidirectoryservice additionally, see section 16.5.2 of the rapid application development with mozilla book for instructions on how to get the current working directory and the process binary directory, among other things. ...
nsIDownloadManager
abase connection to the downloads database. read only. defaultdownloadsdirectory nsilocalfile returns the platform default downloads directory. read only. listener nsidownloadprogresslistener the download manager's progress listener. obsolete since gecko 1.8 userdownloadsdirectory nsilocalfile returns the user configured downloads directory. the
path is dependent on two user configurable prefs set in preferences: browser.download.folderlist defines the default download location for files: 0: files are downloaded to the desktop by default. 1: files are downloaded to the system's downloads folder by default. 2: files are downloaded to the local
path specified by the browser.download.dir preference. if this preference i...
nsIDynamicContainer
erface provides a base class for services that want to provide containers for temporary contents. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the service can fill result nodes directly into the container when it is opened. it can use the property bag on every result node to store data associated with each item, such as a full
path on disk. it can also create additional containers for each container, registered to its service. method overview void oncontainermoved(in long long aitemid, in long long anewparent, in long anewindex); void oncontainernodeclosed(in nsinavhistorycontainerresultnode acontainer); void oncontainernodeopening(in nsinavhistorycontainerresultnode acontainer, in nsinavhistoryqueryoptions aoptions)...
nsIFileView
odifiedcolumn" label="date" flex="1"/> <treecol id="size" label="size" flex="1"/> </treecols> <treechildren/> </tree> <script> var dir="/home/"; //the directory to be opened var ftree = document.getelementbyid("ftree"); //the xul tree element var lfile = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); lfile.initwith
path(dir); // open the directory var fview = components.classes["@mozilla.org/filepicker/fileview;1"] .createinstance(components.interfaces.nsifileview); //create an instance of the component tview = fview.queryinterface(components.interfaces.nsitreeview); //get the nsitreeview interface fview.setdirectory(lfile.queryinterface(components.interfaces.nsifile)); //set the directory...
nsILocalFileMac
his object to point to an application having the given creator code. if this app is missing, this will fail. it will first look for running application with the given creator. void inittoappwithcreatorcode( in ostype aappcreator ); parameters aappcreator the signature of the app. native code only!initwithcfurl init this object with a cfurlref. note: supported only for xp_macosx. note: if the
path of the cfurl is /a/b/c, at least a/b must exist beforehand. void initwithcfurl( in cfurlref acfurl ); parameters acfurl the corefoundation url. native code only!initwithfsref init this object with an fsref. note: supported only for xp_macosx. void initwithfsref( [const] in fsrefptr afsref ); parameters afsref the native fsref. native code only!initwithfsspec obsolete since gecko 1.9.2...
nsILoginInfo
rd, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description formsubmiturl astring the origin, not url, a form-based login was submitted to. for logins obtained from html forms, this field is the action attribute from the form element, with the
path removed (for example, "https://www.site.com"). forms with no action attribute default to submitting to their origin url, so that is stored here. this field is null for logins attained from protocol authentications and "" means to match against any form action. hostname astring the origin, not hostname, to which the login applies (for example, "https://www.site.com"). a port number...
nsIMemoryMultiReporter
lback.callback() method once for each report. this will trigger any needed computation work. note: this differs from the behavior of nsimemoryreporter, which lets all fields except amount be accessed without triggering computation. attributes attribute type description explicitnonheap print64 the sum of all of this multi-reporter's measurements that have a
path that starts with "explicit" and are of the kind kind_nonheap. note: this is a hack that makes nsimemoryreportermanager.explicit more efficient. this is important; multi-reporters can special-case this operation so it's much faster than gathering all the reports, filtering out the unneeded ones, and adding up the rest. method overview void collectreports(in nsimemorym...
nsIMemoryReporter
s attribute. read only. note: this attribute was called memoryused prior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), and its type was long long. description autf8string a human-readable description of this memory usage report. read only. kind print32 the memory kind, one of the memory reporter kind constants below. read only.
path autf8string the
path that this memory usage should be reported under.
paths are delimited with '/' characters to allow a hierarchy of memory to be displayed in about:memory. as of gecko 6.0, the
path should start with "explicit/" if the memory report accounts for all memory reported under sub-
paths. read only. process acstring the name of the process containing this reporter.
nsIMemoryReporterManager
3) implemented by @mozilla.org/memory-reporter-manager;1 as a service: var reportermanager = components.classes["@mozilla.org/memory-reporter-manager;1"] .getservice(components.interfaces.nsimemoryreportermanager); each memory reporter object, which implements nsimemoryreporter interface, provides information for a given code area. each code area is identified by a unique
path string, which is displayed in about:memory. method overview nsisimpleenumerator enumeratemultireporters(); nsisimpleenumerator enumeratereporters(); void init(); void registermultireporter(in nsimemorymultireporter reporter); void registerreporter(in nsimemoryreporter reporter); void unregistermultir...
nsIMessenger
e containing each attachment. savefirst if true, the attachments are saved using saveallattachments() before being deleted. withoutwarning if true, no warning is shown to the user before the delete. saveattachmenttofolder() saves an attachment in a given folder. saveattachmenttofolder() is used by the drag and drop code to drop an attachment to a destination folder. returns the actual file
path (including the filename). nsilocalfile saveattachmenttofolder(in acstring , in acstring url, in acstring displayname, in acstring messageuri, in nsilocalfile adestfolder); parameters contenttype the content type of the attachment. url the ur...
nsIMsgProtocolInfo
account type. read only. cangetmessages boolean true if "get messages" ui actions should be enabled for the account type. read only. canloginatstartup boolean true if the account type can perform biff during startup. read only. defaultdobiff boolean true if the biff should be enabled by default for the account type. read only. defaultlocalfile
path nsilocalfile the default
path under which all server data for this account type will be stored. folderscreateasync boolean new in thunderbird 24 (bug 832034) preflightprettynamewithemailaddress boolean unused. read only. requiresusername boolean true if the server requires a username to log on. read only. serveriid nsiidptr the iid...
nsIProcess
instance as the subject and "process-finished" or "process-failed" as the topic. the observer will be notified on the main thread. holdweak optional if true, a weak reference is used to hold the observer. example // create an nsifile for the executable var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsifile); file.initwith
path("c:\\myapp.exe"); // create an nsiprocess var process = components.classes["@mozilla.org/process/util;1"] .createinstance(components.interfaces.nsiprocess); process.init(file); // run the process. // if first param is true, calling thread will be blocked until // called process terminates. // second and third params are used to pass command-line arguments // to the proce...
nsIProfile
the new clone of the current profile. createnewprofile() creates a new profile. appropriate default values will be copied into the preferences in the new profile. void createnewprofile( in wstring profilename, in wstring nativeprofiledir, in wstring langcode, in boolean useexistingdir ); parameters profilename the name to assign to the new profile. nativeprofiledir the
pathname of the directory to use as the profile directory; if you specify null, a new folder will be created in the default profiles directory. langcode the locale to use for the new profile. useexistingdir if true, an existing directory may be used; otherwise, the profile directory will be unique. deleteprofile() deletes the specified profile. void deleteprofile( in wstring name, ...
nsITreeView
:moz-tree-column(x) to be matched on the treechildren element. see getrowproperties() for an example. void getcolumnproperties( in nsitreecolumn col, in nsisupportsarray properties ); parameters col the current column. properties an array of the column's current properties. obsolete since gecko 22 return value a string of space-separated property names. getimagesrc() the image
path for a given cell. for defining an icon for a cell. if the empty string is returned, the ::moz-tree-image pseudoelement will be used. astring getimagesrc( in long row, in nsitreecolumn col ); parameters row the index of the row. col the index of the column. return value the image
path of the cell. getlevel() the level is an integer value that represents the level of indentation. ...
nsIWebProgressListener
access to the dom window. this example here shows you how to detect what flags are popping up where. it puts the messages into the browser console. /** * this example assumes that it's being run within the context of a browser * window, and uses a frame script that will be loaded into every * browser tab. */ let mm = window.getgroupmessagemanager("browsers"); mm.loadframescript("chrome://
path/to/some/example-framescript.js", true); mm.addmessagelistener("myaddonmessage", (message) => { let data = message.data; let browser = message.target; let outerwindowid = data.outerwindowid; // browser is now the <xul:browser> that saw the web progress activity // occur. if you need to hold onto an identifier for whichever frame // (be it the top-level, or a subframe) was using the web...
nsIWinAppHelper
arameters none. postupdate() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) invokes helper.exe with the /postupdate parameter. this updates the uninstallation log so that the application can be uninstalled correctly after an update. void postupdate( in nsilocalfile logfile ); parameters logfile the file to use for the uninstallation log. the
path is passed to helper.exe as the /uninstalllog parameter. ...
nsIXPConnect
not flagged as "system", the wrapped native will be automatically wrapped with an xpcnativewrapper. void flagsystemfilenameprefix( in string afilenameprefix, in prbool awantnativewrappers ); parameters afilenameprefix the utf-8 filename prefix to match, which should end with a slash (/) character. awantnativewrappers whether xpconnect should produce native wrappers for scripts whose
paths begin with this prefix. exceptions thrown missing exception missing description garbagecollect() trigger a js garbage collection. void garbagecollect(); parameters none. exceptions thrown missing exception missing description getcaller() return the caller object of the current call from js. [noscript,notxpcom] void getcaller( out jscontextptr ajscontext, out jsobjectptr...
nsIZipEntry
t zip application note support. read only. crc32 unsigned long the crc-32 hash of the file in the entry. read only. isdirectory boolean true if the name of the entry ends with '/' and false otherwise. read only. issynthetic boolean use this attribute to determine whether this item is an actual zip entry or is one synthesized for part of a real entry's
path. a synthesized entry represents a directory within the zip file which has no corresponding entry within the zip file. for example, the entry for the directory foo/ in a zip containing exactly one entry for foo/bar.txt is synthetic. if the zip file contains an actual entry for a directory, this attribute will be false for the nsizipentry for that directory. it is impossible for a file to be synthe...
XPCOM Interface Reference
ntnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensidomstorage2nsidomstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsidomstoragewindownsidomuserdatahandlernsidomwindownsidomwindow2nsidomwindowinternalnsidomwindowutilsnsidomx
pathevaluatornsidomx
pathexceptionnsidomx
pathexpressionnsidomx
pathresultnsidomxulcontrolelementnsidomxulelementnsidomxullabeledcontrolelementnsidomxulselectcontrolelementnsidomxulselectcontrolitemelementnsidatasignatureverifiernsidebugnsidebug2nsidevicemotionnsidevicemotiondatansidevicemotionlistenernsidialogcreatornsidialogparamblocknsidictionarynsidirindexnsidirindexlistenernsidirindexparsernsidirect...
XPCOM Interface Reference by grouping
nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomx
pathevaluator nsidomx
pathexception nsidomx
pathexpression nsidomx
pathresult xslt nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsiworkermessageport nsiworkerscope tree nsitreeboxobject ...
Using nsIDirectoryService
ystem of the location of dlls that are linked against. this aspect of file location is not related to nsidirectoryservice, but needs mention here. on the macintosh, these dlls are the shared libs in the "essential files" directory. you need to include an alias in your application that points to this directory and the resource id of this alias goes into your 'cfrg' resource. on platforms which use
path environment variables, you will need to set one of these
paths to the /bin directory. application level nsappdirectoryservicedefs.h the first group listed is for locations that are relative to the application: for instance, the name and location of the chrome folder, or the default location of user profiles. the nsidirectoryserviceprovider which normally provides these locations is at mozilla/xpc...
xpidl
te headers used by the xpcom components. please check the build documentation for further information on where to get libidl and glib. using xpidl to add an idl file to the build, use the xpidlsrcs makefile variable. for testing purposes, or one-off interface compilation, xpidl can be run from the command line: usage: ./xpidl -m mode [-w] [-v] [-t version number] [-d filename.pp] [-i
path] [-o basename | -e filename.ext] filename.idl -a emit annotations to typelib -w turn on warnings (recommended) -v verbose mode (nyi) -t create a typelib of a specific version number -i add entry to start of include
path for ``#include "nsithing.idl" -o use basename (e.g. ``/tmp/nsithing) for output -e use explicit output filename -d write de...
Index
e building a thunderbird extension article. (duplicate content has been removed from this page.) 87 finding the code for a feature add-ons, extensions, thunderbird frequently you are trying to figure out the code that implements a specific feature of the user interface. how do you find that out? as an example, i received the following inquiry, and i decided to follow my usual
path and document what i do: 88 styling the folder pane the folder pane in thunderbird is predominantly controlled by code in folderpane.js. since thunderbird 3, the folder pane is designed in a more modular and extensible fashion. it is now possible to place non-mail entities in the folder pane. 89 theme packaging add-ons, themes, toolkit api this document d...
ctypes
ew cdata object representing the same data, but with the specified type. libraryname() returns the correct platform-specific filename for a given library name (e.g. libnss3.dylib for nss3 on os x.) string libraryname( name ); parameters name the name of the library. return value string containing the platform-specific filename of the library. open() opens a library, specified by a
pathname. the library is loaded from the specified full
path, or, if a partial
path is specified, from the appropriate library directory based on the platform on which the application is running. see library search
paths for more details. library open( libspec ); parameters libspec the native library to open, specified as a
pathname string. return value a library object representing the op...
Mozilla
uilds, and firefox releases from 2.0.0.4. this allows debugging of those builds without forcing all users to download large debugging files. the server functions like microsoft's symbol server so the documentation there can be useful. virtualenv virtualenv is software for isolating python package environments (e.g. import
paths). it is written by mozilla's own ian bicking. creating a virtualenv installs setuptools (or optionally distribute) into the virtual environment. it is recommended that you use virtualenv for installing anything other than system software that you are working on. you will obviate the need to have access to your system packages and you won't mess up your system pac...
URLs - Plugins
e in a new stream. plug-ins can use this capability to post form data to cgi scripts using http or upload files to a remote server using ftp. the browser resolves this method as the http server method post, which transmits data to the server. the data to post can be contained either in a local temporary file or a new memory buffer. to post a file, set the flag file to true, the buffer buf to the
path name string for a file, and len to the length of the
path string. the file-type url prefix "file://" is optional. npn_posturl is typically asynchronous: it returns immediately and only later handles the request and calls npp_notify (which, in turn, calls npp_urlnotify). nperror npn_posturl(npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file); the insta...
Color vision simulation - Firefox Developer Tools
ke red or green. color vision deficiencies affect about 8% of men, and 0.5% of women. the most common forms of color blindness (commonly lumped together as "red-green color blindness") affect more men than women, because they are due to a mutation in a gene in the x chromosome, which men usually have only one copy of. contrast sensitivity loss can be caused by cataracts, glaucoma, diabetic retino
pathy, and other disorders of the retina; it can be age-related, congenital, or due to an injury. to enable this feature, you must have webrender enabled; it may be enabled by default, depending on your configuration of firefox. in the firefox configuration editor, make sure the gfx.webrender.all option is set to true. in the simulate menu, you can choose one option at a time from the following li...
Use a source map - Firefox Developer Tools
the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. to enable the debugger to work with a source map, you must: generate the source map include a comment in the transformed file, that points to the source map. the comment's syntax is like this: //# sourcemappingurl=http://example.com/
path/to/your/sourcemap.map in the video above we load https://mdn.github.io/devtools-examples/sourcemaps-in-console/index.html. this page loads a source called "main.js" that was originally written in coffeescript and compiled to javascript. the compiled source contains a comment like this, that points to a source map: //# sourcemappingurl=main.js.map in the debugger's source list pane, the origi...
Debugger-API - Firefox Developer Tools
-debugger, tools can do so without worrying about interfering with other tools that use their own debugger instances. examples here are some things you can try out yourself that show off some of debugger’s features: setting a breakpoint in a page, running a handler function when it is hit that evaluates an expression in the page’s context. showing how many objects different call
paths allocate. gecko-specific features while the debugger core api deals only with concepts common to any javascript implementation, it also includes some gecko-specific features: [global tracking][global] supports debugging all the code running in a gecko instance at once—the ‘chrome debugging’ model. [object wrapper][wrapper] functions help manipulate object references that cross pri...
Aggregate view - Firefox Developer Tools
ck the star-triangle, we'll see all four array instances: for each instance, you can see the retained size and shallow size of that instance. in this case, you can see that the first three arrays have a fairly large shallow size (5% of the total heap usage) and a much larger retained size (26% of the total). on the right-hand side is a pane that just says "select an item to view its retaining
paths". if you select an item, you'll see the retaining
paths panel for that item: call stack the call stack shows you exactly where in your code you are making heap allocations. because tracing allocations has a runtime cost, it must be explicitly enabled by checking "record call stacks" before you allocate the memory in the snapshot. you'll then see a list of all the functions that allocat...
Dominators - Firefox Developer Tools
objects will have a small shallow size but a much larger retained size, through the references they contain to other objects. retained size is an important concept in analyzing memory usage, because it answers the question "if this object ceases to exist, what's the total amount of memory freed?". dominators a related concept is that of the dominator. node b is said to dominate node a if every
path from the root to a passes through b: if any of node a's dominators are freed, then node a itself becomes eligible for garbage collection. if node b dominates node a, but does not dominate any of a's other dominators, then b is the immediate dominator of a: one slight subtlety here is that if an object a is referenced by two other objects b and c, then neither object is its dominator, becau...
Network request details - Firefox Developer Tools
edit and resend: enables an editing mode, where you can modify the method, url, request headers, or request body of the request. click send to send the modified request, or cancel to cancel editing. request information the following information is shown only when the section is expanded: scheme: the scheme used in the url host: the server involved in the request filename: the full
path to the file requested address: the ip address of the host the following information is shown in both the collapsed and the expanded states: status: the http response code for the request. version: the http version used transferred: the amount of data transferred with the request the referrer policy, which governs which referrer information, sent in the referer header, should be included ...
IndexedDB - Firefox Developer Tools
fied for the database. origin — the origin of the database. version — the database version. object stores — the number of object stores in the database. when an indexeddb database is selected in the storage tree, details about all the object stores are listed in the table. any object store has the following details: object store name — the name of the object store. key — the key
path property of the object store. auto increment — is automatic incrementation of the keys enabled? indexes — array of indexes present in the object store as shown below. when an object store is selected in the storage tree, all the items in that object store are listed in the table. all items have a key and a value associated with them. you can delete an indexeddb database using the conte...
Web Console Helpers - Firefox Developer Tools
es descended from element that match. if unspecified, element defaults to document. this is like for document.queryselectorall(), but returns an array instead of a nodelist. $0 the currently-inspected element in the page. $_ stores the result of the last expression executed in the console's command line. for example, if you type "2+2 <enter>", then "$_ <enter>", the console will print 4. $x(x
path, element, resulttype) evaluates the x
path x
path expression in the context of element and returns an array of matching nodes. if unspecified, element defaults to document. the resulttype parameter specifies the type of result to return; it can be an x
pathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used. :block (startin...
The JavaScript input interpreter - Firefox Developer Tools
es descended from element that match. if unspecified, element defaults to document. this is like for document.queryselectorall(), but returns an array instead of a nodelist. $0 the currently-inspected element in the page. $_ stores the result of the last expression executed in the console's command line. for example, if you type "2+2 <enter>", then "$_ <enter>", the console will print 4. $x(x
path, element, resulttype) evaluates the x
path x
path expression in the context of element and returns an array of matching nodes. if unspecified, element defaults to document. the resulttype parameter specifies the type of result to return; it can be an x
pathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used. keys() given an...
AnalyserNode.fftSize - Web APIs
bytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.begin
path(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { var v = dataarray[i] / 128.0; var y = v * height/2; if(i === 0) { canvasctx.moveto(x, y); } else { canvasctx.lineto(x, y); } x += slicewidth; } canvasctx.lineto(canvas.width, canvas.height/2); ...
AnalyserNode.getByteTimeDomainData() - Web APIs
// draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; const slicewidth = width * 1.0 / bufferlength; let x = 0; canvasctx.begin
path(); for(var i = 0; i < bufferlength; i++) { const v = dataarray[i]/128.0; const y = v * height/2; if(i === 0) canvasctx.moveto(x, y); else canvasctx.lineto(x, y); x += slicewidth; } canvasctx.lineto(width, height/2); canvasctx.stroke(); }; draw(); specifications specification status comment web audio apithe definition of 'getby...
AnalyserNode.getFloatTimeDomainData() - Web APIs
sole.log(bufferlength); var dataarray = new float32array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getfloattimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.begin
path(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { var v = dataarray[i] * 200.0; var y = height/2 + v; if(i === 0) { canvasctx.moveto(x, y); } else { canvasctx.lineto(x, y); } x += slicewidth; } canvasctx.lineto(canvas.width, canvas.height/2); canvasctx.stroke(); }; draw(); parameters array ...
AnalyserNode - Web APIs
"oscilloscope"); var canvasctx = canvas.getcontext("2d"); // draw an oscilloscope of the current audio source function draw() { requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = "rgb(200, 200, 200)"; canvasctx.fillrect(0, 0, canvas.width, canvas.height); canvasctx.linewidth = 2; canvasctx.strokestyle = "rgb(0, 0, 0)"; canvasctx.begin
path(); var slicewidth = canvas.width * 1.0 / bufferlength; var x = 0; for (var i = 0; i < bufferlength; i++) { var v = dataarray[i] / 128.0; var y = v * canvas.height / 2; if (i === 0) { canvasctx.moveto(x, y); } else { canvasctx.lineto(x, y); } x += slicewidth; } canvasctx.lineto(canvas.width, canvas.height / 2); canvasctx.stroke(); } draw(); ...
BaseAudioContext.createAnalyser() - Web APIs
bytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.begin
path(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { var v = dataarray[i] / 128.0; var y = v * height/2; if(i === 0) { canvasctx.moveto(x, y); } else { canvasctx.lineto(x, y); } x += slicewidth; } canvasctx.lineto(canvas.width, canvas.height/2); ...
BluetoothAdvertisingData - Web APIs
nly attribute map manufacturerdata; readonly attribute map servicedata; }; properties bluetoothadvertisingdata.appearance read only returns one of the values defined by the org.bluetooth.characteristic.gap.appearance characteristic. bluetoothadvertisingdata.txpower read only returns the transmission power at which the device is broadcasting, measured in dbm. this is used to compute the
path loss as this.txpower - this.rssi. bluetoothadvertisingdata.rssi read only returns the power at which the device’s packets are being received, measured in dbm. this is used to compute the
path loss as this.txpower - this.rssi. bluetoothadvertisingdata.manufacturerdata read only returns a map that relates company identifier codes to arraybuffers. bluetoothadvertisingdata.servicedata read o...
Using the CSS Typed Object Model - Web APIs
e.tostring() ); // url("https://mdn.mozillademos.org/files/16793/magicwand.png") when we get() the 'background-image', a cssimagevalue is returned. while we used the css background shorthand property, the inherited object.prototype.tostring() method, shows we returned only the image, 'url("https://mdn.mozillademos.org/files/16793/magicwand.png")'. notice that the value returned is the absolute
path to the image — this is returned even if the original url() value was relative. had the background image been a gradient or multiple background images, .get('background-image') would have returned a cssstylevalue. the cssimagevalue is returned only if there is a single image, and only if that single image declaration is a url. summary this should get you started with understanding the css typ...
CanvasRenderingContext2D.fillRect() - Web APIs
syntax void ctx.fillrect(x, y, width, height); the fillrect() method draws a filled rectangle whose starting point is at (x, y) and whose size is specified by width and height. the fill style is determined by the current fillstyle attribute. ...
CanvasRenderingContext2D.fillText() - Web APIs
xt2d method filltext(), part of the canvas 2d api, draws a text string at the specified coordinates, filling the string's characters with the current fillstyle. an optional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size. this method draws directly to the canvas without modifying the current
path, so any subsequent fill() or stroke() calls will have no effect on it. the text is rendered using the font and text layout configuration as defined by the font, textalign, textbaseline, and direction properties. to draw the outlines of the characters in a string, call the context's stroketext() method. syntax canvasrenderingcontext2d.filltext(text, x, y [, maxwidth]); parameters text ...
CanvasRenderingContext2D.getLineDash() - Web APIs
onstrates the getlinedash() method. html <canvas id="canvas"></canvas> javascript as set by setlinedash(), strokes consist of lines that are 10 units wide, with spaces of 20 units in between each line. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.setlinedash([10, 20]); console.log(ctx.getlinedash()); // [10, 20] // draw a dashed line ctx.begin
path(); ctx.moveto(0, 50); ctx.lineto(300, 50); ctx.stroke(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.getlinedash' in that specification. living standard ...
CanvasRenderingContext2D.lineDashOffset - Web APIs
mount of the line dash offset. the default value is 0.0. examples offsetting a line dash this example draws two dashed lines. the first has no dash offset. the second has a dash offset of 4. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.setlinedash([4, 16]); // dashed line with no offset ctx.begin
path(); ctx.moveto(0, 50); ctx.lineto(300, 50); ctx.stroke(); // dashed line with offset of 4 ctx.begin
path(); ctx.strokestyle = 'red'; ctx.linedashoffset = 4; ctx.moveto(0, 100); ctx.lineto(300, 100); ctx.stroke(); result the line with a dash offset is drawn in red. marching ants the marching ants effect is an animation technique often found in selection tools of computer graphics programs. i...
CanvasRenderingContext2D.lineWidth - Web APIs
line width, in coordinate space units. zero, negative, infinity, and nan values are ignored. this value is 1.0 by default. examples changing line width this example draws a line and a rectangle, using a line width of 15 units. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.linewidth = 15; ctx.begin
path(); ctx.moveto(20, 20); ctx.lineto(130, 130); ctx.rect(40, 40, 70, 70); ctx.stroke(); result more examples for more examples and explanation about this property, see applying styles and color in the canvas tutorial. specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.linewidth' in that specification. living ...
CanvasRenderingContext2D.strokeStyle - Web APIs
le, and only modify the green and blue values. (the red channel has a fixed value.) <canvas id="canvas" width="150" height="150"></canvas> var ctx = document.getelementbyid('canvas').getcontext('2d'); for (let i = 0; i < 6; i++) { for (let j = 0; j < 6; j++) { ctx.strokestyle = `rgb( 0, ${math.floor(255 - 42.5 * i)}, ${math.floor(255 - 42.5 * j)})`; ctx.begin
path(); ctx.arc(12.5 + j * 25, 12.5 + i * 25, 10, 0, math.pi * 2, true); ctx.stroke(); } } the result looks like this: screenshotlive sample specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.strokestyle' in that specification. living standard ...
CanvasRenderingContext2D.strokeText() - Web APIs
t2d method stroketext(), part of the canvas 2d api, strokes — that is, draws the outlines of — the characters of a text string at the specified coordinates. an optional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size. this method draws directly to the canvas without modifying the current
path, so any subsequent fill() or stroke() calls will have no effect on it. use the filltext() method to fill the text characters rather than having just their outlines drawn. syntax canvasrenderingcontext2d.stroketext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context. the text is rendered using the settings specified by font, textal...
CanvasRenderingContext2D.textAlign - Web APIs
right-to-left locales). the default value is "start". examples general text alignment this example demonstrates the three "physical" values of the textalign property: "left", "center", and "right". ...
Transformations - Web APIs
ransformations that have been applied (i.e. translate, rotate and scale – see below). the current values of the following attributes: strokestyle, fillstyle, globalalpha, linewidth, linecap, linejoin, miterlimit, linedashoffset, shadowoffsetx, shadowoffsety, shadowblur, shadowcolor, globalcompositeoperation, font, textalign, textbaseline, direction, imagesmoothingenabled. the current clipping
path, which we'll see in the next section. you can call the save() method as many times as you like. each time the restore() method is called, the last saved state is popped off the stack and all saved settings are restored. a save and restore canvas state example this example tries to illustrate how the stack of drawing states functions by drawing a set of consecutive rectangles. function draw()...
Canvas API - Web APIs
0, 10), and gives it a size of 150 units wide by 100 tall. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 150, 100); result reference htmlcanvaselement canvasrenderingcontext2d canvasgradient canvasimagesource canvaspattern imagebitmap imagedata renderingcontext textmetrics offscreencanvas
path2d imagebitmaprenderingcontext note: the interfaces related to the webglrenderingcontext are referenced under webgl. canvascapturemediastream is a related interface. guides and tutorials canvas tutorial a comprehensive tutorial covering both the basic usage of the canvas api and its advanced features. html5 canvas deep dive a hands-on, book-length introduction to the canvas api a...
Clients.openWindow() - Web APIs
the calling script. return value a promise that resolves to a windowclient object if the url is from the same origin as the service worker or a null value otherwise. ...
console - Web APIs
imer will report the total time for the transaction, while the time listed in the network panel is just the amount of time required for the header. if you have response body logging enabled, the time listed for the response header and body combined should match what you see in the console output. stack traces the console object also supports outputting a stack trace; this will show you the call
path taken to reach the point at which you call console.trace(). given code like this: function foo() { function bar() { console.trace(); } bar(); } foo(); the output in the console looks something like this: specifications specification status comment console api living standard initial definition. ...
ConvolverNode - Web APIs
g example shows basic usage of an audiocontext to create a convolver node. note: you will need to find an impulse response to complete the example below. see this codepen for an applied example. let audioctx = new window.audiocontext(); async function createreverb() { let convolver = audioctx.createconvolver(); // load impulse response from file let response = await fetch("
path/to/impulse-response.wav"); let arraybuffer = await response.arraybuffer(); convolver.buffer = await audioctx.decodeaudiodata(arraybuffer); return convolver; } ... let reverb = await createreverb(); // someotheraudionode -> reverb -> destination someotheraudionode.connect(reverb); reverb.connect(audioctx.destination); specifications specification status comment...
DeprecationReportBody - Web APIs
nt browser. if the date is not known, this property will return null. message a string containing a human-readable description of the deprecation, including information such as what newer feature has superceded it, if any. this typically matches the message a browser will display in its devtools console when a deprecated feature is used, if one is available. sourcefile a string containing the
path to the source file where the deprecated feature was used, if known, or null otherwise. linenumber a number representing the line in the source file in which the deprecated feature was used, if known, or null otherwise. columnnumber a number representing the column in the source file in which the deprecated feature was used, if known, or null otherwise. examples in our deprecation_report.ht...
Fetch API - Web APIs
origin header semantics, supplanting their separate definitions elsewhere. for making a request and fetching a resource, use the windoworworkerglobalscope.fetch() method. it is implemented in multiple interfaces, specifically window and workerglobalscope. this makes it available in pretty much any context you might want to fetch resources in. the fetch() method takes one mandatory argument, the
path to the resource you want to fetch. it returns a promise that resolves to the response to that request, whether it is successful or not. you can also optionally pass in an init options object as the second argument (see request). once a response is retrieved, there are a number of methods available to define what the body content is and how it should be handled (see body). you can create a reque...
Using files from web applications - Web APIs
accessing the list as an array: for (let i = 0, numfiles = filelist.length; i < numfiles; i++) { const file = filelist[i]; // ... } this loop iterates over all the files in the file list. there are three attributes provided by the file object that contain useful information about the file. name the file's name as a read-only string. this is just the file name, and does not include any
path information. size the size of the file in bytes as a read-only 64-bit integer. type the mime type of the file as a read-only string or "" if the type couldn't be determined. example: showing file(s) size the following example shows a possible use of the size property: <!doctype html> <html> <head> <meta charset="utf-8"> <title>file(s) size</title> </head> <body> <form name="uploadf...
File.fileName - Web APIs
ere may also be large incompatibilities between implementations and the behavior may change in the future. obsolete since gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. returns the name of the file. for security reasons the
path is excluded from this property. this property is deprecated. use file.name instead. syntax var name = instanceoffile.filename; value a string specification not part of any specification. ...
File.name - Web APIs
returns the name of the file represented by a file object. for security reasons, the
path is excluded from this property. syntax var name = file.name; value a string, containing the name of the file without
path, such as "my resume.rtf". example <input type="file" multiple onchange="processselectedfiles(this)"> function processselectedfiles(fileinput) { var files = fileinput.files; for (var i = 0; i < files.length; i++) { alert("filename " + files[i].name); } } try the results out below: specifications specification status comment file apithe definition of 'name' in that specification. working draft initial definition. ...
File - Web APIs
file.prototype.lastmodified read only returns the last modified time of the file, in millisecond since the unix epoch (january 1st, 1970 at midnight). file.prototype.lastmodifieddate read only returns the last modified date of the file referenced by the file object. file.prototype.nameread only returns the name of the file referenced by the file object. file.prototype.webkitrelative
path read only returns the
path the url of the file is relative to. file implements blob, so it also has the following properties available to it: file.prototype.size read only returns the size of the file in bytes. file.prototype.type read only returns the mime type of the file. instance methods the file interface doesn't define any methods, but inherits methods from the blob interfa...
FileError - Web APIs
red file or directory could not be found at the time an operation was processed. for example, a file did not exist but was being opened. not_readable_err 4 the file or directory cannot be read, typically due to permission problems that occur after a reference to a file has been acquired (for example, the file or directory is concurrently locked by another application).
path_exists_err 12 the file or directory with the same
path already exists. quota_exceeded_err 10 either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database. to ask for more storage, see managing html5 offline storage. security_err 2 access to the files were denied for one of the f...
FileException - Web APIs
or directory could not be found at the time an operation was processed. for example, a file did not exist but was being opened. not_readable_err 4 the file or directory cannot be read, typically due to permission problems that occur after a reference to a file has been acquired (for example, the file or directory is concurrently locked by another application).
path_exists_err 12 the file or directory with the same
path already exists. quota_exceeded_err 10 either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database. security_err 2 access to the files were denied for one of the following reasons: the files might be unsa...
FileReader.readAsBinaryString() - Web APIs
rd compatibility. using filereader.readasarraybuffer() is recommended. syntax instanceoffilereader.readasbinarystring(blob); parameters blob the blob or file from which to read. example var canvas = document.createelement('canvas'); var height = 200; var width = 200; canvas.width = width; canvas.height = height; var ctx = canvas.getcontext('2d'); ctx.strokestyle = '#090'; ctx.begin
path(); ctx.arc(width/2, height/2, width/2 - width/10, 0, math.pi*2); ctx.stroke(); canvas.toblob(function (blob) { var reader = new filereader(); reader.onload = function () { console.log(reader.result); } reader.readasbinarystring(blob); }); specifications specification status comment file apithe definition of 'readasbinarystring' in that specification. ...
FileReader - Web APIs
to read. file objects may be obtained from a filelist object returned as a result of a user selecting files using the <input> element, from a drag and drop operation's datatransfer object, or from the mozgetasfile() api on an htmlcanvaselement. important note: filereader is used to read file content from the user's (remote) system in secure ways only. it cannot be used to simply read a file by
pathname from a file system. to read files by
pathname in javascript, standard ajax solutions should be used to do server-side file reading, with cors permission if reading cross-domain. note: this feature is available in web workers. constructor filereader() returns a newly constructed filereader. see using files from web applications for details and examples. properties filereader.error...
FileSystemEntry.getParent() - Web APIs
which is executed if an error occurs. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_state_err the operation failed because the file system's state doesn't permit it. this can happen, for example, if the file system's cached state differs from the actual state of the file system. fileerror.not_found_err the specified
path could not be found. fileerror.security_err security restrictions prohibit obtaining the parent directory's information. example this example renames the file specified by the variable fileentry to "newname.html". fileentry.getparent(function(parent) { fileentry.moveto(parent, "newname.html", function(updatedentry) { console.log("file " + fileentry.name + " renamed to newname.html.");...
FileSystemEntry.name - Web APIs
syntax var name = filesystementry.name; value a usvstring indicating the entry's name. example this example shows a function called isfilewithextension() which returns true if the specified filesystementry is both a file and the file's name ends with a given extension. ...
HTMLAnchorElement.referrerPolicy - Web APIs
errer is sent when fetching the resource. syntax refstr = anchorelt.referrerpolicy; anchorelt.referrerpolicy = refstr; values "no-referrer" meaning that the referer: http header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the
path (but not the fragment, password, or username). this case is unsafe as it can leak
path information that has been concealed to third-party by using tls. examples var elt = document.createelement("a"); var linktext = document.createtextnode("my link"); elt.appendchild(linktext); elt.href = "https://developer.mozilla.org/"; elt.referrerpolicy = "no-referrer"; var div = document.getelementbyi...
HTMLAreaElement.referrerPolicy - Web APIs
referrer is sent when fetching the resource. syntax refstr = areaelt.referrerpolicy; areaelt.referrerpolicy = refstr; values "no-referrer" meaning that the referer: http header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the
path (but not the fragment, password, or username). this case is unsafe as it can leak
path information that has been concealed to third-party by using tls. examples <img usemap="#maparound" width="100" height="100" src="/img/logo@2x.png" /> <map id="mymap" name="maparound" />> var elt = document.createelement("area"); elt.href = "/img2.png"; elt.shape = "rect"; elt.referrerpolicy = "no-referr...
HTMLHyperlinkElementUtils - Web APIs
, if the port of the url is not empty (which can happen because it was not specified or because it was specified to be the default port of the url's scheme), a ':', and the port of the url. htmlhyperlinkelementutils.hostname this is a usvstring containing the domain of the url. htmlhyperlinkelementutils.port this is a usvstring containing the port number of the url. htmlhyperlinkelementutils.
pathname this is a usvstring containing an initial '/' followed by the
path of the url. htmlhyperlinkelementutils.search this is a usvstring containing a '?' followed by the parameters of the url. htmlhyperlinkelementutils.hash this is a usvstring containing a '#' followed by the fragment identifier of the url. htmlhyperlinkelementutils.username this is a usvstring containing the username speci...
HTMLIFrameElement.referrerPolicy - Web APIs
a less secure destination (https→http). strict-origin-when-cross-origin send a full url when performing a same-origin request, only send the origin when the protocol security level stays the same (https→https), and send no header to a less secure destination (https→http). unsafe-url send a full url when performing a same-origin or cross-origin request. this policy will leak origins and
paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. examples var iframe = document.createelement("iframe"); iframe.src = "/"; iframe.referrerpolicy = "unsafe-url"; var body = document.getelementsbytagname("body")[0]; body.appendchild(iframe); // fetch the image using the complete url as the referrer specifications specification sta...
HTMLImageElement.referrerPolicy - Web APIs
gelt.referrerpolicy; imgelt.referrerpolicy = refstr; values a domstring representing the referrer policy. possible values are: "no-referrer" meaning that the referer: http header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the
path (but not the fragment, password, or username). this case is unsafe as it can leak
path information that has been concealed to third-party by using tls. examples var img = new image(); img.src = 'img/logo.png'; img.referrerpolicy = 'origin'; var div = document.getelementbyid('divaround'); div.appendchild(img); // fetch the image using the origin as the referrer specifications s...
HTMLObjectElement - Web APIs
hive is a domstring that reflects the archive html attribute, containing a list of archives for resources for this object. htmlobjectelement.border is a domstring that reflects the border html attribute, specifying the width of a border around the object. htmlobjectelement.code is a domstring representing the name of an applet class file, containing either the applet's subclass, or the
path to get to the class, including the class file itself. htmlobjectelement.codebase is a domstring that reflects the codebase html attribute, specifying the base
path to use to resolve relative uris. htmlobjectelement.codetype is a domstring that reflects the codetype html attribute, specifying the content type of the data. htmlobjectelement.contentdocument read only returns a document re...
HTMLScriptElement.referrerPolicy - Web APIs
destination (e.g. https→http). strict-origin-when-cross-origin send a full url when performing a same-origin request, only send the origin when the protocol security level stays the same (e.g. https→https), and send no header to a less secure destination (e.g. https→http). unsafe-url send a full url when performing a same-origin or cross-origin request. this policy will leak origins and
paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. note: an empty string value ("") is both the default value, and a fallback value if referrerpolicy is not supported. if referrerpolicy is not explicitly specified on the <script> element, it will adopt a higher-level referrer policy, i.e. one set on the whole document or domain. if a higher-level ...
Using microtasks in JavaScript with queueMicrotask() - Web APIs
queue); messagequeue.length = 0; fetch("url-of-receiver", json); }); } }; when sendmessage() gets called, the specified message is first pushed onto the message queue array. then things get interesting. if the message we just added to the array is the first one, we enqueue a microtask that will send a batch. the microtask will execute, as always, when the javascript execution
path reaches the top level, just before running callbacks. that means that any further calls to sendmessage() made in the interim will push their messages onto the message queue, but because of the array length check before adding a microtask, no new microtask is enqueued. when the microtask runs, then, it has an array of potentially many messages waiting for it. it starts by encoding it as json usin...
The HTML DOM API - Web APIs
dataevent htmlformcontrolscollection htmloptionscollection radionodelist validitystate canvas and image interfaces these interfaces represent objects used by the canvas api as well as the <img> element and <picture> elements. canvasgradient canvaspattern canvasrenderingcontext2d imagebitmap imagebitmaprenderingcontext imagedata offscreencanvas offscreencanvasrenderingcontext2d
path2d textmetrics media interfaces the media interfaces provide html access to the contents of the media elements: <audio> and <video>. audiotrack audiotracklist mediaerror texttrack texttrackcue texttrackcuelist texttracklist timeranges trackevent videotrack videotracklist drag and drop interfaces these interfaces are used by the html_drag_and_drop_api to represent individual ...
Recommended Drag Types - Web APIs
meprimitive.value.queryinterface(components.interfaces.nsisupportsstring).data; console.log("target filename is = " + name); var dirprimitive = {}; atransferable.gettransferdata('application/x-moz-file-promise-dir', dirprimitive, datasize); var dir = dirprimitive.value.queryinterface(components.interfaces.nsilocalfile); console.log("target folder is = " + dir.
path); var file = cc['@mozilla.org/file/local;1'].createinstance(components.interfaces.nsilocalfile); file.initwith
path(dir.
path); file.appendrelative
path(name); console.log("output final
path is =" + file.
path); // now you can write or copy the file yourself… } } } see also html drag and drop api (overview) drag operations dragging and dropping mul...
IDBCursor.source - Web APIs
ing over. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. within each iteration we log the source of the cursor, which will log our idbobjectstore object to the console, something like this: idbobjectstore {autoincrement: false, transaction: idbtransaction, indexnames: domstringlist, key
path: "albumtitle", name: "rushalbumlist"…} the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db...
IDBCursor.update() - Web APIs
ansactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read only. invalidstateerror the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end. dataerror the underlying object store uses in-line keys and the property in the value at the object store's key
path does not match the key in this cursor's position. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. if the albumtitle of the current cursor is "a farewell to kings",...
IDBCursorSync - Web APIs
al of the cursor. see constants for possible values. key readonly any the key for the record at the cursor's position. value any the value for the record at the cursor's position. setting this attribute can raise an idbdatabaseexception with the following codes: data_err if the underlying object store uses in-line keys and the property at the key
path does not match the key in this cursor's position. not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode, or if an index record cannot be changed because the underlying index is auto-populated. serial_err if the data being stored could not be serialized by the internal structured cl...
IDBDatabase - Web APIs
ion number has been // submitted via the window.indexeddb.open line above dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database using // idbdatabase.createobjectstore var objectstore = db.createobjectstore("todolist", { key
path: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); ob...
IDBIndex.multiEntry - Web APIs
this is decided when the index is created, using the idbobjectstore.createindex method. this method takes an optional options parameter whose multientry property is set to true/false. note: this feature is available in web workers. syntax var ismultientry = myindex.multientry; value a boolean: value effect true there is one record in the index for each item in an array of keys. ...
IDBIndex.objectStore - Web APIs
database. we then open a basic cursor on the index using idbindex.opencursor. this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the current object store is logged to the console: it should be returned something like this: idbobjectstore { name: "contactslist", key
path: "id", indexnames: domstringlist[7], transaction: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table. for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var ob...
IDBObjectStore.add() - Web APIs
ectstore's transaction is inactive. dataerror any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was provided. the object store uses out-of-line keys and has no key generator, and no key parameter was provided. the object store uses in-line keys but no key generator, and the object store's key
path does not yield a valid key. the key parameter was provided but does not contain a valid key. invalidstateerror the idbobjectstore has been deleted or removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. constrainterror an insert operation failed because the primary key constraint was...
IDBObjectStore.deleteIndex() - Web APIs
ew version number has been submitted via the // window.indexeddb.open line above //it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { key
path: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); ...
IDBObjectStore.put() - Web APIs
ectstore's transaction is inactive. dataerror any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was provided. the object store uses out-of-line keys and has no key generator, and no key parameter was provided. the object store uses in-line keys but no key generator, and the object store's key
path does not yield a valid key. the key parameter was provided but does not contain a valid key. invalidstateerror the idbobjectstore has been deleted or removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. parameters value the value to be stored. key the key to use to identify the reco...
IDBOpenDBRequest.onblocked - Web APIs
}; request.onblocked = function() { console.log("your database version can't be upgraded because the app is open somewhere else."); } specifications specification status comment indexed database api 2.0the definition of 'onblocked' in that specification. recommendation indexed database api draftthe definition of 'onblocked' in ...
IDBOpenDBRequest.onupgradeneeded - Web APIs
efore, or a new version number has been submitted via the // window.indexeddb.open line above. request.onupgradeneeded = function(event) { db = request.result; db.onerror = function(errorevent) { note.innerhtml += '<li>error loading database.</li>'; }; if (event.oldversion < 1) { // version 1 is the first version of the database. var store = db.createobjectstore("books", {key
path: "isbn"}); var titleindex = store.createindex("by_title", "title", {unique: true}); var authorindex = store.createindex("by_author", "author"); } if (event.oldversion < 2) { // version 2 introduces a new index of books by year. var bookstore = request.transaction.objectstore("books"); var yearindex = bookstore.createindex("by_year", "year"); } if (event.oldversion < 3)...
IDBOpenDBRequest - Web APIs
w version number has been // submitted via the window.indexeddb.open line above // it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { key
path: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); ...
ImageBitmap - Web APIs
properties imagebitmap.height read only is an unsigned long representing the height, in css pixels, of the imagedata. ...
compareVersion - Web APIs
ting file or package. method of installtrigger object syntax int compareversion ( string registryname, installversion version); int compareversion ( string registryname, string version); int compareversion ( string registryname, int major, int minor, int release, int build); parameters the compareversion method has the following parameters: registryname the
pathname in the client version registry for the component whose version is to be compared. this parameter can be an absolute
pathname, such as /royalairways/royalsw or a relative
pathname, such as plugsin/royalairway/royalsw. note that the registry
pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry. ver...
install - Web APIs
allation, use the optional callback function and its status parameter, as in the example below. description in the example below, a special javascript object constructor is used to create an object that can be passed to the install() method. the { } constructor takes a comma-delimited set of label/value pairs. for installations, these pairs are the xpinstall confirm dialog display name and the
path of the xpi, respectively. in the example below, a single installation object is created, but you can use this approach to create multiple installations to pass to a single install. as with the older startsoftwareupdate method, xpis installed with this method must have their own install.js files in which the full installation is defined. in contrast to startsoftwareupdate, install allows you t...
Timing element visibility with the Intersection Observer API - Web APIs
ing ad. if no value is specified for replacebox, we create a new ad element. the ad's new <div> element is created and its properties established by setting its class name to "ad". next, the ad title element is created, along with the body and the visibility timer; these are an <h2>, a <p>, and a <div> element, respectively. these elements are appended to the adbox element. after that, the code
paths converge once again. the ad's background color is set to the value specified in the new ad's record, and elements' classes and contents are set appropriately as well. next, it's time to set up the custom data properties to track the ad's visibility data by setting adbox.dataset.totalviewtime and adbox.dataset.lastviewstarted to 0. finally, we set the id of the <div> which will show the timer w...
InterventionReportBody - Web APIs
t generated the report. this can be used to group reports by deprecated feature. message a string containing a human-readable description of the intervention, including information such how the intervention could be avoided. this typically matches the message a browser will display in its devtools console when an intervention is imposed, if one is available. sourcefile a string containing the
path to the source file where the intervention occurred, if known, or null otherwise. linenumber a number representing the line in the source file in which the intervention occurred, if known, or null otherwise. columnnumber a number representing the column in the source file in which the intervention occurred, if known, or null otherwise. examples let options = { types: ['intervention'], b...
MouseEvent.region - Web APIs
t region is affected, null is returned. syntax var hitregion = instanceofmouseevent.region return value a domstring representing the id of the hit region. ...
msPlayToPreferredSourceUri - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msplaytopreferredsourceuri is a read/write property which gets or sets the
path to the preferred media source. this enables the playto target device to stream the media content, which can be drm protected, from a different location, such as a cloud media server. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytopreferredsourceuri; value msplaytopreferredsourceuri enables a playto reference (a uri or url) for streaming content on the pl...
PaintWorklet.registerPaint - Web APIs
let, at worklet.addmodule(). /* checkboardworklet.js */ class checkerboardpainter { paint(ctx, geom, properties) { // use `ctx` as if it was a normal canvas const colors = ['red', 'green', 'blue']; const size = 32; for(let y = 0; y < geom.height/size; y++) { for(let x = 0; x < geom.width/size; x++) { const color = colors[(x + y) % colors.length]; ctx.begin
path(); ctx.fillstyle = color; ctx.rect(x * size, y * size, size, size); ctx.fill(); } } } } // register our class under a specific name registerpaint('checkerboard', checkerboardpainter); the first step in using a paintworket is defining the paint worklet using the registerpaint() function, as done above. to use it, you register it with the css.paintworklet.addmo...
PaintWorklet - Web APIs
erpaint() is called without a reference to paintworklet. class checkerboardpainter { paint(ctx, geom, properties) { // use `ctx` as if it was a normal canvas const colors = ['red', 'green', 'blue']; const size = 32; for(let y = 0; y < geom.height/size; y++) { for(let x = 0; x < geom.width/size; x++) { const color = colors[(x + y) % colors.length]; ctx.begin
path(); ctx.fillstyle = color; ctx.rect(x * size, y * size, size, size); ctx.fill(); } } } } // register our class under a specific name registerpaint('checkerboard', checkerboardpainter); load a paintworklet the following example demonstrates loading the above worklet from its js file and does so by feature detection. <script> if ('paintworklet' in css) { ...
Pointer Lock API - Web APIs
if you lock one iframe, you cannot try to lock another iframe and transfer the target to it; pointer lock will error out. to avoid this limitation, first unlock the locked iframe, and then lock the other. while iframes work by default, "sandboxed" iframes bloc...
Request.cache - Web APIs
ponse to conserve as much bandwidth as possible. fetch("some.json", {cache: "force-cache"}) .then(function(response) { /* consume the response */ }); // naive stale-while-revalidate client-level implementation. // prefer a cached albeit stale response; but update if it's too old. // abortcontroller and signal to allow better memory cleaning. ...
Request.destination - Web APIs
ead-only property of the request interface returns a string describing the type of content being requested. the string must be one of those found in the requestdestination enumerated type or the empty string, which is the default value. the destination is used by the user agent to, for example, help determine which set of rules to follow for cors purposes, or how to navigate any complicated code
paths that affect how specific types of request get handled. these destinations vary substantially in how they operate. some are simply data receptacles, where the received data is stored for processing later. others are script-based, in which case the received data is delivered to a script by calling it and passing the data along. script-based destinations include <script> elements, as well as any o...
Response.clone() - Web APIs
e response body has already been used. in fact, the main reason clone() exists is to allow multiple uses of body objects (when they are one-use only.) syntax var response2 = response1.clone(); parameters none. value a response object. example in our fetch response clone example (see fetch response clone live) we create a new request object using the request() constructor, passing it a jpg
path. we then fetch this request using fetch(). when the fetch resolves successfully, we clone it, extract a blob from both responses using two body.blob calls, create object urls out of the blobs using url.createobjecturl, and display them in two separate <img> elements. var image1 = document.queryselector('.img1'); var image2 = document.queryselector('.img2'); var myrequest = new request('flowers.
Response.headers - Web APIs
the headers read-only property of the response interface contains the headers object associated with the response. syntax var myheaders = response.headers; value a headers object. example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg
path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>. note that at the top of the fetch() block we log the response headers value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.headers); // returns a headers{} ob...
Response.ok - Web APIs
the ok read-only property of the response interface contains a boolean stating whether the response was successful (status in the range 200-299) or not. syntax var myok = response.ok; value a boolean. example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg
path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>. note: at the top of the fetch() block we log the response ok value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.ok); // returns true ...
Response.status - Web APIs
the status read-only property of the response interface contains the status code of the response (e.g., 200 for a success). syntax var mystatus = response.status; value a number (to be precise, an unsigned short). example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg
path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>. note that at the top of the fetch() block we log the response status value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.st...
Response.statusText - Web APIs
the statustext read-only property of the response interface contains the status message corresponding to the status code (e.g., ok for 200). syntax var mystatustext = response.statustext; value a bytestring. the default value is "". example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg
path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>. note that at the top of the fetch() block we log the response statustext value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { ...
Response.type - Web APIs
null and trailer is empty. note: an "error" response never really gets exposed to script: such a response to a fetch() would reject the promise. syntax var mytype = response.type; value a responsetype string indicating the type of the response. example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg
path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>. note that at the top of the fetch() block we log the response type to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) {...
Response.url - Web APIs
the url read-only property of the response interface contains the url of the response. the value of the url property will be the final url obtained after any redirects. syntax var myurl = response.url; value a usvstring. example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg
path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>. note that at the top of the fetch() block we log the response url to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.url...
SVGGeometryElement.getPointAtLength() - Web APIs
the svggeometryelement.getpointatlength() method returns the point at a given distance along the
path. note: this method was originally part of the svg
pathelement interface. svg 2 introduced the svggeometryelement interface and moved the property to it. syntax dompoint someelement.getpointatlength(float distance); parameters distance a float referring to the distance along the
path. return value a dompoint indicating the point at a given distance along the
path. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svggeometryelement.gettotallength()' in that specification. candidate recommendation initial definition ...
SVGGeometryElement.getTotalLength() - Web APIs
the svggeometryelement.gettotallength() method returns the user agent's computed value for the total length of the
path in user units. note: this method was originally part of the svg
pathelement interface. svg 2 introduced the svggeometryelement interface and moved the property to it. syntax float someelement.gettotallength(); return value a float indicating the total length of the
path in user units. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svggeometryelement.gettotallength()' in that specification. candidate recommendation initial definition ...
SVGMarkerElement - Web APIs
svg
path segment interface the svgmarkerelement interface corresponds to the marker element. interface overview also implement none methods void setorienttoangle(in svgangle angle) void setorienttoauto() properties svganimatedlength refx svganimatedlength refy svganimatedenumeration markerunits svganimatedlength markerwidth svganimatedlength markerheight svganimatedenumeration orienttype svganimatedangle orientangle constants ...
SVGTextContentElement - Web APIs
the svgtextcontentelement interface is implemented by elements that support rendering child text content. it is inherited by various text-related interfaces, such as svgtextelement, svgtspanelement, svgtrefelement, svgaltglyphelement and svgtext
pathelement. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" ...
Using Service Workers - Web APIs
your app online in the normal expected fashion. furthermore, if you use appcache and sw on a page, browsers that don’t support sw but do support appcache will use that, and browsers that support both will ignore the appcache and let sw take over. why is my service worker failing to register? this could be for the following reasons: you are not running your application through https. the
path to your service worker file is not written correctly — it needs to be written relative to the origin, not your app’s root directory. in our example, the worker is at https://mdn.github.io/sw-test/sw.js, and the app’s root is https://mdn.github.io/sw-test/. but the
path needs to be written as /sw-test/sw.js, not /sw.js. the service worker being pointed to is on a different origin to that of...
Service Worker API - Web APIs
ther things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. they will also allow access to push notifications and background sync apis. service worker concepts and usage a service worker is an event-driven worker registered against an origin and a
path. it takes the form of a javascript file that can control the web-page/site that it is associated with, intercepting and modifying navigation and resource requests, and caching resources in a very granular fashion to give you complete control over how your app behaves in certain situations (the most obvious one being when the network is not available). a service worker is run in a worker context:...
SpeechRecognition.serviceURI - Web APIs
the serviceuri property of the speechrecognition interface specifies the location of the speech recognition service used by the current speechrecognition to handle the actual recognition. the default is the user agent's default speech service. syntax var myserviceuri = myspeechrecognition.serviceuri; myspeechrecognition.serviceuri = '
path/to/my/service/'; value a domstring representing the uri of the speech recognition service. examples var recognition = new speechrecognition(); recognition.serviceuri = 'http://www.example.com'; ... ...
TextMetrics - Web APIs
mheightdescent', 'actualboundingboxdescent', 'fontboundingboxdescent']; const baselines = [...baselinesabovealphabetic, ...baselinesbelowalphabetic]; ctx.font = '25px serif'; ctx.strokestyle = 'red'; baselines.foreach(function (baseline, index) { let text = 'abcdefghijklmnop (' + baseline + ')'; let textmetrics = ctx.measuretext(text); let y = 50 + index * 50; ctx.begin
path(); ctx.filltext(text, 0, y); let liney = y - math.abs(textmetrics[baseline]); if (baselinesbelowalphabetic.includes(baseline)) { liney = y + math.abs(textmetrics[baseline]); } ctx.moveto(0, liney); ctx.lineto(550, liney); ctx.stroke(); }); result measuring text width when measuring the x-direction of a piece of text, the sum of actualboundingboxleft and actualboundingboxr...
URL API - Web APIs
o addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. more interesting to most developers is the api itself. accessing url components creating an url object for a given url parses the url and provides quick access to its constituent parts through its properties. let addr = new url("/docs/web/api/url_api"); let host = addr.host; let
path = addr.
pathname; the snippet above creates a url object for the article you're reading right now, then fetches the host and
pathname properties. in this case, those strings are developer.mozilla.org and /docs/web/api/url_api, respectively. changing the url most of the properties of url are settable; you can write new values to them to alter the url represented by the object. for example, to c...
WebGL best practices - Web APIs
2^8] [0, 2^9] prefer builtins like dot, mix, and normalize instead of buiding your own at best, custom implementations of builtins might run as fast as the builtins they replace, but don't expect them to. hardware often has hyper-optimized or even specialized instructions for builtins, and the compiler can't reliably replace your custom builtin-replacements with the special builtin code
paths. textures use mipmaps for any texture you'll see in 3d! when in doubt, call generatemipmaps() after texture uploads. mipmaps are cheap on memory (only 30% overhead) while providing often-large performance advantages when textures are "zoomed out" or generally downscaled in the distance in 3d, or even for cube-maps! it's quicker to sample from smaller texture images due to better inherent tex...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
e 3d camera is used to simply set the apparent size and perspective when rendering things such as graphs and charts. in mapping applications, the camera may either be placed directly over the scene, or might use various angles to show perspective. for 3d gps solutions, the camera is positioned to show the area around the user, with the majority of the display showing the area ahead of the user's
path of motion. when using webgl to accelerate 2d graphics drawing, the camera is typically placed directly above the center of the scene with the distance and field of view set to allow the entire scene to be presented. when accelerating bitmapped graphics, the renderer would draw the 2d image into a webgl texture's buffer, then redraw the texture to refresh the screen. this essentially uses the te...
Inputs and input sources - Web APIs
ace the xrspace used to describe the position and orientation of the target ray is found in the targetrayspace property. this space's native origin is located at the point from which the target ray is emitted (such as the front tip of the controller, or the end of a gun barrel if the controller is being rendered as a gun, for example), and the space's orientation vector extends outward along the
path of the target ray. you can easily obtain the target ray corresponding to the targetrayspace from within the drawing handler for a given frame using xrframe's getpose() method. the returned xrpose's transform is the transform corresponding to the target ray. thus, for an input controller primaryinput: let targetraypose = frame.session.getpose(primaryinput.targetrayspace, v...
Rendering and the WebXR frame animation callback - Web APIs
oved] is a vector representing the velocity of the object. additional tasks related to animating the scene there are, of course, other things that probably need to happen each pass through the renderer. two of the most common are handling of user inputs and performing updates to the positions of objects (or the viewer) based on known factors, such as those user control states or known animation
paths of the objects in the scene. handling user control inputs there are three methods by which users might provide input while using a webxr application. first, webxr supports directly handling inputs from the controllers which are integrated with the xr hardware itself. these input sources may include devices such as hand controllers, optical tracking systems, acclerometers and magnetometers, and...
Using the Web Storage API - Web APIs
value to store in it. function populatestorage() { localstorage.setitem('bgcolor', document.getelementbyid('bgcolor').value); localstorage.setitem('font', document.getelementbyid('font').value); localstorage.setitem('image', document.getelementbyid('image').value); setstyles(); } the populatestorage() function sets three items in local storage — the background color, font, and image
path. it then runs the setstyles() function to update the page styles, etc. we've also included an onchange handler on each form element so that the data and styling are updated whenever a form value is changed: bgcolorform.onchange = populatestorage; fontform.onchange = populatestorage; imageform.onchange = populatestorage; responding to storage changes with the storageevent the storageevent is f...
Window.screenLeft - Web APIs
t; initialtop = window.screentop + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.begin
path(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.requestanimationframe(positionelem); } window.requestanimationframe(positionelem); also in the code we include a snippet that detects whether screenleft is s...
Window.screenTop - Web APIs
t; initialtop = window.screentop + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.begin
path(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.requestanimationframe(positionelem); } window.requestanimationframe(positionelem); also in the code we include a snippet that detects whether screenleft is s...
Worker.prototype.postMessage() - Web APIs
icated worker). note: postmessage() can only send a single object at once. as seen above, if you want to pass multiple values you can send an array. transfer example this example shows a firefox add-on that transfers an arraybuffer from the main thread to the chromeworker, and then the chromeworker transfers it back to the main thread. ...
Worker - Web APIs
workers may themselves spawn new workers, as long as those workers are hosted at the same origin as the parent page. (note: nested workers are not yet implemented in webkit). not all interfaces and functions are available to scripts inside a worker. ...
WorkerGlobalScope.location - Web APIs
llowing in a document served at localhost:8000 console.log(location); inside a worker (which would basically be the equivalent of self.console.log(self.location);, as these are being called on the worker scope, which can be referenced with workerglobalscope.self), you will get a workerlocation object written to the console — something like the following: workerlocation {hash: "", search: "",
pathname: "/worker.js", port: "8000", hostname: "localhost"…} hash: "" host: "localhost:8000" hostname: "localhost" href: "http://localhost:8000/worker.js" origin: "http://localhost:8000"
pathname: "/worker.js" port: "8000" protocol: "http:" search: "" __proto__: workerlocation you could use this location object to return more information about the document's location, as you mi...
WorkerLocation - Web APIs
er. urlutilsreadonly.hostname read only is a domstring containing the domain of the url of the script executed in the worker. urlutilsreadonly.origin read only returns a domstring containing the canonical form of the origin of the specific location. urlutilsreadonly.port read only is a domstring containing the port number of the url of the script executed in the worker. urlutilsreadonly.
pathname read only is a domstring containing an initial '/' followed by the
path of the url of the script executed in the worker. urlutilsreadonly.search read only is a domstring containing a '?' followed by the parameters of the url of the script executed in the worker. urlutilsreadonly.hash read only is a domstring containing a '#' followed by the fragment identifier of the url of the script...
Accessibility: What users can do to browse more safely - Accessibility
otosensitive epilepsy, and uses it when feeling "seizure-y". most operating systems have a way to let the user make an adjustment on the workstation. in the screenshot below, you can see an example of windows 10 accessibility settings allowing for color filters to be selected. grayscale is enabled when the color filters button is toggled "on" see also accessibilty accessibility learning
path web accessibility for seizures and physical reactions color blindness discussion: "what is the “grayscale” setting for in accessibility options?" contributors many, many thanks to eric eggert from knowbility; for his discussions and huge help on this topic. ...
Keyboard-navigable JavaScript widgets - Accessibility
dex value determines where this element is positioned in the tab order: smaller values will position elements earlier in the tab order than larger values (for example, tabindex="7" will be positioned before tabindex="11"). non-native controls native html elements that are interactive, like <a>, <input> and <select>, are already accessible by keyboards, so to use one of them is the fastest
path to make components work with keyboards. authors can also make a <div> or <span> keyboard accessible by adding a tabindex of 0. this is particularly useful for components that use interactive elements that do not exist in html. grouping controls for grouping widgets such as menus, tablists, grids, or tree views, the parent element should be in the tab order (tabindex="0"), and each descendent c...
Web Accessibility: Understanding Colors and Luminance - Accessibility
or spectrum, they are sometimes used interchangably. sometimes the "l" in hsl stands for luminance, and sometimes, for luminosity -- and also, has been referred to as "lightness" luminance and brightness are not the same. brightness is a perception. luminance and lightness are not the same. luminance and reflected light are not the same. see also mdn accessibilty accessibility learning
path color <color> web accessibility for seizures and physical reactions color blindness discussions (general) what is the “grayscale” setting for in accessibility options? the color red how the color red influences our behavior scientific american by susana martinez-conde, stephen l. macknik on november 1, 2014 scientific papers photic- and pattern-induced seizures: expert con...
Operable - Accessibility
eract with digital technology using different input methods beyond a keyboard or mouse (including touchscreen, voice, device motion, or alternative input devices. success criteria how to conform to the criteria practical resource 2.5.1 pointer gestures (a) added in 2.1 all functionality that can be operated with a pointer can be operated with single-point actions.
path-based or multi-point gestures are not required to operate any functionality. exceptions exist. understanding pointer gestures 2.5.2 pointer cancellation (a) added in 2.1 for functionality that can be operated using a single-pointer at least one of the following is true: no down-event, abort/undo, up reversal or essential. understanding pointer cancellation 2.5.3 label i...
Perceivable - Accessibility
ls, see ui controls. implement decorative (non-content) images, video, etc., in a way that is invisible to assistive technology, so it doesn't confuse users. decorative images should be implemented using css background images (see backgrounds). if you have to include an image via an <img> element, give it a blank alt (alt=""). otherwise, screenreaders may try to read out the file
path, etc. if you are including background video or audio that autoplays, make it as unobtrusive as possible. don't make it look/sound like content, and provide a control to turn it off. ideally, don't include it at all. note: also see the wcag description for guideline 1.1: text alternatives. guideline 1.2 — providing text alternatives for time-based media time-based media refer...
font-display - CSS: Cascading Style Sheets
d, it is used normally. font failure period if the font face is not loaded, the user agent treats it as a failed load causing normal font fallback. formal definition related at-rule@font-faceinitial valueautocomputed valueas specified formal syntax [ auto | block | swap | fallback | optional ] examples specifying fallback font-display @font-face { font-family: examplefont; src: url(/
path/to/fonts/examplefont.woff) format('woff'), url(/
path/to/fonts/examplefont.eot) format('eot'); font-weight: 400; font-style: normal; font-display: fallback; } specifications specification status comment css fonts module level 4the definition of 'font-display' in that specification. working draft initial definition ...
CSS Masking - CSS: Cascading Style Sheets
css masking is a css module that defines means, including masking and clipping, for partially or fully hiding portions of visual elements. reference properties clip clip-
path clip-rule mask mask-border mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size mask-type specifications specification status comment css masking module level 1 candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'mask' in that specification. recommendation initial definition ...
The stacking context - CSS: Cascading Style Sheets
xbox) container, with z-index value other than auto. element that is a child of a grid (grid) container, with z-index value other than auto. element with a opacity value less than 1 (see the specification for opacity). element with a mix-blend-mode value other than normal. element with any of the following properties with value other than none: transform filter perspective clip-
path mask / mask-image / mask-border element with a isolation value isolate. element with a -webkit-overflow-scrolling value touch. element with a will-change value specifying any property that would create a stacking context on non-initial value (see this post). element with a contain value of layout, or paint, or a composite value that includes either of them (i.e. contain: strict, conta...
Basic Shapes - CSS: Cascading Style Sheets
reference box. in the example below i have created a shape for text to follow using the polygon(), you can change any of the values to see how the shape is changed. you may well find the firefox shape inspector very useful here to create your polygon shape. the screenshot below shows the shape highlighted in the tool. another useful resource is clippy - a tool for creating shapes for clip-
path, as the values for basic shapes are the same as those used for clip-
path. ...
CSS Shapes - CSS: Cascading Style Sheets
with a value of circle(50%). this creates a circle shape, and the content wrapping the float now wraps around that shape. this changes the length of the wrapping text's line boxes. reference properties shape-image-threshold shape-margin shape-outside data types <basic-shape> guides overview of css shapes shapes from box values basic shapes shapes from images edit shape
paths in css — firefox developer tools external resources a list of css shapes resources css shapes 101 creating non-rectangular layouts with css shapes how to use css shapes in your web design how to get started with css shapes what i learned in one weekend with css shapes css vs. svg: shapes and arbitrarily-shaped ui components specifications specification status comme...
Cookbook template - CSS: Cascading Style Sheets
template page for a css cookbook page. please use this as a raw template when you create a new cookbook page. comment in italics are information about how to use part of the template. description of the problem this recipe solves or the pattern you are demonstrating. requirements what does this pattern need to include, or what problems does it need to solve? list that here. recipe change the
path to the example below to point to your merged example. the last parameter is the live example height, which you can change as needed. change the link to point to your merged download version. download the example choices made explain your decisions when creating the pattern. why did you choose a certain method? if you want to add an additional example here — for example a version with fall...
Mozilla CSS extensions - CSS: Cascading Style Sheets
art [superseded by the standard version border-inline-start] -moz-border-start-color [superseded by the standard version border-inline-start-color] -moz-border-start-style [superseded by the standard version border-inline-start-style] -moz-border-start-width [superseded by the standard version border-inline-start-width] -moz-box-sizing [prefixed version still accepted] c clip-
path [applying to more than svg] -moz-column-count [prefixed version still accepted] -moz-column-fill [prefixed version still accepted] -moz-column-gap [prefixed version still accepted] -moz-column-width [prefixed version still accepted] -moz-column-rule [prefixed version still accepted] -moz-column-rule-width [prefixed version still accepted] -moz-column-rule-style [prefixed ve...
WebKit CSS extensions - CSS: Cascading Style Sheets
-timing-function b -webkit-backface-visibility -webkit-background-clip -webkit-background-origin -webkit-background-size -webkit-border-bottom-left-radius -webkit-border-bottom-right-radius -webkit-border-image -webkit-border-radius -webkit-border-top-left-radius -webkit-border-top-right-radius -webkit-box-decoration-break -webkit-box-shadow -webkit-box-sizing c -webkit-clip-
path -webkit-column-count -webkit-column-fill -webkit-column-gap -webkit-column-rule -webkit-column-rule-color -webkit-column-rule-style -webkit-column-rule-width -webkit-column-span -webkit-column-width -webkit-columns f -webkit-filter -webkit-flex -webkit-flex-basis -webkit-flex-direction -webkit-flex-flow -webkit-flex-grow -webkit-flex-shrink -webkit-flex-wrap -webkit-font-fe...
box-decoration-break - CSS: Cascading Style Sheets
across multiple lines, columns, or pages. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the specified value will impact the appearance of the following properties: background border border-image box-shadow clip-
path margin padding syntax /* keyword values */ box-decoration-break: slice; box-decoration-break: clone; /* global values */ box-decoration-break: initial; box-decoration-break: inherit; box-decoration-break: unset; the box-decoration-break property is specified as one of the keyword values listed below. values slice the element is initially rendered as if its box were not fragmented, af...
CSS: Cascading Style Sheets
ning area features multiple modules that teach css from the ground up — no previous knowledge required. css first steps css (cascading style sheets) is used to style and layout web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your
path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. css building blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. this module looks at the cascade and inhe...
Demos of open web technologies
le videos 3d graphics webgl web audio fireworks ioquake3 (source code) escher puzzle (source code) kai 'opua (source code) virtual reality the polar sea (source code) sechelt fly-through (source code) css css zen garden css floating logo "mozilla" paperfold css blockout rubik's cube pure css slides planetarium (source code) loader with blend modes text reveal with clip-
path ambient shadow with custom properties luminiscent vial css-based single page application (source code) transformations impress.js (source code) games ioquake3 (source code) kai 'opua (source code) web apis notifications api html5 notifications (source code) web audio api web audio fireworks oscope.js - javascript oscilloscope html5 web audio showcase (source code)...
exsl:node-set() - EXSLT
this lets you process the xml created within a variable to process it in multiple steps. you can also use exsl:node-set() to turn strings into text nodes. syntax exsl:node-set(object) parameters object the object for which to return the corresponding node-set. returns the node-set corresponding to the specified object. ...
exsl:object-type() - EXSLT
note: most xslt object types can be coerced into each other safely; however, certain coercsions to raise error conditions. in particular, treating something that's not a node-set as a node-set will do so. this function lets authors of named templates and extension functions easily provide flexibility in parameter values. syntax exsl:object-type(object) parameters object the object whose type is to be returned. ...
Sets (set) - EXSLT
the namespace for these functions is http://exslt.org/sets. set:difference()set:difference() returns the difference between two node-sets. in other words, it returns a node-set whose nodes are in one node-set but not in the other.set:distinct()set:distinct() returns a subset of the nodes in the specified node-set, returning only nodes with unique string values.set:has-same-node()set:has-same-node() determines whether two node-sets have any nodes in common.set:intersection()set:intersection() returns the intersection of two node-sets. ...
str:concat() - EXSLT
syntax str:concat(nodeset) parameters nodeset the node-set whose nodes' string values should be concatenated into one string. returns a string whose value is all the string values of the nodes in nodeset concatenated together. if nodeset is empty, an empty string is returned. ...
str:split() - EXSLT
syntax str:split(string, pattern) parameters string the string to split. pattern the pattern indicating where to split the string. returns a node-set of token elements, each containing one token from the string. ...
str:tokenize() - EXSLT
syntax str:tokenize(string, delimiters) parameters string the string to tokenize. delimiters each character in this string is used as a word separator while tokenizing. returns a node-set of token elements, each containing one token from the string. ...
EXSLT
xslt/x
path reference: xslt elements, exslt functions, x
path functions, x
path axes exslt is a set of extensions to xslt. there are a number of modules; those that are supported by firefox are listed below: common (exsl)the exslt common package provides basic functions that expand upon the capabilities of xslt.math (math)the exslt math package provides functions for working with numeric values and comparing nodes.regular expressions (regexp)the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions.sets (set)the exslt sets package offers functions that let you perform set manipulation.strings (str)the exslt strings package provides functions that allow the manipulation of strings. exslt mod...
Event reference
when a browser <iframe>'s location changes. mozbrowserloadend firefox os browser api-specific sent when the browser <iframe> has finished loading all its assets. mozbrowserloadstart firefox os browser api-specific sent when the browser <iframe> starts to load a new page. mozbrowsermanifestchange firefox os browser api-specific sent when the
path to the app manifest changes, in the case of a browser <iframe> with an open web app embedded in it. mozbrowsermetachange firefox os browser api-specific sent when a <meta> element is added to, removed from, or changed in the browser <iframe>'s content. mozbrowseropensearch firefox os browser api-specific sent when a link to a search engine is found. ...
Cross-browser audio basics - Developer guides
ort mp4 audio). here we define an <audio> element with multiple sources — we do this as not all browsers support the same audio formats. to ensure reasonable coverage, we should specify at least two different formats. the two formats that will give maximum coverage are mp3 and ogg vorbis. we do this using the <source> element, which takes the attributes src and type. src contains the
path to the audio file to be loaded (relative or absolute). type is used to inform the browser of the file type. if omitted, most browsers will attempt to guess this from the file extension. if the <audio> element is not supported then <audio> and <source> will be ignored. however any supported text or elements that you define within <audio> will be displayed or acted upon. so the ideal plac...
Audio and Video Delivery - Developer guides
you must call load() after removing the attribute, because just removing the src attribute does not invoke the load algorithm. if the <video> element also has <source> element descendants, those should also be removed before calling load(). note that just setting the src attribute to an empty string will actually cause the browser to treat it as though you're setting a video source to a relative
path. this causes the browser to attempt another download to something that is unlikely to be a valid video. seeking through media media elements provide support for moving the current playback position to specific points in the media's content. this is done by setting the value of the currenttime property on the element; see htmlmediaelement for further details on the element's properties. simply s...
Separate sites for mobile and desktop - Developer guides
e option of sending completely separate html, javascript, and css to phones and pcs. another case where you may be forced to use this approach is if you cannot, for whatever reason, modify your existing desktop site, and need to have a 100% separate mobile site. though it’s not ideal, at least you have this option. examples most of the major web applications you see in the wild have chosen this
path, including facebook, youtube, digg, and flickr. in fact, mozilla picked this strategy for the mobile versions of addons.mozilla.org (amo) and support.mozilla.org (sumo). if you’d like to see the source code behind an example of this approach in action, feel free to check out the github repository for amo or sumo. approaches to mobile web development see the following articles for background and...
Parsing and serializing XML - Developer guides
ializing and parsing xml easy. xmlserializer serializes dom trees, converting them into strings containing xml. domparser constructs a dom tree by parsing a string containing xml, returning a xmldocument or document as appropriate based on the input data. xmlhttprequest loads content from a url; xml content is returned as an xml document object with a dom tree built from the xml itself. x
path a technology for creating strings that contain addresses for specific portions of an xml document, and locating xml nodes based on those addresses. creating an xml document using one of the following approaches to create an xml document (which is an instance of document. parsing strings into dom trees this example converts an xml fragment in a string into a dom tree using a domparser: var...
Printing - Developer guides
rience of printing, such as presenting a specially-formatted version of your content before printing begins. there may be other cases in which you want to manage the printing process, but these are some of the most common scenarios. this article provides tips and techniques for helping your web content print better. using a print style sheet add the following to your <head> tag. <link href="/
path/to/print.css" media="print" rel="stylesheet" /> using media queries to improve layout detecting print requests some browsers (including firefox 6 and later and internet explorer) send beforeprint and afterprint events to let content determine when printing may have occurred. you can use this to adjust the user interface presented during printing (such as by displaying or hiding user interface...
<area> - HTML: Hypertext Markup Language
(https). this is a user agent’s default behavior, if no policy is otherwise specified. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "origin-when-cross-origin" meaning that navigations to other origins will be limited to the scheme, the host and the port, while navigations on the same origin will include the referrer's
path. "unsafe-url" meaning that the referrer will include the origin and the
path (but not the fragment, password, or username). this case is unsafe because it can leak origins and
paths from tls-protected resources to insecure origins. rel for anchors containing the href attribute, this attribute specifies the relationship of the target object to the link object. the value is a space-separat...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
he destination for streamed media, using a mediastream. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the above example shows simple usage of the <audio> element. in a similar manner to the <img> element, we include a
path to the media we want to embed inside the src attribute; we can include other attributes to specify information such as whether we want it to autoplay and loop, whether we want to show the browser's default audio controls, etc. the content inside the opening and closing <audio></audio> tags is shown as a fallback in browsers that don't support the element. attributes this element's attributes i...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
ation) element. example this example demonstrates the use of the <blockquote> element to quote a passage from rfc 1149, a standard for the transmission of ip datagrams on avian carriers. <blockquote cite="https://tools.ietf.org/html/rfc1149"> <p>avian carriers can provide high delay, low throughput, and low altitude service. the connection topology is limited to a single point-to-point
path for each carrier, used with standard carriers, but many carriers can be used without significant interference with each other, outside of early spring. this is because of the 3d ether space available to the carriers, in contrast to the 1d ether used by ieee802.3. the carriers have an intrinsic collision avoidance system, which increases availability.</p> </blockquote> the output f...
<button>: The Button element - HTML: Hypertext Markup Language
s screen readers, to access when they parse the document and generate an accessibility tree. assistive technology then uses the accessibility tree to navigate and manipulate page content. to give an icon button an accessible name, put text in the <button> element that concisely describes the button's functionality. example <button name="favorite"> <svg aria-hidden="true" viewbox="0 0 10 10"><
path d="m7 9l5 8 3 9v6l1 4h3l1-3 1 3h3l7 6z"/></svg> add to favorites </button> if you want to visually hide the button's text, an accessible way to do so is to use a combination of css properties to remove it visually from the screen, but keep it parseable by assistive technology. however, it is worth noting that leaving the button text visually apparent can aid people who may not be familiar wi...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
d</del>, here is the rest of the paragraph.</p> <del><p>this paragraph has been deleted.</p></del> result accessibility concerns the presence of the del element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. del::before, del::after { clip-
path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } del::before { content: " [deletion start] "; } del::after { content: " [deletion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not abuse this ...
<ins> - HTML: Hypertext Markup Language
format of a valid local date and time string. examples <ins>this text has been inserted</ins> result accessibility concerns the presence of the <ins> element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. ins::before, ins::after { clip-
path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } ins::before { content: " [insertion start] "; } ins::after { content: " [insertion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not abuse thi...
<mark>: The Mark Text element - HTML: Hypertext Markup Language
ential usage, this example applies the custom class "match" to each match. the results look like this: accessibility concerns the presence of the mark element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. mark::before, mark::after { clip-
path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } mark::before { content: " [highlight start] "; } mark::after { content: " [highlight end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not abuse t...
<object> - HTML: Hypertext Markup Language
obsolete since html5 a space-separated list of uris for archives of resources for the object. borderdeprecated since html4.01obsolete since html5 the width of a border around the control, in pixels. classidhtml 4 onlyobsolete since html5 the uri of the object's implementation. it can be used together with, or in place of, the data attribute. codebasehtml 4 onlyobsolete since html5 the base
path used to resolve relative uris specified by classid, data, or archive. if not specified, the default is the base uri of the current document. codetypehtml 4 onlyobsolete since html5 the content type of the data specified by classid. data the address of the resource as a valid url. at least one of data and type must be defined. declarehtml 4 onlyobsolete since html5 the presence of this boole...
<s> - HTML: Hypertext Markup Language
l: salmon</s> sold out<br> <span style="text-decoration:line-through;">today's special: salmon</span> sold out accessibility concerns the presence of the s element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. s::before, s::after { clip-
path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } s::before { content: " [start of stricken text] "; } s::after { content: " [end of stricken text] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not...
<video>: The Video Embed element - HTML: Hypertext Markup Language
element may provide a more appropriate user experience. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the above example shows simple usage of the <video> element. in a similar manner to the <img> element, we include a
path to the media we want to display inside the src attribute; we can include other attributes to specify information such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's default video controls, etc. the content inside the opening and closing <video></video> tags is shown as a fallback in browsers that don't support the element. attributes l...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
the page's render, improving performance. this article provides a basic guide to how <link rel="preload"> works. the basics you most commonly use <link> to load a css file to style your page with: <link rel="stylesheet" href="styles/main.css"> here however, we will use a rel value of preload, which turns <link> into a preloader for any resource we want. you will also need to specify: the
path to the resource in the href attribute. the type of resource in the as attribute. a simple example might look like this (see our js and css example source, and also live): <head> <meta charset="utf-8"> <title>js and css preload example</title> <link rel="preload" href="style.css" as="style"> <link rel="preload" href="main.js" as="script"> <link rel="stylesheet" href="style.css"> </...
Using the application cache - HTML: Hypertext Markup Language
become obsolete. if an application's manifest file is removed from the server, the browser removes all application caches that use that manifest, and sends an "obsoleted" event to the applicationcache object. this sets the application cache's state to obsolete. the cache manifest file referencing a cache manifest file the manifest attribute in a web application can specify either the relative
path of a cache manifest file or an absolute url. (absolute urls must be from the same origin as the application). a cache manifest file can have any file extension, but it must be served with the mime type text/cache-manifest. note: on apache servers, the mime type for manifest (.appcache) files can be set by adding addtype text/cache-manifest .appcache to a .htaccess file within either the root dir...
HTTP authentication - HTTP
these additional security enhancements, basic authentication should not be used to protect sensitive or valuable information. restricting access with apache and basic authentication to password-protect a directory on an apache server, you will need a .htaccess and a .htpasswd file. the .htaccess file typically looks like this: authtype basic authname "access to the staging site" authuserfile /
path/to/.htpasswd require valid-user the .htaccess file references a .htpasswd file in which each line consists of a username and a password separated by a colon (:). you cannot see the actual passwords as they are hashed (using md5-based hashing, in this case). note that you can name your .htpasswd file differently if you like, but keep in mind this file shouldn't be accessible to anyone. (apache is...
Evolution of HTTP - HTTP
otocol used in those early phases was very simple, later dubbed http/0.9, and sometimes as the one-line protocol. http/0.9 – the one-line protocol the initial version of http had no version number; it has been later called 0.9 to differentiate it from the later versions. http/0.9 is extremely simple: requests consist of a single line and start with the only possible method get followed by the
path to the resource (not the url as both the protocol, server, and port are unnecessary once connected to the server). get /mypage.html the response is extremely simple too: it only consisted of the file itself. <html> a very simple html page </html> unlike subsequent evolutions, there were no http headers, meaning that only html files could be transmitted, but no other type of documents. there w...
Browser detection using the user agent - HTTP
rowser was chrome. the agent might be an older version of chrome, from before support was added, or (because the feature was experimental at the time) it could be a later version of chrome that removed it. most importantly, it assumed no other browsers would support the feature. support could have been added to other browsers at any time, but this code would have continued choosing the inferior
path. problems like these can be avoided by testing for support of the feature itself instead: var islookbehindsupported = false; try { new regexp("(?<=)"); islookbehindsupported = true; } catch (err) { // if the agent doesn't support lookbehinds, the attempted // creation of a regexp object using that syntax throws and // islookbehindsupported remains false. } var splitups...
Cross-Origin Resource Sharing (CORS) - HTTP
for you when making invocations to servers. developers using cross-site xmlhttprequest capability do not have to set any cross-origin sharing request headers programmatically. origin the origin header indicates the origin of the cross-site access request or preflight request. origin: <origin> the origin is a uri indicating the server from which the request initiated. it does not include any
path information, but only the server name. note: the origin value can be null, or a uri. note that in any access control request, the origin header is always sent. access-control-request-method the access-control-request-method is used when issuing a preflight request to let the server know what http method will be used when the actual request is made. access-control-request-method: <method> e...
Compression in HTTP - HTTP
deflate; for nginx there is ngx_http_gzip_module; for iis, the <httpcompression> element. hop-by-hop compression hop-by-hop compression, though similar to end-to-end compression, differs by one fundamental element: the compression doesn't happen on the resource in the server, creating a specific representation that is then transmitted, but on the body of the message between any two nodes on the
path between the client and the server. connections between successive intermediate nodes may apply a different compression. to do this, http uses a mechanism similar to the content negotiation for end-to-end compression: the node transmitting the request advertizes its will using the te header and the other node chooses the adequate method, applies it, and indicates its choice with the transfer-en...
Content-Disposition - HTTP
="file"> element), there can be several subparts with the same name. a name with a value of '_charset_' indicates that the part is not an html field, but the default charset to use for parts without explicit charset information. filename is followed by a string containing the original name of the file transmitted. the filename is always optional and must not be used blindly by the application:
path information should be stripped, and conversion to the server file system rules should be done. this parameter provides mostly indicative information. when used in combination with content-disposition: attachment, it is used as the default filename for an eventual "save as" dialog presented to the user. filename* the parameters filename and filename* differ only in that filename* uses the enco...
CSP: referrer - HTTP
ocument https://example.com/page.html will send the referrer https://example.com/. "origin-when-cross-origin" / "origin-when-crossorigin" send a full url when performing a same-origin request, but only send the origin of the document for other cases. "unsafe-url" send a full url (stripped from parameters) when performing a same-origin or cross-origin request. this policy will leak origins and
paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. examples content-security-policy: referrer "none"; specifications not part of any specification. ...
Forwarded - HTTP
the alternative and de-facto standard versions of this header are the x-forwarded-for, x-forwarded-host and x-forwarded-proto headers. this header is used for debugging, statistics, and generating location-dependent content and by design it exposes privacy sensitive information, such as the ip address of the client. therefore the user's privacy must be kept in mind when deploying this header. ...
Origin - HTTP
note: the origin header is not set on fetch requests with a method of head or get (this behavior was corrected in firefox 65 — see bug 1508661). header type request header forbidden header name yes syntax origin: null origin: <scheme> "://" <hostname> [ ":" <port> ] directives <scheme> the protocol that is used. ...
Set-Cookie2 - HTTP
yntax set-cookie2: <cookie-name>=<cookie-value> set-cookie2: <cookie-name>=<cookie-value>; comment=<value> set-cookie2: <cookie-name>=<cookie-value>; commenturl=<http-url> set-cookie2: <cookie-name>=<cookie-value>; discard set-cookie2: <cookie-name>=<cookie-value>; domain=<domain-value> set-cookie2: <cookie-name>=<cookie-value>; max-age=<non-zero-digit> set-cookie2: <cookie-name>=<cookie-value>;
path=<
path-value> set-cookie2: <cookie-name>=<cookie-value>; port=<port-number> set-cookie2: <cookie-name>=<cookie-value>; secure set-cookie2: <cookie-name>=<cookie-value>; version=<version-number> // multiple directives are also possible, for example: set-cookie2: <cookie-name>=<cookie-value>; domain=<domain-value>; secure // multiple cookies are seperated by a comma set-cookie2: <cookie-name>=<coo...
SourceMap - HTTP
de to a source map, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. ...
HTTP Messages - HTTP
ne contain three elements: an http method, a verb (like get, put or post) or a noun (like head or options), that describes the action to be performed. for example, get indicates that a resource should be fetched or post means that data is pushed to the server (creating or modifying a resource, or generating a temporary document to send back). the request target, usually a url, or the absolute
path of the protocol, port, and domain are usually characterized by the request context. the format of this request target varies between different http methods. it can be an absolute
path, ultimately followed by a '?' and query string. this is the most common form, known as the origin form, and is used with get, post, head, and options methods. post / http/1.1 get /background.png http/1...
TRACE - HTTP
the final recipient of the request should reflect the message received, excluding some fields described below, back to the client as the message body of a 200 (ok) response with a content-type of message/http. the final recipient is either the origin server or the first server to receive a max-forwards value of 0 in the request. ...
HTTP request methods - HTTP
representations of the target resource with the request payload. delete the delete method deletes the specified resource. connect the connect method establishes a tunnel to the server identified by the target resource. options the options method is used to describe the communication options for the target resource. trace the trace method performs a message loop-back test along the
path to the target resource. patch the patch method is used to apply partial modifications to a resource. specifications specification title comment rfc 7231, section 4: request methods hypertext transfer protocol (http/1.1): semantics and content specifies get, head, post, put, delete, connect, options, trace. rfc 5789, section 2: patch method patch me...
An overview of HTTP - HTTP
its own format. requests an example http request: requests consists of the following elements: an http method, usually a verb like get, post or a noun like options or head that defines the operation the client wants to perform. typically, a client wants to fetch a resource (using get) or post the value of an html form (using post), though more operations may be needed in other cases. the
path of the resource to fetch; the url of the resource stripped from elements that are obvious from the context, for example without the protocol (http://), the domain (here, developer.mozilla.org), or the tcp port (here, 80). the version of the http protocol. optional headers that convey additional information for the servers. or a body, for some methods like post, similar to those in responses, w...
Proxy servers and tunneling - HTTP
from the original request is lost. the ip address of the original client is often used for debugging, statistics, or generating location-dependent content. a common way to disclose this information is by using the following http headers: the standardized header: forwarded contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the
path of the request. or the de-facto standard versions: x-forwarded-for identifies the originating ip addresses of a client connecting to a web server through an http proxy or a load balancer. x-forwarded-host identifies the original host requested that a client used to connect to your proxy or load balancer. x-forwarded-proto identifies the protocol (http or https) that a client used ...
A typical HTTP session - HTTP
g a client request once the connection is established, the user-agent can send the request (a user-agent is typically a web browser, but can be anything else, a crawler, for example). a client request consists of text directives, separated by crlf (carriage return, followed by line feed), divided into three blocks: the first line contains a request method followed by its parameters: the
path of the document, i.e. an absolute url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server information about what type of data is appropriate (e.g., what language, what mime types), or other data altering its behavior (e.g., not sending an answer if it is already cached). these http headers form a block which ends with...
HTTP
o use http headers to control them. http cookies how cookies work is defined by rfc 6265. when serving an http request, a server can send a set-cookie http header with the response. the client then returns the cookie's value with every request to the same server in the form of a cookie request header. the cookie can also be set to expire on a certain date, or restricted to a specific domain and
path. cross-origin resource sharing (cors) cross-site http requests are http requests for resources from a different domain than the domain of the resource making the request. for instance, an html page from domain a (http://domaina.example/) makes a request for an image on domain b (http://domainb.foo/image.jpg) via the img element. web pages today very commonly load cross-site resources, including...
Array.prototype.indexOf() - JavaScript
var that = object(this), len = that.length >>> 0, i = min(fromindex | 0, len) if (i < 0) i = max(0, len + i) else if (i >= len) return -1 if (member === void 0) { // undefined for (; i !== len; ++i) if (that[i] === void 0 && i in that) return i } else if (member !== member) { // nan return -1 // since nan !== nan, it will never be found. fast-
path it. } else // all else for (; i !== len; ++i) if (that[i] === member) return i return -1 // if the value was not found, then return -1 } })(object, math.max, math.min) however, if you are more interested in all the little technical bits defined by the ecma standard, and are less concerned about performance or conciseness, then you may find thi...
Error - JavaScript
the stack property on an error instance. instance properties error.prototype.message error message. error.prototype.name error name. error.prototype.description a non-standard microsoft property for the error description. similar to message. error.prototype.number a non-standard microsoft property for an error number. error.prototype.filename a non-standard mozilla property for the
path to the file that raised this error. error.prototype.linenumber a non-standard mozilla property for the line number in the file that raised this error. error.prototype.columnnumber a non-standard mozilla property for the column number in the line that raised this error. error.prototype.stack a non-standard mozilla property for a stack trace. instance methods error.prototype.tostring() ...
EvalError - JavaScript
error object remains for compatibility. constructor evalerror() creates a new evalerror object. instance properties evalerror.prototype.message error message. although ecma-262 specifies that evalerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. evalerror.prototype.name error name. inherited from error. evalerror.prototype.filename
path to file that raised this error. inherited from error. evalerror.prototype.linenumber line number in file that raised this error. inherited from error. evalerror.prototype.columnnumber column number in line that raised this error. inherited from error. evalerror.prototype.stack stack trace. inherited from error. examples evalerror is not used in the current ecmascript specification and wi...
InternalError - JavaScript
.g.: "too many switch cases", "too many parentheses in regular expression", "array initializer too large", "too much recursion". constructor internalerror() creates a new internalerror object. instance properties internalerror.prototype.message error message. inherited from error. internalerror.prototype.name error name. inherited from error. internalerror.prototype.filename
path to file that raised this error. inherited from error. internalerror.prototype.linenumber line number in file that raised this error. inherited from error. internalerror.prototype.columnnumber column number in line that raised this error. inherited from error. internalerror.prototype.stack stack trace. inherited from error. examples too much recursion this recursive function runs 10 time...
Object.freeze() - JavaScript
oyee.address.city) // output: "noida" to make an object immutable, recursively freeze each property which is of type object (deep freeze). use the pattern on a case-by-case basis based on your design when you know the object contains no cycles in the reference graph, otherwise an endless loop will be triggered. an enhancement to deepfreeze() would be to have an internal function that receives a
path (e.g. an array) argument so you can suppress calling deepfreeze() recursively when an object is in the process of being made immutable. you still run a risk of freezing an object that shouldn't be frozen, such as [window]. function deepfreeze(object) { // retrieve the property names defined on object var propnames = object.getownpropertynames(object); // freeze properties before freezing...
RangeError - JavaScript
number.prototype.toprecision(). constructor rangeerror() creates a new rangeerror object. instance properties rangeerror.prototype.message error message. although ecma-262 specifies that rangeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. rangeerror.prototype.name error name. inherited from error. rangeerror.prototype.filename
path to file that raised this error. inherited from error. rangeerror.prototype.linenumber line number in file that raised this error. inherited from error. rangeerror.prototype.columnnumber column number in line that raised this error. inherited from error. rangeerror.prototype.stack stack trace. inherited from error. examples using rangeerror (for numeric values) function check(n) { if...
ReferenceError - JavaScript
ferenced. constructor referenceerror() creates a new referenceerror object. instance properties referenceerror.prototype.message error message. although ecma-262 specifies that referenceerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. referenceerror.prototype.name error name. inherited from error. referenceerror.prototype.filename
path to file that raised this error. inherited from error. referenceerror.prototype.linenumber line number in file that raised this error. inherited from error. referenceerror.prototype.columnnumber column number in line that raised this error. inherited from error. referenceerror.prototype.stack stack trace. inherited from error. examples catching a referenceerror try { let a = undefinedv...
SyntaxError - JavaScript
language when parsing code. constructor syntaxerror() creates a new syntaxerror object. instance properties syntaxerror.prototype.message error message. although ecma-262 specifies that syntaxerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. syntaxerror.prototype.name error name. inherited from error. syntaxerror.prototype.filename
path to file that raised this error. inherited from error. syntaxerror.prototype.linenumber line number in file that raised this error. inherited from error. syntaxerror.prototype.columnnumber column number in line that raised this error. inherited from error. syntaxerror.prototype.stack stack trace. inherited from error. examples catching a syntaxerror try { eval('hoo bar'); } catch (e) {...
TypeError - JavaScript
o use a value in an inappropriate way. constructor typeerror() creates a new typeerror object. instance properties typeerror.prototype.message error message. although ecma-262 specifies that typeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. typeerror.prototype.name error name. inherited from error. typeerror.prototype.filename
path to file that raised this error. inherited from error. typeerror.prototype.linenumber line number in file that raised this error. inherited from error. typeerror.prototype.columnnumber column number in line that raised this error. inherited from error. typeerror.prototype.stack stack trace. inherited from error. examples catching a typeerror try { null.f() } catch (e) { console.log(e...
URIError - JavaScript
ri handling function was used in a wrong way. constructor urierror() creates a new urierror object. instance properties urierror.prototype.message error message. although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message. urierror.prototype.name error name. inherited from error. urierror.prototype.filename
path to file that raised this error. inherited from error. urierror.prototype.linenumber line number in file that raised this error. inherited from error. urierror.prototype.columnnumber column number in line that raised this error. inherited from error. urierror.prototype.stack stack trace. inherited from error. examples catching an urierror try { decodeuricomponent('%') } catch (e) { c...
WebAssembly.CompileError - JavaScript
eerror() creates a new webassembly.compileerror object. instance properties webassembly.compileerror.prototype.message error message. although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message. webassembly.compileerror.prototype.name error name. inherited from error. webassembly.compileerror.prototype.filename
path to file that raised this error. inherited from error. webassembly.compileerror.prototype.linenumber line number in file that raised this error. inherited from error. webassembly.compileerror.prototype.columnnumber column number in line that raised this error. inherited from error. webassembly.compileerror.prototype.stack stack trace. inherited from error. instance methods webassembly.c...
WebAssembly.LinkError - JavaScript
assembly.linkerror() creates a new webassembly.linkerror object. instance properties webassembly.linkerror.prototype.message error message. although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message. webassembly.linkerror.prototype.name error name. inherited from error. webassembly.linkerror.prototype.filename
path to file that raised this error. inherited from error. webassembly.linkerror.prototype.linenumber line number in file that raised this error. inherited from error. webassembly.linkerror.prototype.columnnumber column number in line that raised this error. inherited from error. webassembly.linkerror.prototype.stack stack trace. inherited from error. instance methods webassembly.linkerror.
WebAssembly.RuntimeError - JavaScript
eerror() creates a new webassembly.runtimeerror object. instance properties webassembly.runtimeerror.prototype.message error message. although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message. webassembly.runtimeerror.prototype.name error name. inherited from error. webassembly.runtimeerror.prototype.filename
path to file that raised this error. inherited from error. webassembly.runtimeerror.prototype.linenumber line number in file that raised this error. inherited from error. webassembly.runtimeerror.prototype.columnnumber column number in line that raised this error. inherited from error. webassembly.runtimeerror.prototype.stack stack trace. inherited from error. instance methods webassembly.r...
encodeURI() - JavaScript
return value a new string representing the provided string encoded as a uri. description the encodeuri() function does not encode characters that have special meaning (reserved characters) for a uri. the following example shows all the parts that a uri "scheme" can possibly contain. note how certain characters are used to signify special meaning: http://username:password@www.example.com:80/
path/to/file.php?foo=316&bar=this+has+spaces#anchor hence encodeuri() does not encode characters that are necessary to formulate a complete uri. also, encodeuri() does not encode a few additional characters, known as "unreserved marks", which do not have a reserved purpose but are allowed in a uri "as is". (see rfc2396) encodeuri() escapes all characters except: not escaped: a-z a-z 0-9 ; , / ...
Lexical grammar - JavaScript
roposal). a hashbang comment behaves exactly like a single line-only (//) comment. instead, it begins with #! and is only valid at the absolute start of a script or module. note also that no whitespace of any kind is permitted before the #!. the comment consists of all the characters after #! up to the end of the first line; only one such comment is permitted. the hashbang comment specifies the
path to a specific javascript interpreter that you want to use to execute the script. an example is as follows: #!/usr/bin/env node console.log("hello world"); note: hashbang comments in javascript mimic shebangs in unix used to run files with proper interpreter. although bom before hashbang comment will work in a browser it is not advised to use bom in a script with hasbang. bom will not work...
yield - JavaScript
e is true. a return statement is reached. in this case, execution of the generator ends and an iteratorresult is returned to the caller in which the value is the value specified by the return statement and done is true. if an optional value is passed to the generator's next() method, that value becomes the value returned by the generator's current yield operation. between the generator's code
path, its yield operators, and the ability to specify a new starting value by passing it to generator.prototype.next(), generators offer enormous power and control. unfortunately, next() is asymmetric, but that can’t be helped: it always sends a value to the currently suspended yield, but returns the operand of the following yield. examples using yield the following code is the declaration of ...
import.meta - JavaScript
specifications specification import.meta proposal html living standardthe definition of 'import.meta' in that specification. ...
iarc_rating_id - Web app manifests
ating_id member is a string that represents the international age rating coalition (iarc) certification code of the web application. it is intended to be used to determine which ages the web application is appropriate for. note: the same code can be shared across multiple participating storefronts, as long as the distributed product remains the same (i.e., doesn’t serve totally different code
paths on different storefronts). examples "iarc_rating_id": "e84b072d-71b3-4d3e-86ae-31a8ce4e53b7" specification specification status comment feedback web app manifestthe definition of 'iarc_rating_id' in that specification. working draft initial definition. web app manifest working group drafts ...
icons - Web app manifests
"image/webp" }, { "src": "icon/lowres", "sizes": "48x48" }, { "src": "icon/hd_hi.ico", "sizes": "72x72 96x96 128x128 256x256" }, { "src": "icon/hd_hi.svg", "sizes": "72x72" } ] values image objects may contain the following values: member description sizes a string containing space-separated image dimensions. src the
path to the image file. if src is a relative url, the base url will be the url of the manifest. type a hint as to the media type of the image. the purpose of this member is to allow a user agent to quickly ignore images with media types it does not support. purpose defines the purpose of the image, for example if the image is intended to serve some special purpose in the c...
Recommended Web Performance Timings: How long is too long? - Web Performance
ld be considered a rule in the maximum amount of time to indicate to a user that the request for new content was made and will load, such as the browser displaying the page title and the background color of the page displaying. the first asset retrieved from a request is usually an html document, which then makes calls for additional assets. as noted in the description of the critical rendering
path, when received, browsers immediately start processing the html, rendering the content as it is received rather than waiting for additional assets to load. yes, one second for loading is a goal, but it's something few sites achieve. expectations differ. a 'hello world' on the corporate network would be expected to load in milliseconds, but a user downloading a cat video on a five-year-old device ...
Optimizing startup performance - Web Performance
ginal codebase. the provided one is almost certainly significantly faster, and will reduce your app size to boot. in addition, the browser may automatically parallelize these decoders. any data processing that can be done in parallel should be. don't do one chunk of data after another; do them all at once when possible! don't include scripts or stylesheets that don't participate in the critical
path in your startup html file. load them only when needed. reduce the side of your javascript files. try to send the minify version of the file to the browser and use compression like gzip or brotli. utilize resource hints (like preconnect or preload) whenever possible to indicate to the browser which files are more critical for your application. the more stuff you can do asynchronously, the bett...
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
ting shorter-term performance issues during development. in this article we define and compare these two performance monitoring approaches. synthetic monitoring synthetic monitoring involves monitoring the performance of a page in a 'laboratory' environment, typically with automation tooling in a consistent as possible environment. synthetic monitoring involves deploying scripts to simulate the
path an end user might take through a web application, reporting back the performance the simulator experiences. the traffic measured is not of your actual users, but rather synthetically generated traffic collecting data on page performance. an example of synthetic monitoring is webpagetest.org. it is done in a controlled environment where variable like geography, network, device, browser, and cache...
Add to Home screen - Progressive web apps (PWAs)
screen). we've included only one in our demo. name/short_name: these fields provide an app name to be displayed when representing the app in different places. name provides the full app name, and short_name provides a shortened name to be used when there is insufficient space to display the full name. you are advised to provide both if your app's name is particularly long. start_url: provides a
path to the asset that should be loaded when the added-to-home screen app is launched. note that this has to be a relative url pointing to the site index, relative to the url of the manifest. also, be aware that chrome requires this before it will display the install banner, whereas firefox doesn't require it for showing the home-with-a-plus icon. the manifest for our sample app looks like this: { ...
How to make PWAs installable - Progressive web apps (PWAs)
require the service worker. if developing your app using firefox, be aware that you will need a service worker to be compatible with chromium-based browsers. the manifest file the key element is a web manifest file, which lists all the information about the website in a json format. it usually resides in the root folder of a web app. it contains useful information, such as the app’s title,
paths to different-sized icons that can be used to represent the app on an os (such as an icon on the home screen, an entry in the start menu, or an icon on the desktop), and a background color to use in loading or splash screens. this information is needed for the browser to present the web app properly during the installation process, as well as within the device's app-launching interface, such as t...
baseline-shift - SVG: Scalable Vector Graphics
e parent text content element. the shifted object might be a sub- or superscript. note: as a presentation attribute baseline-shift can be used as a css property. note: this property is going to be deprecated and authors are advised to use vertical-align instead. as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <text
path>, <tref>, and <tspan> usage notes value <length-percentage> | sub | super default value 0 animatable yes sub the dominant-baseline is shifted to the default position for subscripts. super the dominant-baseline is shifted to the default position for superscripts. <length-percentage> a length value raises (positive value) or lowers (negative value...
direction - SVG: Scalable Vector Graphics
ficient to add the direction attribute to the outermost <svg> element, and allow that direction to inherit to all text elements: note: as a presentation attribute, direction can be used as a css property. see css direction for further information. as a presentation attribute, it can be applied to any element but it only has effect on shapes and text context elements, including: <altglyph>, <text
path>, <text>, <tref>, and <tspan>. html, body, svg { height: 100%; } <svg viewbox="0 0 600 72" xmlns="http://www.w3.org/2000/svg" direction="rtl" lang="fa"> <text x="300" y="50" text-anchor="middle" font-size="36">داستان svg 1.1 se طولا ني است.</text> </svg> usage notes value ltr | rtl default value ltr animatable yes s...
font-family - SVG: Scalable Vector Graphics
family will be used to render the text, specified as a prioritized list of font family names and/or generic family names. note: as a presentation attribute, font-family can be used as a css property. see the css font-family property for more information. ...
font-size-adjust - SVG: Scalable Vector Graphics
y an aspect value for an element that will preserve the x-height of the first choice font in a substitute font. note: as a presentation attribute, font-size-adjust can be used as a css property. see the css font-size-adjust property for more information. as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <text
path>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg width="600" height="80" viewbox="0 0 500 80" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="times, serif" font-size="10px"> this text uses the times font (10px), which is hard to read in small sizes. </text> <text y="40" font-family="verdana, sans-serif" font-size="10px"> this text uses the verdan...
font-size - SVG: Scalable Vector Graphics
o the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. note: as a presentation attribute, font-size can be used as a css property. see the css font-size property for more information. ...
font-stretch - SVG: Scalable Vector Graphics
e font-stretch attribute indicates the desired amount of condensing or expansion in the glyphs used to render the text. note: as a presentation attribute, font-stretch can be used as a css property. see the css font-stretch property for more information. ...
font-style - SVG: Scalable Vector Graphics
the font-style attribute specifies whether the text is to be rendered using a normal, italic, or oblique face. note: as a presentation attribute, font-style can be used as a css property. see the css font-style property for more information. ...
font-variant - SVG: Scalable Vector Graphics
the font-variant attribute indicates whether the text is to be rendered using variations of the fontʼs glyphs. note: as a presentation attribute, font-variant can be used as a css property. see the css font-variant property for more information. ...
font-weight - SVG: Scalable Vector Graphics
fers to the boldness or lightness of the glyphs used to render the text, relative to other fonts in the same font family. note: as a presentation attribute, font-weight can be used as a css property. see the css font-weight property for more information. ...
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
n the current text position is incremented according to the vertical metrics of the glyph. this attribute is applied only to text written in a horizontal writing-mode. note: as a presentation attribute, glyph-orientation-horizontal can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text
path>, <text>, <tref>, and <tspan> context notes value <angle> default value 0deg animatable no <angle> the value of the angle is restricted to 0, 90, 180, and 270 degrees. if another angle is specified, it is rounded to the closest of the permitted values. a value of 0deg indicates that all glyphs are set with the top of the glyphs oriented towards ...
glyph-orientation-vertical - SVG: Scalable Vector Graphics
hen the current text position is incremented according to the horizontal metrics of the glyph. this attribute is applied only to text written in a vertical writing-mode. note: as a presentation attribute, glyph-orientation-vertical can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text
path>, <text>, <tref>, and <tspan> context notes value auto | <angle> default value auto animatable no auto fullwidth ideographic and fullwidth latin text will be set with a glyph orientation of 0 degrees. ideographic punctuation and other ideographic characters having alternate horizontal and vertical forms will use the vertical form of the glyph. tex...
kerning - SVG: Scalable Vector Graphics
font (i.e., enable auto-kerning) or instead disable auto-kerning and set the spacing between them to a specific length (typically, zero). note: as a presentation attribute kerning can be used as a css property. in css the property is called font-kerning, though. ...
letter-spacing - SVG: Scalable Vector Graphics
m or 1%, then the browser converts the <length> into its corresponding value in the current user coordinate system. note: as a presentation attribute, letter-spacing can be used as a css property. see the css letter-spacing property for more information. ...
paint-order - SVG: Scalable Vector Graphics
the paint-order attribute specifies the order that the fill, stroke, and markers of a given shape or text element are painted. note: as a presentation attribute, paint-order can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following ten elements: <circle>, <ellipse>, <line>, <
path>, <polygon>, <polyline>, <rect>, <text>, <text
path>, and <tspan> usage notes value normal | [ fill || stroke || markers ] default value normal animatable yes normal this value indicates that the fill will be painted first, then the stroke, and finally the markers. [ fill || stroke || markers ] the order of these three keywords indicates the order in which the painting happens, from left to ri...
pointer-events - SVG: Scalable Vector Graphics
ound(math.random() * 0xffffff) // let's format the color to fit css requirements const fill = '#' + color.tostring(16).padstart(6,'0') // let's apply our color in the // element we actually clicked on e.target.style.fill = fill }) as a presentation attribute, it can be applied to any element but it is mostly relevant only on the following twenty-three elements: <a>, <circle>, <clip
path>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <marker>, <mask>, <
path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <text
path>, <tspan>, <use> usage notes value bounding-box | visiblepainted | visiblefill | visiblestroke | visible | painted | fill | stroke | all | none default value visiblepainted animatable yes ...
spacing - SVG: Scalable Vector Graphics
the spacing attribute indicates how the user agent should determine the spacing between typographic characters that are to be rendered along a
path. only one element is using this attribute: <text
path> usage notes value auto | exact default value exact animatable yes auto this value indicates that the user agent should use text-on-a-
path layout algorithms to adjust the spacing between typographic characters in order to achieve visually appealing results. exact this value indicates that the typographic characters should be rendered exactly according to the spacing rules as specified by the layout rules for text-on-a-
path. specifications specification status comment scalable vector graphics (svg) 2the definition o...
systemLanguage - SVG: Scalable Vector Graphics
the systemlanguage attribute represents a list of supported language tags. this list is matched against the language defined in the user preferences. 35 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <audio>, <canvas>, <circle>, <clip
path>, <cursor>, <defs>, <discard>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <mask>, <
path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <text
path>, <tref>, <tspan>, <unknown>, <use>, and <video> usage notes value <language-tags> default value none animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47. systemlan...
text-decoration - SVG: Scalable Vector Graphics
troke, is determined by the value of the paint-order attribute at the point where the text decoration is declared. note: as a presentation attribute, text-decoration can be used as a css property. see the css text-decoration property for more information. ...
text-rendering - SVG: Scalable Vector Graphics
to apply anti-aliasing techniques, built-in font hinting or both to produce the most legible text. geometricprecision this value indicates that the user agent shall emphasize geometric precision over legibility and rendering speed. this option will usually cause the user agent to suspend the use of hinting so that glyph outlines are drawn with comparable geometric precision to the rendering of
path data. specifications specification status comment scalable vector graphics (svg) 2the definition of 'text-rendering' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'text-rendering' in that specification. recommendation initial definition browser compatibility ...
textLength - SVG: Scalable Vector Graphics
ods specified by the lengthadjust attribute. by default, only the spacing between characters is adjusted, but the glyph size can also be adjusted if you change lengthadjust. by using textlength, you can ensure that your svg text displays at the same width regardless of conditions including web fonts failing to load (or not having loaded yet). ...
unicode-bidi - SVG: Scalable Vector Graphics
the unicode-bidi attribute specifies how the accumulation of the background image is managed. note: as a presentation attribute, unicode-bidi can be used as a css property. see the css unicode-bidi property for more information. as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <text
path>, <text>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a description of the values, please refer to the css unicode-bidi property. specifications specification status comment css writing modes module level 3the definition of 'unicode-bidi' in that sp...
word-spacing - SVG: Scalable Vector Graphics
. .25em or 1%), then the browser converts the <length> into a corresponding value in the current user coordinate system. note: as a presentation attribute, word-spacing can be used as a css property. see the css word-spacing property for more information. ...
xlink:type - SVG: Scalable Vector Graphics
the xlink:type attribute identifies the type of xlink being used. in svg, only simple links are available. twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <m
path>, <pattern>, <radialgradient>, <script>, <set>, <text
path>, <tref>, and <use> usage notes value simple default value simple animatable no simple this value specifies that the referred resource is a simple link. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'xlink:type' in that specification. recommendation ...
<feComposite> - SVG: Scalable Vector Graphics
%"> <fecomposite in="sourcegraphic" in2="backgroundimage" operator="xor" result="comp"/> </filter> <filter id="arithmeticnoflood" filterunits="objectboundingbox" x="-5%" y="-5%" width="110%" height="110%"> <fecomposite in="sourcegraphic" in2="backgroundimage" result="comp" operator="arithmetic" k1=".5" k2=".5" k3=".5" k4=".5"/> </filter> <
path id="blue100" d="m 0 0 l 100 0 l 100 100 z" fill="#00ffff" /> <
path id="red100" d="m 0 0 l 0 100 l 100 0 z" fill="#ff00ff" /> <
path id="blue50" d="m 0 125 l 100 125 l 100 225 z" fill="#00ffff" fill-opacity=".5" /> <
path id="red50" d="m 0 125 l 0 225 l 100 125 z" fill="#ff00ff" fill-opacity=".5" /> <g id="twobluetriangles"> <use xlink:href="#blue100"/> <use xlink:href="#...
<missing-glyph> - SVG: Scalable Vector Graphics
the <missing-glyph> svg element's content is rendered, if for a given character the font doesn't define an appropriate <glyph>. usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clip
path>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgmissingglyphelement interface. specifications specification statu...
Filter effects - SVG: Scalable Vector Graphics
ult="specout"/> <fecomposite in="sourcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litpaint"/> <!-- merge offsetblur + litpaint --> <femerge> <femergenode in="offsetblur"/> <femergenode in="litpaint"/> </femerge> </filter> </defs> <!-- graphic elements --> <g filter="url(#myfilter)"> <
path fill="none" stroke="#d90000" stroke-width="10" d="m50,66 c-50,0 -50,-60 0,-60 h100 c50,0 50,60 0,60z" /> <
path fill="#d90000" d="m60,56 c-30,0 -30,-40 0,-40 h80 c30,0 30,40 0,40z" /> <g fill="#ffffff" stroke="black" font-size="45" font-family="verdana" > <text x="52" y="52">svg</text> </g> </g> </svg> step 1 <fegaussianblur in="sourcealpha"...
SVG Tutorial - SVG: Scalable Vector Graphics
you might find more useful resources at inkscape's documentation page. another good introduction to svg is provided by the w3c's svg primer. the tutorial is in an early stage of development. if you're able, please help out by chipping in and writing a paragraph or two. extra points for writing a whole page! introducing svg from scratch introduction getting started positions basic shapes
paths fills and strokes gradients patterns texts basic transformations clipping and masking other content in svg filter effects svg fonts svg image tag tools for svg svg and css the following topics are more advanced and hence should get their own tutorials. scripting svg with javascript tbd svg filters tutorial tbd animations with smil in svg tbd creating fonts in svg tbd ...
How to fix a website with blocked mixed content - Web security
in good shape: keep making excellent websites! how to fix your website the best strategy to avoid mixed content blocking is to serve all the content as https instead of http. for your own domain, serve all content as https and fix your links. often, the https version of the content already exists and this just requires adding an "s" to links - http:// to https://. however, in some cases, the
path may just be incorrect to the media in question. there are online as well as offline tools (depending on your operating system) such as linkchecker to help resolve this. for other domains, use the site's https version if available. if https is not available, you can try contacting the domain and asking them if they can make the content available via https. ...
Tutorials
in such-and-such a place on the screen? how do i decorate my webpage with background images and colors? css first steps css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your
path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. css building blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. this module looks at the cascade a...
Web Components
indirectly) to the context object, e.g. the document object in the case of the normal dom, or the shadowroot in the case of a shadow dom. event extensions extensions to the event interface related to shadow dom: event.composed: returns a boolean which indicates whether the event will propagate across the shadow dom boundary into the standard dom (true), or not (false). event.composed
path: returns the event’s
path (objects on which listeners will be invoked). this does not include nodes in shadow trees if the shadow root was created with shadowroot.mode closed. html templates <template> contains an html fragment that is not rendered when a containing document is initially loaded, but can be displayed at runtime using javascript, mainly used as the basis of custom eleme...