Search completed in 1.21 seconds.
AudioListener.speedOfSound - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
... example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
... example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
Speed index - MDN Web Docs Glossary: Definitions of Web-related terms
it is the average time at which visible parts of the page are displayed. expressed in milliseconds, and dependent on the size of the viewport, the lower the score, the better. the calculation calculates what percent of the page is visually complete at every 100ms interval until the page is visually complete. ...
GeolocationCoordinates.speed - Web APIs
the geolocationcoordinates.
speed read-only property is a double representing the velocity of the device in meters per second. this value is null if the implementation is not able to measure it. syntax let
speed = geolocationcoordinatesinstance.
speed value a double representing the velocity of the device in meters per second. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.
speed' in that specification. recommendation initial specification. ...
Index - Web APIs
nd is an animationtimeline-based object. by default, the animation's timeline and the document's timeline are the same. 81 animation.updateplaybackrate() api, animation, experimental, interface, method, reference, web animations, playbackrate, updateplaybackrate, waapi, web animations api the updateplaybackrate() method of the web animations api's animation interface sets the
speed of an animation after first synchronizing its playback position. 82 animationeffect api, animation, experimental, interface, reference, web animations, web animations api the animationeffect interface of the web animations api defines current and future animation effects like keyframeeffect, which can be passed to animation objects for playing, and keyframeeffectreadonly (whi...
...operty of the audiobuffersourcenode interface is a floating-point value indicating, in seconds, where in the audiobuffer the restart of the play must happen. 119 audiobuffersourcenode.playbackrate api, audiobuffersourcenode, property, reference, web audio api, playbackrate the playbackrate property of the audiobuffersourcenode interface is a k-rate audioparam that defines the
speed at which the audio asset will be played. 120 audiobuffersourcenode.start() api, audio, audiobuffersourcenode, media, method, reference, web audio api, sound, start undefined. 121 audioconfiguration api, audio, audioconfiguration, experimental, interface, media capabilities api, reference, video the audioconfiguration dictionary of the media capabilities a...
...ram representing the z position of the listener in 3d cartesian space. 150 audiolistener.setorientation() api, audiolistener, method, reference, référence(2), web audio api, setorientation void. 151 audiolistener.setposition() api, audiolistener, deprecated, method, reference, référence(2), web audio api, setposition void. 152 audiolistener.
speedofsound api, audiolistener, deprecated, property, reference, web audio api,
speedofsound the
speedofsound property of the audiolistener interface is a double value representing the
speed of sound, in meters per second. 153 audiolistener.upx api, audio, audiolistener, property, reference, web audio api, upx the upx read-only property of the audiolistener interface is ...
...And 11 more matches
Monitoring downloads - Archive of obsolete content
irefox 3, using the download manager. as a nice bonus, it also demonstrates how to use the storage api to issue sqlite commands on a database. the result is a window you can open by choosing "download log" in the tools menu, which lists all downloads that have been started since you installed the extension. in the list is the name of the file, the start and end times of the download, the download
speed, and the status of the download. a tooltip is included that displays the full source url of the file. download the full sample. setting up when the extension loads, it will do some housekeeping chores. in particular, it needs to get an instance of the download manager's nsidownloadmanager interface and create the database into which its data will be stored. onload: function() { // initial...
...the download manager instance is cached into a member variable in the downloadlogger object for reuse later, and its addlistener() method is called to start listening for download status updates. the database file is opened, and an sqlite create table command is executed to create the table. finally, the database is c...
...of the nsidownloadprogresslistener interface. that code looks like this: ondownloadstatechange: function(astate, adownload) { var statement; switch(adownload.state) { case components.interfaces.nsidownloadmanager.download_downloading: // add a new row for the download being started; each row includes the // source uri, size, and start time. the end time and download
speed // are both set to 0 at first, since we don't know those yet. // status is the same status value that came from the download manager. var dbconn = this.storageservice.opendatabase(this.dbfile); statement = dbconn.createstatement("replace into items values " + "(?1, ?2, ?3, 0, 0.0, 0)"); statement.bindstringparameter(0...
...And 5 more matches
text-rendering - CSS: Cascading Style Sheets
the text-rendering css property provides information to the rendering engine about what to optimize for when rendering text. the browser makes trade-offs among
speed, legibility, and geometric precision. /* keyword values */ text-rendering: auto; text-rendering: optimize
speed; text-rendering: optimizelegibility; text-rendering: geometricprecision; /* global values */ text-rendering: inherit; text-rendering: initial; text-rendering: unset; note: the text-rendering property is an svg property that is not defined in any css standard. however, gecko and webkit browsers let you apply this property to html and xml content on windows, macos, and linux. one very visible effect is optimizelegibility, which enables ligatures (ff, fi, fl, etc.) in text smaller than 20px for some fonts (for exampl...
...s let you apply this property to html and xml content on windows, macos, and linux. one very visible effect is optimizelegibility, which enables ligatures (ff, fi, fl, etc.) in text smaller than 20px for some fonts (for example, microsoft's calibri, candara, constantia, and corbel, or the dejavu font family). ...
...fl, etc.) in text smaller than 20px for some fonts (for example, microsoft's calibri, candara, constantia, and corbel, or the dejavu font family). syntax values auto the browser makes educated guesses about when to optimize for
speed, legibility, and geometric precision while drawing text. for differences in how this value is interpreted by the browser, see the compatibility table. optimize
speed the browser emphasizes rendering
speed over legibility and geometric precision when drawing text. it disables kerning and ligatures. optimizelegibility the browser emphasizes legibility over rendering
speed and geometric precision. this enables kerning and optional ligatures. geometricprecision the browser emphasizes geometric precision over rendering
speed and legibility. certain aspects ...
...And 5 more matches
Key Values - Web APIs
nux android "channeldown" switches to the previous channel. appcommand_media_channel_down qt::key_channeldown (0x01000119) keycode_channel_down (167) "channelup" switches to the next channel. appcommand_media_channel_up qt::key_channelup (0x01000118) keycode_channel_up (166) "mediafastforward" [2] starts, continues, or increases the
speed of fast forwarding the media. appcommand_media_fast_forward gdk_key_audioforward (0x1008ff97) qt:key_audioforward (0x01000102) keycode_media_fast_forward (90) "mediapause" pauses the currently playing media. note: some older applications use simply "pause", but this is not correct. appcommand_media_pause gdk_key_audiopause (0x1008ff31...
...000102) keycode_media_fast_forward (90) "mediapause" pauses the currently playing media. note: some older applications use simply "pause", but this is not correct. appcommand_media_pause gdk_key_audiopause (0x1008ff31) qt::key_mediapause (0x1000085) keycode_media_pause (127) "mediaplay" starts or continues playing media at normal
speed, if not already doing so. has no effect otherwise. appcommand_media_play gdk_key_audioplay (0x1008ff14) keycode_media_play (126) "mediaplaypause" toggles between playing and pausing the current media. vk_media_play_pause (0xb3) appcommand_media_play_pause qt::key_mediatoggleplaypause (0x1000086) keycode_media_play_pause (85) "mediarecord" star...
... vk_media_play_pause (0xb3) appcommand_media_play_pause qt::key_mediatoggleplaypause (0x1000086) keycode_media_play_pause (85) "mediarecord" starts or resumes recording media. appcommand_media_record gdk_key_audiorecord (0x1008ff1c) qt::key_mediarecord (0x01000084) keycode_media_record (130) "mediarewind" starts, continues, or increases the
speed of rewinding the media. appcommand_media_rewind gdk_key_audiorewind (0x1008ff3e) qt::key_audiorewind (0x010000c5) keycode_media_rewind (89) "mediastop" stops the current media activity (such as playing, recording, pausing, forwarding, or rewinding). has no effect if the media is currently stopped already. vk_media_stop (0xb2) appcommand_media_stop gdk_ke...
...And 3 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
sed language called xul for defining the user interface of your application. css is used to style these ui's and dtd's are used to localize the textual information - making your application extremely flexible and able to be utilized across the globe. javascript, considered by many to be the best scripting language ever designed is ideal for specifying the behavior of your interface widgets. where
speed is the foremost consideration, we provide c++ libraries with multi-language interfaces for comprehensive, performant access to networking, filesystem, content, rendering, and much more. what this means to you as the developer is this: you can take advantage of skills you already have with xml or web technologies to design and implement anything from a simple text editor to a comprehensive ide - c...
...ranslate information from web services, rss, soap, or other xml-based languages and convert them into a form that you might display in your user interface. the gecko rendering engine gecko is the revolutionary rendering engine that offers advanced features for internet browsing anywhere across applications, computing platforms and devices. this innovation in browser technology offers small size,
speed and industry leading standards support. gecko is the premier cross-platform, full-featured, mature and well-tested layout engine available, providing robust and high quality support for a massive array of standards. its ability to render web content correctly is exceptional. gecko consists roughly of an html parser and xml parser, a dom implementation, a css parser and style system, and the code ...
...reting and rendering the graphics, text and script on the web. with gecko, mozilla has cleanly separated the browser engine component from the rest of the client software so it can be embedded and used to interpret, display and run web content, applications and services on any computing platform or device. open source and freely available, gecko is small in size and modular and achieves rendering
speed superior to all other browser engines - which makes it perfect for embedding into both desktop applications such as browsers and new devices such as browsing appliances and set top boxes. supporting gecko technologies provide a complete set of resources for efficient development, including full support of web standards, a cross-platform/cross-device user interface language, an extensible architec...
...And 2 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
, netscape, netscape navigator netscape navigator or netscape was a leading browser in the 1990s. netscape was based on mosaic and the netscape team was led by marc andreessen, a programmer who also wrote code for mosaic. 286 network throttling glossary, rum, reference, synthetic monitoring, web performance network throttling is an intentional slowing down of internet
speed. in web performance, network throttling, or network condition emulation, it is used to emulate low bandwidth conditions experienced by likely a large segment of a site's target user base. 287 node disambiguation, glossary the term node can have several meanings depending on the context. it may refer to: 288 node (dom) codingscripting, glossary in the cont...
...speculative loads for scripts, style sheets and images it finds ahead in the stream and runs the html tree construction algorithm speculatively. the upside is that when a speculation succeeds, there's no need to reparse the part of the incoming file that was already scanned for scripts, style sheets and images. the downside is that there's more work lost when the speculation fails. 430
speed index glossary, performance, reference, web performance
speed index (si) is a page load performance metric that shows you how quickly the contents of a page are visibly populated. it is the average time at which visible parts of the page are displayed. expressed in milliseconds, and dependent on the size of the viewport, the lower the score, the better. 431 stacking context ...
...ng, ssl, security, tcp, tcp handshake, tls, web performance tcp uses a three-way handshake (aka tcp-handshake, three message handshake, and/or syn-syn-ack) to set up a tcp/ip connection over an ip based network. 448 tcp slow start glossary, infrastructure, networking, tcp, transmission control protocol, web performance, data tcp slow start helps buildup transmission
speeds to the network's capabilities. it does this without initially knowing what those capabilities are and without creating congestion. tcp slow start is an algorithm used to detect the available bandwidth for packet transmission, and balances the
speed of a network connection. it prevents the appearance of network congestion whose capabilities are initially unknown, and slowly increases the volume o...
...And 2 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
constants before you load it in the browser. the code looks like this: const xrotationdegreespersecond = 25; const yrotationdegreespersecond = 15; const zrotationdegreespersecond = 35; const enablerotation = true; const allowmouserotation = true; const allowkeyboardmotion = true; const enableforcepolyfill = false; //const session_type = "immersive-vr"; const session_type = "inline"; const mouse_
speed = 0.003; xrotationdegreespersecond the number of degrees of rotation to apply around the x axis per second. yrotationdegreespersecond the number of degrees to rotate around the y axis each second. zrotationdegreespersecond the number of degrees per second to rotate around the z axis. enablerotation a boolean indicating whether or not to enable the rotation of the cube at all. allowmou...
...this boolean is true, the example will attempt to use the webxr polyfill even if the browser actually has support for webxr. if false, the polyfill is only used if the browser doesn't implement navigator.xr. session_type the type of xr session to create: inline for an inline session presented in the context of the document and immersive-vr to present the scene to an immersive vr headset. mouse_
speed a multiplier used to scale the inputs from the mouse used for pitch and yaw control. move_distance the distance to move in response to any of the keys used to move the viewer through the scene. note: this example always displays what it renders on the screen, even if using immersive-vr mode. this lets you compare any differences in rendering between the two modes, and lets you see output fr...
...teviewby() function, defined next, to calculate and store the new pitch (looking up and down) and yaw (looking left and right) values. function handlepointermove(event) { if (event.buttons & 2) { rotateviewby(event.movementx, event.movementy); } } calculating the new pitch and yaw values is handled by the function rotateviewby(): function rotateviewby(dx, dy) { mouseyaw -= dx * mouse_
speed; mousepitch -= dy * mouse_
speed; if (mousepitch < -math.pi * 0.5) { mousepitch = -math.pi * 0.5; } else if (mousepitch > math.pi * 0.5) { mousepitch = math.pi * 0.5; } } given as input the mouse deltas, dx and dy, the new yaw value is computed by subtracting from the current value of mouseyaw the product of dx and the mouse_
speed scaling constant. you can, then, control how resp...
...And 2 more matches
Understanding latency - Web Performance
les. the greater the number and size of these requests, the greater the impact of high latency on user experience. on a connection with low latency, requested resources will appear almost immediately. on a connection with high latency, there will be a discernible delay between the time that a request is sent, and the resources are returned. we can determine the amount of latency by measuring the
speed with which the data moves from one network location to another. latency can be measured one way, for example, the amount of time it takes to send a request for resources, or the length of the entire round-trip from the browser’s request for a resource to the moment when the requested resource arrives at the browser. network throttling to emulate the latency of a low bandwidth network, you ca...
...sted resource arrives at the browser. network throttling to emulate the latency of a low bandwidth network, you can use developer tools and switch to a lower end network connection. in the developer tools, under the network table, you can switch the throttling option to 2g, 3g, etc. ...
...arrives at the browser. network throttling to emulate the latency of a low bandwidth network, you can use developer tools and switch to a lower end network connection. in the developer tools, under the network table, you can switch the throttling option to 2g, 3g, etc. ...
...And 2 more matches
Perceived performance - Learn web development
e faster, but you can make it feel faster even if the metrics discussed in the othser sections can't be improved. there is no unicorn metric that can measure what the user feels, but metrics are useful in guaging improvements (and regressions). relevant measurements include first meaningful paint (fmp), largest contentful paint (lcp), time to interactive (tti), render start, dom interactive, and
speed index. first paint is reported by the browser and provides the time, in ms, of when the page starts changing; but this change can be a simple background color update or something even less noticable. it doesn’t indicate completeness and may report a time when nothing visible is painted. first contentful paint (fcp) reports the time when the browser first rendered anything of signifigance, be t...
...or that the user has content to consume. the first meaningful paint, or fmp, is the when content appears on the screen that is actually meaningful; which is a better metric for user-perceived loading experience, but still not ideal. largest contentful paint (lcp) metric, definited in the largest contentful paint api, reports the render time of the largest content element visible in the viewport.
speed index is also used to approximate perceived performance: it measures the average time for pixels on the visible screen to be painted. it doesn't account for jitter, nor does it weight which content important to a user more highly, so it's not a perfect metric. these metrics have to do with initial load and render. it is also important to ensure the site feels fast once the user begins interactin...
...s to make it seem faster. there are several tips to improving perceived performance. improving perceived performance understanding networking, how the browser works, user perception of time, etc., can help you better understand how to improve the user interaction. however, you don't have to know the ins and outs of how everything, including how the human mind works, to improve the perception of
speed. how fast or slow something feels like it's taking depends a lot on whether the user is actively or passively waiting for this thing to happen. waits can have an active and passive phase. when the user is active - moving the mouse, thinking, being entertainted, they are in an active phase. the passive phase occurs when the user is passively waiting, like staring at a monochrome screen. if both t...
...ut the user doesn't feel like they're waiting for content until, well, until they're waiting for content. conclusion by turning as much of the download, render and wait time into active phases and reducing any passive waiting, even if the objective measurements stay the same, the user will feel like the content downloaded, rendered, and responded more quickly. now that we know what we should be
speeding up, let's take a look at some metrics and learn how we can measure these events. previous overview: performance next in this module the "why" of web performance what is web performance? how do users perceive performance? measuring performance multimedia: images multimedia: video javascript performance best practices. html performance features css performance features font...
The "why" of web performance - Learn web development
e a sluggish site. that is why we care. why care about performance? web performance—and its assocatiated best practices—are vital for your website visitors to have a good experience. in a sense, web performance can be considered a subset of web accessibility. with performance as with accessibility, you consider what device a site visitor is using to access the site and the device connection
speed. as an example, consider the loading experience of cnn.com, which at the time of this writing had over 400 http requests with a file size of over 22.6mb. imagine loading this on a desktop computer connected to a fibre optic network. this would seem relatively fast, and the file size would be largely irrelevant. imagine loading that same site using tethered mobile data on a 9 year-old ipad wh...
... or subscribing to a newsletter. the action being measured as the conversion rate depends on the website's business goals. performance impacts conversion; improving web performance improves conversion. site visitors expect a site to load in two seconds or less; sometimes even less on mobile (where it generally takes longer). these same site visitors begin abandoning slow sites at 3 seconds. the
speed at which a site loads is one factor. if the site is slow to react to user interaction, or appears janky, this causes site visitors to lose interest and trust. here's some real-world examples of performance improvements: tokopedia reduced render time from 14s to 2s for 3g connections and saw a 19% increase in visitors, 35% increase in total sessions, 7% increase in new users, 17% increase i...
...visitors, you need to create an accessible site that provides a good user experience. building websites requires html, css, and javascript, typically including binary file types such as images and video. the decisions you make and the tools you choose as you build your site can greatly affect the performance of the finished work. good performance is an asset. bad performance is a liability. site
speed directly affects bounce rates, conversion, revenue, user satisfaction, and search engine ranking. performant sites have been shown to increase visitor retention and user satisfaction. slow content has been shown to lead to site abandonment, with some visitors leaving to never return. reducing the amount of data that passes between the client and the server lowers the costs to all parties. reducin...
...een shown to lead to site abandonment, with some visitors leaving to never return. reducing the amount of data that passes between the client and the server lowers the costs to all parties. reducing html/css/javascript and media file sizes reduces both the time to load and a site's power consumption (see performance budgets). tracking performance is important. multiple factors, including network
speed and device capabilities affect performance. there is no single performance metric; and differing business objectives may mean different metrics are more relavant to the goals of the site or the organization that it supports. how the performance of your site is perceivedd is user experience! conclusion web performance is important for accessibility and also for other website metrics that serve t...
Responsive Design Mode - Firefox Developer Tools
ay in a tooltip. network throttling if you do all your development and testing using a very fast network connection, users may experience problems with your site if they are using a slower connection. in responsive design mode, you can instruct the browser to emulate, very approximately, the characteristics of various different types of networks. ...
...p. network throttling if you do all your development and testing using a very fast network connection, users may experience problems with your site if they are using a slower connection. in responsive design mode, you can instruct the browser to emulate, very approximately, the characteristics of various different types of networks. ...
...ristics of various different types of networks. the characteristics emulated are: download
speed upload
speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions. ...
...us different types of networks. the characteristics emulated are: download
speed upload
speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions. ...
Animation.updatePlaybackRate() - Web APIs
the updateplaybackrate() method of the web animations api's animation interface sets the
speed of an animation after first synchronizing its playback position. in some cases, an animation may run on a separate thread or process and will continue updating even while long-running javascript delays the main thread. in such a case, setting the playbackrate on the animation directly may cause the animation's playback position to jump since its playback position on the main thread may have drifted from the playback position where it is currently running. updateplaybackrate() is an asynchronous method that sets the
speed of an animation after synchronizing with its current playback position, ensuring that the resulting change in
speed does not produce a sharp jump. after calling updateplaybackra...
...ts the
speed of an animation after synchronizing with its current playback position, ensuring that the resulting change in
speed does not produce a sharp jump. after calling updateplaybackrate() the animation's playbackrate is not immediately updated. it will be updated once the animation's ready promise is resolved. syntax animation.updateplaybackrate(2); parameters playbackrate the new
speed to set. this may be a positive number (to
speed up or slow down the animation), a negative number (to make it play backwards), or zero (to effectively pause the animation). return value none. ...
...ckrate is not immediately updated. it will be updated once the animation's ready promise is resolved. syntax animation.updateplaybackrate(2); parameters playbackrate the new
speed to set. this may be a positive number (to
speed up or slow down the animation), a negative number (to make it play backwards), or zero (to effectively pause the animation). return value none. ...
...x animation.updateplaybackrate(2); parameters playbackrate the new
speed to set. this may be a positive number (to
speed up or slow down the animation), a negative number (to make it play backwards), or zero (to effectively pause the animation). return value none. examples a
speed selector component would benefit from smooth updating of updateplaybackrate(), as demonstrated below:
speedselector.addeventlistener('input', evt => { cartoon.updateplaybackrate(parsefloat(evt.target.value)); cartoon.ready.then(() => { console.log(`playback rate set to ${cartoon.playbackrate}`); }); }); specifications specification status comment web animationsthe definition of 'updateplaybackrate()' in that specification. working draft ...
Basic animations - Web APIs
s> elements, it's also very easy to make (interactive) animations. in this chapter we will take a look at how to do some basic animations. probably the biggest limitation is, that once a shape gets drawn, it stays that way. if we need to move it we have to redraw it and everything that was drawn before it. it takes a lot of time to redraw complex frames and the performance depends highly on the
speed of the computer it's running on. basic animation steps these are the steps you need to take to draw a frame: clear the canvas unless the shapes you'll be drawing fill the complete canvas (for instance a backdrop image), you need to clear any shapes that have been drawn previously. the easiest way to do this is using the clearrect() method. save the canvas state if you're changing any sett...
...id="canvas" width="150" height="150"></canvas> screenshotlive sample a looping panorama in this example, a panorama is scrolled left-to-right. we're using an image of yosemite national park we took from wikipedia, but you could use any image that's larger than the canvas. var img = new image(); // user variables - customize these to change the image being scrolled, its // direction, and the
speed. ...
...ing an image of yosemite national park we took from wikipedia, but you could use any image that's larger than the canvas. var img = new image(); // user variables - customize these to change the image being scrolled, its // direction, and the
speed. ...
... // image width larger than canvas clearx = imgw; } else { clearx = canvasxsize; } if (imgh > canvasysize) { // image height larger than canvas cleary = imgh; } else { cleary = canvasysize; } // get canvas context ctx = document.getelementbyid('canvas').getcontext('2d'); // set refresh rate return setinterval(draw,
speed); } function draw() { ctx.clearrect(0, 0, clearx, cleary); // clear the canvas // if image is <= canvas size if (imgw <= canvasxsize) { // reset, start from beginning if (x > canvasxsize) { x = -imgw + x; } // draw additional image1 if (x > 0) { ctx.drawimage(img, -imgw + x, y, imgw, imgh); } // draw add...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: auto|srgb|linearrgb|inherit; animatable: yes color-profile deprecated since svg 2 it defines which color profile a raster image included through the <image> element should use. value: auto|srgb|linearrgb|<name>|<iri>|inherit; animatable: yes color-rendering it provides a hint to the browser about how to optimize its color interpolation and compositing operations. value: auto|optimize
speed|optimizequality|inherit; animatable: yes cursor it specifies the mouse cursor displayed when the mouse pointer is over an element. value: <funciri>|<keywords>|inherit; animatable: yes direction it specifies the base writing direction of text. value: ltr|rtl|inherit; animatable: yes display it allows to control the rendering of graphical or container elements. value: see css display; anim...
...ntal deprecated since svg 2 it controls glyph orientation when the inline-progression-direction is horizontal. value: <angle>|inherit; animatable: no glyph-orientation-vertical deprecated since svg 2 it controls glyph orientation when the inline-progression-direction is vertical. value: auto|<angle>|inherit; animatable: no image-rendering it provides a hint to the browser about how to make
speed vs. quality tradeoffs as it performs image processing. value: auto|optimizequality|optimize
speed; animatable: yes kerning deprecated since svg 2 it indicates whether the browser should adjust inter-glyph spacing. value: auto|<length>|inherit; animatable: yes letter-spacing it controls spacing between text characters. value: normal|<length>|inherit; animatable: yes lighting-color it defin...
...s box. value: visible|hidden|scroll|auto|inherit; animatable: yes pointer-events defines whether or when an element may be the target of a mouse event. value: bounding-box|visiblepainted|visiblefil|visiblestroke|visible |painted|fill|stroke|all|none; animatable: yes shape-rendering hints about what tradeoffs to make as the browser renders <path> element or basic shapes. value: auto|optimize
speed|crispedges|geometricprecision |inherit; animatable: yes solid-color - value:; animatable: - solid-opacity - value:; animatable: - stop-color indicates what color to use at that gradient stop. value: currentcolor|<color>|<icccolor>|inherit; animatable: yes stop-opacity defines the opacity of a given gradient stop. value: <opacity-value>|inherit; animatable: yes stroke defines the col...
...e: <length>|<percentage>; animatable: yes text-anchor defines the vertical alignment a string of text. value: start|middle|end|inherit; animatable: yes text-decoration sets the appearance of decorative lines on text. value: none|underline|overline|line-through|blink|inherit; animatable: yes text-rendering hints about what tradeoffs to make as the browser renders text. value: auto|optimize
speed|optimizelegibility|geometricprecision|inherit; animatable: yes transform defines a list of transform definitions that are applied to an element and the element's children. value: <transform-list>; animatable: yes unicode-bidi - value:; animatable: - vector-effect specifies the vector effect to use when drawing an object. value: default|non-scaling-stroke|inherit|<uri>; animatable: yes v...
Measuring performance - Learn web development
cle does not dive into using these apis, it is useful to know they exist. you can also refer to the navigation and timings article for further examples on using performance web apis. tools and metrics there are a number of different tools available to help you improve performance. these can generally be classified into two categories: tools that indicate or measure performance, such as page
speed insights or the firefox network monitor and performance monitor. these tools show you how fast or slow your web app or site load. they also indicate areas that can be improved to optimize your web app. tools that update code so that your web app or site will perform better. for example, bundling tools pack your code into single files to reduce the number of http requests or minifiers that remove...
...single files to reduce the number of http requests or minifiers that remove all whitespace from your code to make the files smaller. we'll talk about both categories in this course. and as well as talking about performance metrics we will of course talk about the metrics that you'll use to measure whether your site's performance is improving. general performance reporting tools tools like page
speed insights can measure a website’s performance. you can enter a url and get a performance report in seconds. the report contains scores about how your website is performing, both for mobile and desktop. this is a good start for getting an idea about what you are already doing well and what could be improved. at the time of writing, mdn's performance report summary looks similar to the following:...
...like how long a user has to wait before anything is displayed on the page, how many bytes need to be downloaded to display a page, and much more. it also lets you know it the measured values are considered good or bad. webpagetest.org is another example of a tool that automatically tests your site and returns useful metrics. try running your favorite website now, on both webpagetest.org and page
speed insights, and see what the scores are. network tools most browsers have tools available that you can use to run against loaded pages and determine how they are performing. for example, the firefox network monitor returns detailed information on all the assets downloaded form the network, along with a time graph that shows how long each one took to download. you can also use the performance m...
Property cache
warning: the details below are obsolete. shape integers do not exist anymore. the property cache still exists, but it is simpler now. spidermonkey mainly uses type inference to determine which properties are being accessed; in cases where type inference does not find the exact shape of the object being accessed, spidermonkey uses a pic (polymorphic inline caches) to store the result of the lookup. the property cache is only used in the interpreter. the property cache was introduced in bug 365851. ...
...oduced in bug 365851. basics in general, accessing a property of a native object entails: a property lookup; examining the shape to see how the property can be accessed; actually carrying out the property access. the property cache is a per-thread cache of the results of steps 1 and 2. when executing certain property-accessing bytecode instructions, the interpreter populates the cache to
speed future execution of the same instruction. the jit reads the property cache too, as it needs the same information when recording such an instruction. if there is a cache miss, the jit performs parts 1 and 2 of the property access and fills the cache to avoid redoing that work in the interpreter. (in some cases this is necessary for correctness. when recording a getprop, the jit needs to know the ...
...this is necessary for correctness. when recording a getprop, the jit needs to know the result type before the interpreter executes the instruction. it is crucial that jit and interpreter get the same answer; possible pitfalls include native getters and resolve hooks. so the lookup must happen only once. the jit ensures this by using the property cache to forward its work to the interpreter.) for
speed, the cache is a fixed-size hash table with no chaining. collisions simply cause old entries to be overwritten. the hash table entries are key-value pairs. the keys describe the context in which a property lookup occurs. the values consist of two word-sized members. entry->vcap caches the results of part 1 above, telling which object contains the desired property. entry->vword is described in the...
Throttling - Firefox Developer Tools
the network monitor allows you to throttle your network
speed to emulate various connection
speeds so you can see how your app will behave under different connection types. throttling the toolbar includes a throttling dropdown, which allows you to throttle your network
speed to emulate various different network
speed conditions. simply choose an option from the menu, and it will persist across reloads. the characteristics emulated are: download
speed upload
speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions. the
speeds are expressed in multiples of bits per second. select...
...cteristics emulated are: download
speed upload
speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions. the
speeds are expressed in multiples of bits per second. ...
...ted are: download
speed upload
speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions. the
speeds are expressed in multiples of bits per second. ...
AudioBufferSourceNode.playbackRate - Web APIs
the default value is 1.0. when set to another value, the audiobuffersourcenode resamples the audio before sending it to the output. ...
...the default value is 1.0. when set to another value, the audiobuffersourcenode resamples the audio before sending it to the output. ...
...urcenode.playbackrate.value = playbackrateproportion; value an audioparam whose value is a floating-point value indicating the playback rate of the audio as a decimal proportion of the original sampling rate. consider a sound buffer containing audio sampled at 44.1 khz (44,100 samples per second). let's see what a few values of playbackrate do: a playbackrate of 1.0 plays the audio at full
speed, or 44,100 hz. a playbackrate of 0.5 plays the audio at half
speed, or 22,050 hz. a playbackrate of 2.0 doubles the audio's playback rate to 88,200 hz. example in this example, the audiocontext.decodeaudiodata() function is used to decode an audio track, and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and a slider control is used to change ...
Populating the page: how browsers work - Web Performance
that page are located. if you navigate to https://example.com, the html page is located on the server with ip address of 93.184.216.34. if you’ve never visited this site, a dns lookup must happen. your browser requests a dns lookup, which is eventually fielded by a name server, which in turn responds with an ip address. after this initial request, the ip will likely be cached for a time, which
speeds up subsequent requests by retrieving the ip address from the cache instead of contacting a name server again. dns lookups usually only need to be done once per hostname for a page load. however, dns lookups must be done for each unique hostname the requested page references. if your fonts, images, scripts, ads, and metrics all have different hostnames, a dns lookup will have to be made for each...
...ceipt of this first packet of html. the first chunk of content is usually 14kb of data. in our example above, the request is definitely less than 14kb, but the linked resources aren't requested until the browser encounters the links during parsing, described below. tcp slow start / 14kb rule the first response packet will be 14kb. this is part of tcp slow start, an algorithm which balances the
speed of a network connection. slow start gradually increases the amount of data transmitted until the network's maximum bandwidth can be determined. in tcp slow start, after receipt of the initial packet, the server doubles the size of the next packet to around 28kb. subsequent packets increase in size until a predetermined threshold is reached, or congestion is experienced. if you’ve ever heard...
.... subsequent packets increase in size until a predetermined threshold is reached, or congestion is experienced. if you’ve ever heard of the 14kb rule for initial page load, tcp slow start is the reason why the initial response is 14kb, and why web performance optimization calls for focusing optimizations with this initial 14kb response in mind. tcp slow start gradually builds up transmission
speeds appropriate for the network's capabilities to avoid congestion. congestion control as the server sends data in tcp packets, the user's client confirms delivery by returning acknowledgements, or acks. the connection has a limited capacity depending on hardware and network conditions. if the server sends too many packets too quickly, they will be dropped. meaning, there will be no acknowledgemen...
color-rendering - SVG: Scalable Vector Graphics
the color-rendering attribute provides a hint to the svg user agent about how to optimize its color interpolation and compositing operations. color-rendering takes precedence over color-interpolation-filters. for example, assume color-rendering: optimize
speed and color-interpolation-filters: linearrgb. in this case, the svg user agent should perform color operations in a way that optimizes performance, 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. 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>, <clippath>,...
...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="url(#gradient)" color-rendering="optimizequality" /> <text x="45" y="50%" color-rendering="optimizequality">quality-optimized</text> <circle cx="100" cy="100" r="100" color-rendering="optimize
speed" fill="url(#gradient)" style="transform: translatex(240px);" /> <text x="290" y="50%" color-rendering="optimize
speed">
speed-optimized</text> </svg> usage notes value auto | optimize
speed | optimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance
speed and quality, but...
...m: translatex(240px);" /> <text x="290" y="50%" color-rendering="optimize
speed">
speed-optimized</text> </svg> usage notes value auto | optimize
speed | optimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance
speed and quality, but quality shall be given more importance than
speed. optimize
speed indicates that the user agent shall emphasize rendering
speed over quality. for rgb display devices, this option will sometimes cause the user agent to perform color interpolation and compositing in the device rgb color space. optimizequality indicates that the user agent shall emphasize quality over rendering
speed. ...
image-rendering - SVG: Scalable Vector Graphics
the image-rendering attribute provides a hint to the browser about how to make
speed vs. quality tradeoffs as it performs image processing. the resampling is always done in a truecolor (e.g., 24-bit) color space even if the original data and/or the target device is indexed color. note: as a presentation attribute, image-rendering can be used as a css property. see the css image-rendering property for more information. ...
..., 24-bit) color space even if the original data and/or the target device is indexed color. note: as a presentation attribute, image-rendering can be used as a css property. see the css image-rendering property for more information. as a presentation attribute, it can be applied to any element but it has effect only on the following element: <image> usage notes value auto | optimize
speed | optimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance
speed and quality, but quality shall be given more importance than
speed. optimize
speed indicates that the user agent shall emphasize rendering
speed over quality. optimizequality indicates that the user agent shall emphasize qual...
... specifications specification status comment css images module level 3the definition of 'image-rendering' in that specification. ...
shape-rendering - SVG: Scalable Vector Graphics
following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" shape-rendering="geometricprecision"/> <circle cx="320" cy="100" r="100" shape-rendering="crispedges"/> </svg> usage notes value auto | optimize
speed | crispedges | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance
speed, crisp edges and geometric precision, but with geometric precision given more importance than
speed and crisp edges. optimize
speed this value indicates that the user agent shall emphasize rendering s...
...ven more importance than
speed and crisp edges. optimize
speed this value indicates that the user agent shall emphasize rendering
speed over geometric precision and crisp edges. this option will sometimes cause the user agent to turn off shape anti-aliasing. crispedges this value indicates that the user agent shall attempt to emphasize the contrast between clean edges of artwork over rendering
speed and geometric precision. to achieve crisp edges, the user agent might turn off anti-aliasing for all lines and curves or possibly just for straight lines which are close to vertical or horizontal. also, the user agent might adjust line positions and line widths to align edges with device pixels. ...
... specifications specification status comment scalable vector graphics (svg) 2the definition of 'shape-rendering' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'shape-rendering' in that specification. ...
text-rendering - SVG: Scalable Vector Graphics
be applied to any element but it has effect only on the following element: <text> html, body, svg { height: 100%; } <svg viewbox="0 0 140 40" xmlns="http://www.w3.org/2000/svg"> <text y="15" text-rendering="geometricprecision">geometric precision</text> <text y="35" text-rendering="optimizelegibility">optimized legibility</text> </svg> usage notes value auto | optimize
speed | optimizelegibility | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance
speed, legibility and geometric precision, but with legibility given more importance than
speed and geometric precision. optimize
speed this value indicates that the user agent shall emphasize rende...
...timizelegibility | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance
speed, legibility and geometric precision, but with legibility given more importance than
speed and geometric precision. optimize
speed this value indicates that the user agent shall emphasize rendering
speed over legibility and geometric precision. this option will sometimes cause some user agents to turn off text anti-aliasing. optimizelegibility this value indicates that the user agent shall emphasize legibility over rendering
speed and geometric precision. the user agent will often choose whether to apply anti-aliasing techniques, built-in font hinting or both to produce the most legible text. ...
...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. ...
Appendix D: Loading Scripts - Archive of obsolete content
o xul overlay files or other xul documents, after which they are automatically loaded into the context of the xul window in question and executed immediately and synchronously. advantages familiarity: these tags are very similar to the html script tags familiar to most web developers. simplicity: the simple, declarative nature of these tags make them easy to find and understand at a glance.
speed: script tags may or may not be loaded from pre-compiled bytecode in the fastload cache (gecko 1.x) or startup cache (gecko 2), which means they don't necessarily need to read as source and compiled with each restart. flexibility: script tags provide a means to specify the character set and javascript version of the scripts to be loaded, which many other methods do not. debuggable: development t...
...acter set and javascript version of the scripts to be loaded, which many other methods do not. debuggable: development tools support debugging javascript loaded by script tags disadvantages scoping: scripts loaded via script tags share the global scope with all other scripts loaded into the same window. these tags provide no means to load scripts into a private or otherwise specific scope.
speed: even if these scripts are loaded from a cache, only read and compile time are reduced. the scripts still need to execute all of their initialization code and allocate and initialize all of their data structures each time the script is loaded. loading: script loaded via script tags run in partially loaded documents. problems can ensue if the script immediately attempts to access dom nodes. this ...
Kill the XUL.mfl file for good - Archive of obsolete content
avoiding the creation of the xul.mfl file mozilla creates in its profile directory a file named xul.mfl, which contains pre-compiled ui elements. this is meant to
speed up the operation of mozilla, however in a fileserver based environment, this can be problematic: at several megabytes a pop, these files will take up a considerable amount of space, because each user has his own... ...
...ytes a pop, these files will take up a considerable amount of space, because each user has his own... loading these files from the server, and storing them back slows down the network, thus it may actually be faster without than with xul.mfl occasionnally gets corrupted, needing a manual intervention to wipe it out, before mozilla again works correctly. with quicklauncer (see above), mozilla's
speed is actually quite adequate, even without xul.mfl for these reasons, it is desirable to disable the xul.mfl functionality. unfortunately, there appears to be no "clean" way of doing so (javascript command in prefs.js or registry setting). but creating a subdirectory named xul.mfl in mozilla's profile directory seems to help (mozilla is not smart enough to remove the directory before creating the ...
Sunbird Theme Tutorial - Archive of obsolete content
s. you might prefer to use this method only while you are developing your theme, and to use the normal method for public releases. in sunbird, use the default theme or some other theme. move your theme directory to a temporary location. this uninstalls it from sunbird. use a jar tool or zip tool to pack the contents of your theme directory. it is usual to turn off compression so that your theme's
speed is maximized. make sure that the tool packs all the directories and files that make up your theme. name the packed file with the <tt>.jar</tt> extension. for example, when i wrote this article i used this command in my theme directory: zip -0r testing-0.1.jar . make this jar file available to users. normal packaging in sunbird, use the default theme or some other theme. move your theme direc...
...ng-0.1.jar . make this jar file available to users. normal packaging in sunbird, use the default theme or some other theme. move your theme directory to a temporary location. this uninstalls it from sunbird. go to your <tt>chrome</tt> directory. use a jar tool or zip tool to pack everything in your <tt>chrome</tt> directory into a file. it is usual to turn off compression so that your theme's
speed is maximized. make sure that the tool packs all the directories and files that make up your theme. name the packed file with the <tt>.jar</tt> extension. for example, when i wrote this article i used this command in my <tt>chrome</tt> directory: zip -0r testing.jar . go back to your theme directory and edit the file <tt>chrome.manifest</tt>. change the line for the calendar component to: skin ...
The Business Benefits of Web Standards - Archive of obsolete content
caught between a rock and a hard place, web designers face a formidable challenge. yet they are finding an unsuspected ally in the battle: web standards. ...
... dynamic in this respect where on many platforms including wordpress, textpattern and habari, the site theme is a complete and discrete entity in its own right. improved user experience: less bandwidth and fast loads html code is often much more compact (therefore easier to read and maintain) when used in conjunction with css. according to various reports, case studies, and andy king, author of
speed up your web site: web site optimization, css has made it possible to transform table-based layouts into css-based layouts. typically this reduces page size by 25 to 50%. this translates into better user experience, according to usability guru jakob nielsen, who notes that users tend to close a web page when it takes more than 10 seconds to load. the style sheet only needs to load once and then i...
2D maze game with device orientation - Game development
s: phaser framework phaser is a framework for building desktop and mobile html5 games. it’s quite new, but growing rapidly thanks to the passionate community involved in the development process. you can check it out on github where it’s open sourced, read the online documentation and go through the big collection of examples. the phaser framework provides you with a set of tools that will
speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself. starting with the project you can see cyber orb source code on github. the folder structure is quite straightforward: the starting point is the index.html file where we initialize the framework and set up an <canvas> to render the game on. you can open the index file in your fa...
... in. if there's nothing specified in that last argument or the element is not found, the canvas will be added to the <body> tag. without the framework, to add the canvas element to the page, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'></canvas> the important thing to remember is that the framework is setting up helpful methods to
speed up a lot of things like image manipulation or assets management, which would be a lot harder to do manually. note: you can read the building monster wants candy article for the in-depth introduction to the basic phaser-specific functions and methods. back to game states: the line below is adding a new state called boot to the game: game.state.add('boot', ball.boot); the first value is the n...
Network throttling - MDN Web Docs Glossary: Definitions of Web-related terms
network throttling is an intentional slowing down of internet
speed. in web performance, network throttling, or network condition emulation, it is used to emulate low bandwidth conditions experienced by likely a large segment of a site's target user base. it’s important not to overlook network conditions users experience on mobile. the internet
speeds for developers creating web applications in a corporate office building on a powerful computer are generally very fast. as a developer, tech writer, or designer, this is likely your experience. the network
speeds of a mobile user accessing that web application, possibly while traveling or in a remote area with poor data plan covereage, will likely be very slow, if they are able to get online at all. network throttling enables a develop...
...onditions. by emulating your user's experience via network throttling, you can more readily identify and fix load time issues. browser developer tools generally have network throttling options, to allow you to test your app under slow network conditions. firefox's developer tools for example have a drop-down menu available in both the network monitor and responsive design mode containing network
speed options (e.g. wifi, good 3g, 2g...) see also synthetic monitoring ...
From object to iframe — other embedding technologies - Learn web development
e stored in individual html pages. these were embedded in a master document called a frameset, which allowed you to specify the area on the screen that each frame filled, rather like sizing the columns and rows of a table. these were considered the height of coolness in the mid to late 90s, and there was evidence that having a webpage split up into smaller chunks like this was better for download
speeds — especially noticeable with network connections being so slow back then. they did however have many problems, which far outweighed any positives as network
speeds got faster, so you don't see them being used anymore. a little while later (late 90s, early 2000s), plugin technologies became very popular, such as java applets and flash — these allowed web developers to embed rich content into...
...n this case, we have included a link to the page instead. it is unlikely that you'll come across any browser that doesn't support <iframe>s these days. sandbox this attribute, which works in slightly more modern browsers than the rest of the <iframe> features (e.g. ie 10 and above) requests heightened security settings; we'll say more about this in the next section. note: in order to improve
speed, it's a good idea to set the iframe's src attribute with javascript after the main content is done with loading. this makes your page usable sooner and decreases your official page load time (an important seo metric.) security concerns above we mentioned security concerns — let's go into this in a bit more detail now. we are not expecting you to understand all of this content perfectly the f...
Introduction to the server side - Learn web development
nclude php, python, ruby, c#, and nodejs(javascript). the server-side code has full access to the server operating system and the developer can choose what programming language (and specific version) they wish to use. developers typically write their code using web frameworks. web frameworks are collections of functions, objects, rules and other code constructs designed to solve common problems,
speed up development, and simplify the different types of tasks faced in a particular domain. again, while both client and server-side code use frameworks, the domains are very different, and hence so are the frameworks. client-side web frameworks simplify layout and presentation tasks while server-side web frameworks provide a lot of “common” web server functionality that you might otherwise have...
...so are the frameworks. client-side web frameworks simplify layout and presentation tasks while server-side web frameworks provide a lot of “common” web server functionality that you might otherwise have to implement yourself (e.g. support for sessions, support for users and authentication, easy database access, templating libraries, etc.). note: client-side frameworks are often used to help
speed up development of client-side code, but you can also choose to write all the code by hand; in fact, writing your code by hand can be quicker and more efficient if you only need a small, simple web site ui. in contrast, you would almost never consider writing the server-side component of a web app without a framework — implementing a vital feature like an http server is really hard to do from s...
Introduction to automated testing - Learn web development
c functionality of commercial systems like the ones mentioned above. note: the above two categories are not mutually exclusive. it is possible to set up a task runner to access a service like sauce labs, or lambdatest via an api, run cross browser tests, and return results. we will look at this below as well. using a task runner to automate testing tools as we said above, you can drastically
speed up common tasks such as linting and minifying code by using a task runner to run everything you need to run automatically at a certain point in your build process. for example, this could be every time you save a file, or at some other point. inside this section we'll look at how to automate task running with node and gulp, a beginner-friendly option. setting up node and npm most tools these da...
... are basically wrappers around command line tools. so, if you can work out how to run the tools using the command line, you can then run them using npm scripts. it is a bit trickier to work with, but can be rewarding for those who are strong with their command line skills. why npm scripts? provides a good introduction with a good deal of further information. using commercial testing services to
speed up browser testing now let's look at commercial third-party browser testing services and what they can do for us. the basic premise with such applications is that the company that runs each one has a huge server farm that can run many different tests. when you use this service, you provide a url of the page you want to test along with information, such as what browsers you want it tested in. th...
Cross browser testing - Learn web development
s module focuses on testing web projects across different browsers. we look at identifying your target audience (e.g. what users, browsers, and devices do you most need to worry about?), how to go about doing testing, the main issues that you'll face with different types of code and how to mitigate them, what tools are most useful in helping you test and fix problems, and how to use automation to
speed up testing. 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 you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here. guides introduction to cross browser testing this artic...
...ues. implementing feature detection feature detection involves working out whether a browser supports a certain block of code, and running different code dependent on whether it does (or doesn't), so that the browser can always provide a working experience rather than crashing/erroring in some browsers. this article details how to write your own simple feature detection, how to use a library to
speed up implementation, and native features for feature detection such as @supports. introduction to automated testing manually running tests on several browsers and devices, several times per day, can get tedious and time-consuming. to handle this efficiently, you should become familiar with automation tools. in this article, we look at what is available, how to use task runners, and the basics of ...
Configuring Build Options
t app (firefox, thunderbird) unless you know which extensions are compatible with which apps, do not use the --enable-extensions option; the build system will automatically select the proper default set of extensions. tests ac_add_options --disable-tests by default, many auxiliary test applications are built, which can help debug and patch the mozilla source. disabling these tests can
speed build time and reduce disk space considerably. developers should generally not use this option. localization mk_add_options moz_co_locales=isocode tbd. ac_add_options --enable-ui-locale=isocode tbd. ac_add_options --with-l10n-base=/path/to/base/dir tbd. other options mk_add_options autoclobber=1 if a clobber would be required before a build, this will cause mach to clobber and co...
... (note the extra dash) to enable it at runtime, like so: `./mach run --enable-crash-reporter` ac_add_options --enable-warnings-as-errors this makes compiler warnings into errors which fail the build. this can be useful since certain warnings coincide with reviewbot lints which must be fixed before merging. ac_add_options --with-ccache=/path/to/.mozbuild/sccache/sccache this enables sccache to
speed up builds. this saves a considerable amount of time directly after a clobber build, so pulling in new updates and rebasing is less time-consuming. example mozconfig files mozilla's official builds use mozconfig files from the appropriate directory within each repository. warning: these mozconfig files are taken from production builds and are provided as examples only. it is recommended t...
Index
roduction to the javascript shell spidermonkey to get the spidermonkey javascript shell, see the spidermonkey build documentation or download a compiled binary for your platform from the nightly builds. 13 jit optimization outcomes beginner, firefox, intro, needscontent, spidermonkey spidermonkey's optimizing jit, ionmonkey, uses different optimization strategies to
speed up various operations. the most typical operations that are relevant for fast program execution are property accesses and function calls. 14 jit optimization strategies junk, spidermonkey spidermonkey's optimizing jit, ionmonkey, uses various strategies to optimize operations. the most commonplace operations that are relevant for fast program execution are property accesses a...
..., spidermonkey spidermonkey has a mark-sweep garbage collection (gc) with incremental marking mode, generational collection, and compaction. much of the gc work is performed on helper threads. 533 invariants spidermonkey or, "the zen of spidermonkey". 534 property cache spidermonkey spidermonkey's property cache is an internal data structure used to
speed up property accesses in the interpreter and to communicate between the interpreter and jit. 535 self-hosted builtins in spidermonkey javascript, spidermonkey all self-hosted code is strict, so self-hosted functions invoked in a null or undefined scope won't be run in the scope of the global object. 536 spidermonkey internals: thread safety guide, spidermonkey ...
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
constructor creates a new audiobuffersourcenode object instance. syntax var audiobuffersourcenode = new audiobuffersourcenode(context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. options optional options are as follows: buffer: an instance of audiobuffer to be played. detune: a value in cents to modulate the
speed of audio stream rendering. its nominal range is (-∞ to +∞). the default is 0. loop: a boolean indicating whether the audio should play in a loop. the default is false. if the loop is dynamically modified during playback, the new value will take effect on the next processing block of audio. loopend: an optional value, in seconds, where looping should end if the loop attribute is true. the ...
...s than 0, looping will begin at 0. if loopstart is greater than the duration of the buffer, looping will begin at the end of the buffer. this attribute is converted to an exact sample frame offset within the buffer, by multiplying by the buffer's sample rate and rounding to the nearest integer value. thus, its behavior is independent of the value of the playbackrate parameter. playbackrate: the
speed at which to render the audio stream. its default value is 1. this parameter is k-rate. this is a compound parameter with detune. its nominal range is (-∞ to +∞). return value a new audiobuffersourcenode object instance. specifications specification status comment web audio apithe definition of 'audiobuffersourcenode()' in that specification. working draft ...
AudioBufferSourceNode - Web APIs
es inherits properties from its parent, audionode. audiobuffersourcenode.buffer an audiobuffer that defines the audio asset to be played, or when set to the value null, defines a single channel of silence (in which every sample is 0.0). audiobuffersourcenode.detune is a k-rate audioparam representing detuning of playback in cents. this value is compounded with playbackrate to determine the
speed at which the sound is played. its default value is 0 (meaning no detuning), and its nominal range is -∞ to ∞. audiobuffersourcenode.loop a boolean attribute indicating if the audio asset must be replayed when the end of the audiobuffer is reached. its default value is false. audiobuffersourcenode.loopstart optional a floating-point value indicating the time, in seconds, at which playback ...
...ning that at the beginning of each loop, playback begins at the start of the audio buffer). audiobuffersourcenode.loopend optional a floating-point number indicating the time, in seconds, at which playback of the audiobuffer stops and loops back to the time indicated by loopstart, if loop is true. the default value is 0. audiobuffersourcenode.playbackrate an a-rate audioparam that defines the
speed factor at which the audio asset will be played, where a value of 1.0 is the sound's natural sampling rate. since no pitch correction is applied on the output, this can be used to change the pitch of the sample. this value is compounded with detune to determine the final playback rate. event handlers inherits event handlers from its parent, audioscheduledsourcenode. methods inherits methods f...
AudioListener - Web APIs
listener. audiolistener.setposition() sets the position of the listener. note: although these methods are deprecated they are currently the only way to set the orientation and position in firefox, internet explorer and safari. deprecated features audiolistener.dopplerfactor a double value representing the amount of pitch shift to use when rendering a doppler effect. ...
... position of the listener. note: although these methods are deprecated they are currently the only way to set the orientation and position in firefox, internet explorer and safari. deprecated features audiolistener.dopplerfactor a double value representing the amount of pitch shift to use when rendering a doppler effect. audiolistener.
speedofsound is a double value representing the
speed of sound, in meters per second. in a previous version of the specification, the dopplerfactor and
speedofsound properties and the setposition() method could be used to control the doppler effect applied to audiobuffersourcenodes connected downstream — these would be pitched up and down according to the relative
speed of the pannernode and the audiolistener. these features had a number of prob...
HTMLMediaElement.playbackRate - Web APIs
the htmlmediaelement.playbackrate property sets the rate at which the media is being played back. this is used to implement user controls for fast forward, slow motion, and so forth. the normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal
speed. if playbackrate is negative, the media is not played backwards. the audio is muted when the fast forward or slow motion is outside a useful range (for example, gecko mutes the sound outside the range 0.25 to 5.0). the pitch of the audio is corrected by default and is the same for every
speed. some browsers implement the non-standard htmlmediaelement.preservespitch property to control this. syntax // video video.playbackrate = 1.5; // audio audio.playbackrate = 1.0; value a double. 1.
...low motion is outside a useful range (for example, gecko mutes the sound outside the range 0.25 to 5.0). the pitch of the audio is corrected by default and is the same for every
speed. some browsers implement the non-standard htmlmediaelement.preservespitch property to control this. syntax // video video.playbackrate = 1.5; // audio audio.playbackrate = 1.0; value a double. 1.0 is "normal
speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. (default: 1.0) example var obj = document.createelement('video'); console.log(obj.playbackrate); // expected output: 1 specifications specification status comment html living standardthe definition of 'htmlmediaelement.playbackrate' in that specification. living st...
HTMLMediaElement - Web APIs
he ranges of the media source that the browser has played, if any. htmlmediaelement.preload is a domstring that reflects the preload html attribute, indicating what data should be preloaded, if any. possible values are: none, metadata, auto. htmlmediaelement.preservespitch is a boolean that determines if the pitch of the sound will be preserved. if set to false, the pitch will adjust to the
speed of the audio. this is implemented with prefixes in firefox (mozpreservespitch) and webkit (webkitpreservespitch). htmlmediaelement.readystate read only returns a unsigned short (enumeration) indicating the readiness state of the media. htmlmediaelement.seekable read only returns a timeranges object that contains the time ranges that the user is able to seek to, if any. htmlmediaelement.see...
... time the method is called. this method must be called after the loadedmetadata event fires. htmlmediaelement.pause() pauses the media playback. htmlmediaelement.play() begins playback of the media. htmlmediaelement.seektonextframe() seeks to the next frame in the media. this non-standard, experimental method makes it possible to manually drive reading and rendering of media at a custom
speed, or to move through the media frame-by-frame to perform filtering or other operations. htmlmediaelement.setmediakeys() returns promise. sets the mediakeys keys to use when decrypting media during playback. htmlmediaelement.setsinkid() sets the id of the audio device to use for output and returns a promise. this only works when the application is authorized to use the specified device. o...
Using IndexedDB - Web APIs
c events are rare most consumers should not need to concern themselves further. if you must ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction. you can
speed up data access by using the right scope and mode in the transaction. here are a couple of tips: when defining the scope, specify only the object stores you need. this way, you can run multiple transactions with non-overlapping scopes concurrently. only specify a readwrite transaction mode when necessary. you can concurrently run multiple readonly transactions with overlapping scopes, but you ...
... name as a string. also, you're only reading from the database, so you don't need a "readwrite" transaction. calling transaction() with no mode specified gives you a "readonly" transaction. another subtlety here is that you don't actually save the request object to a variable. since the dom event has the request as its target you can use the event to get to the result property. note that you can
speed up data access by limiting the scope and mode in the transaction. here are a couple of tips: when defining the scope, specify only the object stores you need. this way, you can run multiple transactions with non-overlapping scopes concurrently. only specify a readwrite transaction mode when necessary. you can concurrently run multiple readonly transactions with overlapping scopes, but you can...
MediaPositionState.playbackRate - Web APIs
tly playing media as well as standard pause, play, forward, reverse, and other controls. syntax let positionstate = { playbackrate: rate }; let playbackrate = positionstate.playbackrate; value a floating-point value specifying a multiplier corresponding to the current relative rate at which the media being performed is playing. a value of 1.0 indicates the media is playing forward at normal
speed, while higher values indicate that the media is being played faster than normal. lower values indicate the media is being played more slowly. negative values can be specified to indicate the media is playing in reverse, with decreasing values then indicating faster and faster reverse playback. note: a value of 0.0 is not permitted. example in this example, an app is updating the browser to l...
...values indicate the media is being played more slowly. negative values can be specified to indicate the media is playing in reverse, with decreasing values then indicating faster and faster reverse playback. note: a value of 0.0 is not permitted. example in this example, an app is updating the browser to let it know that the user has clicked a button causing the playback to shift to a double-
speed mode. it begins by creating a mediapositionstate object, then submits it to the browser it by calling navigator.mediasession.setpositionstate(). let positionstate = { duration: mymediaduration; playbackrate: 2.0; position: mymediaposition; }; navigator.mediasession.setpositionstate(positionstate); note the value 2.0 as the playbackrate. specifications specification status ...
NetworkInformation.downlinkMax - Web APIs
examples the following example monitors the connection using the change event and logs changes as they occur. ...
... examples the following example monitors the connection using the change event and logs changes as they occur. ...
Matrix math for the web - Web APIs
the focus in the glmatrix library is to have target arrays that are allocated before the update l...
...the focus in the glmatrix library is to have target arrays that are allocated before the update loop. ...
Rendering and the WebXR frame animation callback - Web APIs
k is not going to happen at precise 1/60th of a second intervals—and, indeed, could happen at other rates if the user's display has a different framer ate—you can't rely on the simple fact that your code is running to assume that it's been 1/60th of a second since the last frame. for that reason, you need to use the timestamp provided to ensure your animation renders at precisely the desired
speed. to do so, the first thing you need to do is to compute the time that has elapsed since the last frame was rendered: let lastframetime = 0; function drawframe(time, frame) { /* ... schedule next frame, prepare the buffer, etc ... */ const deltatime = (time - lastframetime) * 0.001; lastframetime = time; for (let view of pose.views) { /* render each view */ } } this maintains a...
...tatime; this computes the amount by which the object has rotated around each of the three axes since the last time the frame was drawn. without this, the shape would rotate by the given amount every frame, regardless of the elapsed time. this could cause substantial stutter in many cases. the same concept applied for objects that are moving rather than simply rotating: const xdistancemoved = x
speedpersecond * deltatime; const ydistancemoved = y
speedpersecond * deltatime; const zdistancemoved = z
speedpersecond * deltatime; x
speedpersecond, y
speedpersecond, and z
speedpersecond each contian that axis's component of the object's velocity. in other words, [xdistancemoved, ydistancemoved, zdistancemoved] is a vector representing the velocity of the object. additional tasks related to animating...
Web Animations API Concepts - Web APIs
dow is closed. spread along that timeline according to their durations are our animations. each animation is anchored to a point in the timeline by its starttime, representing the moment along the document’s timeline when the animation starts playing. all the animation's playback relies on this timeline: seeking the animation moves the animation’s position along the timeline; slowing down or
speeding up the playback rate condenses or expands its spread across the timeline; repeating the animation lines up additional iterations of it along the timeline. in the future, we might have timelines based on gestures or scroll position or even parent and child timelines. the web animations api opens up so many possibilities! animation the animation model can be thought of as an array of snapshots...
...an be imagined as dvd players: they’re used for controlling media playback, but without media to play, they don’t do anything. animation objects accept media in the form of animation effects, specifically keyframe effects (we’ll get to those in a moment). like a dvd player, we can use the animation object’s methods to play, pause, seek, and control the animation’s playback direction and
speed. animation effect if animation objects are dvd players, we can think of animation effects, or keyframe effects, as dvds. keyframe effects are a bundle of information including at the bare minimum a set of keys and the duration they need to be animated over. the animation object takes this information and, using the timeline object, assembles a playable animation we can view and reference. we...
Advanced techniques: Creating and sequencing audio - Web APIs
hing more complex, tone.js would be a good place to start. however, we want to demonstrate how to build such a demo from first principles, as a learning exercise. note: you can find the source code on github as step-sequencer; see the step-sequencer running live also. the interface consists of master controls, which allow us to play/stop the sequencer, and adjust the bpm (beats per minute) to
speed up or slow down the "music". there are four different sounds, or voices, which can be played. each voice has four buttons, which represent four beats in one bar of music. when they are enabled the note will sound. when the instrument plays, it will move across this set of beats and loop the bar. each voice also has local controls, which allow you to manipulate the effects or parameters particul...
... samplesource.buffer = audiobuffer; samplesource.connect(audiocontext.destination) samplesource.start(); return samplesource; } note: we can call stop() on an audiobuffersourcenode, however, this will happen automatically when the sample has finished playing. dial-up user controls the audiobuffersourcenode comes with a playbackrate property. let's expose that to our ui, so we can
speed up and slow down our sample. we'll do that in the same sort of way as before: <label for="rate">rate</label> <input name="rate" id="rate" type="range" min="0.1" max="2" value="1" step="0.1" /> let playbackrate = 1; const ratecontrol = document.queryselector('#rate'); ratecontrol.addeventlistener('input', function() { playbackrate = number(this.value); }, false); the final playsample() func...
animation-timing-function - CSS: Cascading Style Sheets
e step timing functions divides the input time into a specified number of intervals that are equal in length. it is defined by a number of steps and a step position. ease equal to cubic-bezier(0.25, 0.1, 0.25, 1.0), the default value, increases in velocity towards the middle of the animation, slowing back down at the end. linear equal to cubic-bezier(0.0, 0.0, 1.0, 1.0), animates at an even
speed. ...
...t are equal in length. it is defined by a number of steps and a step position. ease equal to cubic-bezier(0.25, 0.1, 0.25, 1.0), the default value, increases in velocity towards the middle of the animation, slowing back down at the end. linear equal to cubic-bezier(0.0, 0.0, 1.0, 1.0), animates at an even
speed. ease-in equal to cubic-bezier(0.42, 0, 1.0, 1.0), starts off slowly, with the
speed of the transition of the animating properting increasing until complete. ease-out equal to cubic-bezier(0, 0, 0.58, 1.0), starts quickly, slowing down the animation continues. • ease-in-out equal to cubic-bezier(0.42, 0, 0.58, 1.0), with the animating properties slowly transitioning,
speeding up, and then slowing down again. cubic-bezier(p1, p2, p3, p4) an author defined cubic-bezier curv...
<easing-function> - CSS: Cascading Style Sheets
the easing functions in the cubic-bezier subset of easing functions are often called "smooth" easing functions, because they can be used to smooth down the start and end of the animation. they correlate a time ratio to an output ratio, both expressed as <number>s. for these values, 0.0 represents the initial state, and 1.0 represents the final state. ...
...e value is invalid. keywords for common cubic-bezier easing functions ease the animation starts slowly, accelerates sharply, and then slows gradually towards the end. this keyword represents the easing function cubic-bezier(0.25, 0.1, 0.25, 1.0). it is similar to ease-in-out, though it accelerates more sharply at the beginning. ease-in the animation starts slowly, and then progressively
speeds up until the end, at which point it stops abruptly. this keyword represents the easing function cubic-bezier(0.42, 0.0, 1.0, 1.0). ease-in-out the animation starts slowly,
speeds up, and then slows down towards the end. this keyword represents the easing function cubic-bezier(0.42, 0.0, 0.58, 1.0). at the beginning, it behaves like the ease-in function; at the end, it is like the ease-out fu...
transition-timing-function - CSS: Cascading Style Sheets
ets how intermediate values are calculated for css properties being affected by a transition effect. 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. this, in essence, lets you establish an acceleration curve so that the
speed of the transition can vary over its duration. this acceleration curve is defined using one <timing-function> for each property to be transitioned. you may specify multiple timing functions; each one will be applied to the corresponding property as specified by the transition-property property, which acts as a transition-property list. if there are fewer timing functions specified than in the tr...
...ming functions divides the input time into a specified number of intervals that are equal in length. it is defined by a number of steps and a step position. ease equal to cubic-bezier(0.25, 0.1, 0.25, 1.0), the default value, increases in velocity towards the middle of the transition, slowing back down at the end. linear equal to cubic-bezier(0.0, 0.0, 1.0, 1.0), transitions at an even
speed. ease-in equal to cubic-bezier(0.42, 0, 1.0, 1.0), starts off slowly, with the transition
speed increasing until complete. ease-out equal to cubic-bezier(0, 0, 0.58, 1.0), starts transitioning quickly, slowing down the transition continues. • ease-in-out equal to cubic-bezier(0.42, 0, 0.58, 1.0), starts transitioning slowly,
speeds up, and then slows down again. cubic-bezier(p1, p...
Web Audio playbackRate explained - Developer guides
the playbackrate property of the <audio> and <video> elements allows us to change the
speed, or rate, at which a piece of web audio or video is playing. this article explains playbackrate in detail. playbackrate basics let's starting by looking at a brief example of playbackrate usage: var myaudio = document.createelement('audio'); myaudio.setattribute('src','audiofile.mp3'); myaudio.playbackrate = 0.5; here we create an <audio> element, and set its src to a file of our choice. ...
...g. this article explains playbackrate in detail. playbackrate basics let's starting by looking at a brief example of playbackrate usage: var myaudio = document.createelement('audio'); myaudio.setattribute('src','audiofile.mp3'); myaudio.playbackrate = 0.5; here we create an <audio> element, and set its src to a file of our choice. ...
Using the application cache - HTML: Hypertext Markup Language
caching mechanism that lets web applications run offline. this application cache (appcache) interface lists resources that browsers should cache to be available offline. applications that are cached load and work correctly offline, even if users press the refresh button. an application cache gives the following benefits: offline browsing users can navigate a site even when they are offline.
speed cached resources are local, and therefore load faster. reduced server load the browser only downloads resources that have changed from the server. how the application cache works enabling the application cache to enable the application cache for an application, include the manifest attribute in the <html> element: <html manifest="/example.appcache"> … </html> the manifest attribute ...
...e term "offline(-enabled) applications" sometimes refers specifically to applications that the user has allowed to use offline capabilities. loading documents the use of an application cache modifies the normal process of loading a document: if an application cache exists, the browser loads the document and its associated resources directly from the cache, without accessing the network. this
speeds up the document load time. the browser then checks to see if the cache manifest has been updated on the server. if the cache manifest has been updated, the browser downloads a new version of the manifest and the resources listed in the manifest. this is done in the background and does not affect performance significantly. the process for loading documents and updating the application cache i...
Web audio codec guide - Web media technologies
music for streaming for streaming music, you want to select a codec that minimizes bandwidth usage as much as possible while introducing as few artifacts as possible into the audio through compression. this is necessary because the rate at which the music is downloaded needs to be no greater than the amount of bandwidth available on the network, and ideally there should be room left for network
speed fluctuations and use of the network by other applications. unless there's a specific need for lossless compression, or the network bandwidth is guaranteed to be high enough to support it, a lossy compression scheme is a good choice. which one you choose depends on browser compatibility and the availability of any special features you may need the codec to support. usually the latency is not par...
...rt one audio format. of course, if you can provide multiple formats (for example, by using the <source> element within your <audio> and <video> elements), you can avoid many or all of those exceptions. example: music for download music being downloaded by the user can be compressed to a larger overall file size than streamed music, since (unlike when streaming) it doesn't matter if the download
speed is slower than the playback
speed of the media. that means you can consider using lossy compression at higher bit rates, which results in larger files but with less loss of fidelity. or you can choose a lossless format. the choice depends largely on the union of your application's requirements and the preferences of your users. for an actual music download service, you might offer songs for down...
Web video codec guide - Web media technologies
diagonal straight or curved edges that should be smooth take on a jagged appearance, looking somewhat like a set of stair steps. this is the effect that is being reduced by "anti-aliasing" filters. ...
... color edging color edging is a type of visual artifact that presents as spurious colors introduced along the edges of colored objects within the scene. ...
Performance fundamentals - Web Performance
control over rendering and don't need theming. for content drawn using canvas, it's up to the developer to hit framerate targets: they have direct control over what's drawn. for html and css content, the path to high framerate is to use the right primitives. firefox is highly optimized to scroll arbitrary content; this is usually not a concern. but often trading some generality and quality for
speed, such as using a static rendering instead of a css radial gradient, can push scrolling framerate over a target. css media queries allow these compromises to be restricted only to devices that need them. many applications use transitions or animations through "pages", or "panels". for example, the user taps a "settings" button to transition into an application configuration screen, or a settings ...
...ptimized to transition and animate scenes that: use pages/panels approximately the size of the device screen or smaller transition/animate the css transform and opacity properties transitions and animations that adhere to these guidelines can be offloaded to the system compositor and run maximally efficiently. memory and power usage improving memory and power usage is a similar problem to
speeding up startup: don't do unneeded work or lazily load uncommonly-used ui resources. do use efficient data structures and ensure resources like images are optimized well. modern cpus can enter a lower-power mode when mostly idle. applications that constantly fire timers or keep unnecessary animations running prevent cpus from entering low-power mode. power-efficient applications shouldn't do that.
Performance budgets - Web Performance
a threshold over a period of time. why do i need a performance budget? a budget exists to reflect your reachable goals. it's a tradeoff between user experience, against other performance indicators (e.g. conversion rate). these goals can be: timing based (e.g. time to interactive, first contentful paint). quantity-based (e.g. amount of js files/total image size). rule-based (e.g. page
speed index, lighthouse score). their primary goal is to prevent regressions, but they can provide insights to forecast trends (i.e. on september, 50% of the budget was spent in a week). additionally, it can uncover development needs (i.e. a large library with smaller alternatives is often picked to solve a common problem). how do i define a performance budget? a budget should include 2 levels: ...
...a common problem). how do i define a performance budget? a budget should include 2 levels: warning. error. the warning level allows you to be proactive and plan any tech debt, while not blocking development or deploys. the error level is an upper bound limit, where changes will have a negative and noticeable impact. in order to begin, you need to first measure the devices and connection
speeds where your users are coming from (e.g. a ~$200 android device over a 3g connection), using multiple tools. these time-based metrics will translate into file-size budgets. a default baseline to reduce bounce rate is to achieve time to interactive under 5 seconds in 3g/4g, and under 2 seconds for subsequent loads. however, based on the specific goals and content of your site, you might choose to ...
format - SVG: Scalable Vector Graphics
recommendation initial definition for <glyphref> scalable vector graphics (svg) 1.1 (second edition)the definition of 'format for ...
... recommendation initial definition for <glyphref> scalable vector graphics (svg) 1.1 (second edition)the definition of 'format for <altglyph>'...
WebAssembly Concepts - WebAssembly
t can be run in modern web browsers and provides new features and major gains in performance. it is not primarily intended to be written by hand, rather it is designed to be an effective compilation target for low-level source languages like c, c++, rust, etc. this has huge implications for the web platform — it provides a way to run code written in multiple languages on the web at near-native
speed, with client apps running on the web that previously couldn’t have done so. what’s more, you don’t even have to know how to create webassembly code to take advantage of it. webassembly modules can be imported into a web (or node.js) app, exposing webassembly functions for use via javascript. javascript frameworks could make use of webassembly to confer massive performance advantages and ne...
...cript frameworks could make use of webassembly to confer massive performance advantages and new features while still making functionality easily available to web developers. webassembly goals webassembly is being created as an open standard inside the w3c webassembly community group with the following goals: be fast, efficient, and portable — webassembly code can be executed at near-native
speed across different platforms by taking advantage of common hardware capabilities. be readable and debuggable — webassembly is a low-level assembly language, but it does have a human-readable text format (the specification for which is still being finalized) that allows code to be written, viewed, and debugged by hand. keep secure — webassembly is specified to be run in a safe, sandboxed execu...
lang/functional - Archive of obsolete content
to the wrapper function. identity(value) returns the same value that is used as the argument. in math: f(x) = x. let { identity } = require("sdk/lang/functional"); let x = 5; identity(x); // 5 parameters value : mixed the value to be returned. returns mixed : the value that was originally passed in. memoize(fn, hasher) memoizes a given function by caching the computed result. useful for
speeding up slow-running computations. if passed an optional hashfunction, it will be used to compute the hash key for storing the result, based on the arguments to the original function. the default hashfunction just uses the first argument to the memoized function as the key. let { memoize } = require("sdk/lang/functional"); let memoizedfn = memoize(primefactorization); memoizedfn(50); // returns ...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
ions of interest where you’re not sure what’s going on, and the next time you run it, use continue to shift to that location and start investigating again. fixme: figure 4: adding a watch target mozunit mozunit is a tool for javascript that assists with unit testing. it provides an ui similar to that of eclipse’s junit test runner. it should be very easy for java programmers to get up to
speed on it quickly. installing mozunit is a feature of mozlab. install mozlab from the following url and relaunch firefox. http://hyperstruct.net/projects/mozunit after relaunching, set up the editor you’ll use to write tests. open the about:config screen and edit the extensions.mozlab.mozunit.editor property. parameters are as shown in table 1. if you want to use terapad2, for example, insert t...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
g 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+) ordinarily, firefox will cache xul documents after they have been read in once, to
speed subsequent displays. disabling this cache forces xul documents to be reloaded any every time they are displayed. true browser.dom.window.dump.enabled (not present in firefox 3.5+) enables use of the dump method for debugging. refer to the “javascript debugging methods” sidebar. true javascript.options.showinconsole (present in firefox 3.5+) outp...
Performance best practices in extensions - Archive of obsolete content
one of firefox's great advantages is its extreme extensibility. extensions can do almost anything. there is a down side to this: poorly written extensions can have a severe impact on the browsing experience, including on the overall performance of firefox itself. this article offers some best practices and suggestions that can not only improve the performance and
speed of your extension, but also of firefox itself. improving startup performance extensions are loaded and run whenever a new browser window opens. that means every time a window opens, your extension can have an impact on how long it takes the user to see the content they're trying to view. there are several things you can do to reduce the amount of time your extension delays the appearance of the user's desired content. load on...
Add-ons - Archive of obsolete content
nce best practices in extensions one of firefox's great advantages is its extreme extensibility. extensions can do almost anything. there is a down side to this: poorly written extensions can have a severe impact on the browsing experience, including on the overall performance of firefox itself. this article offers some best practices and suggestions that can not only improve the performance and
speed of your extension, but also of firefox itself. security best practices in extensions this document is intended as a guide for developers to promote best practices in securing your extension. your goal is to keep your users safe. some items mentioned are strict guidelines, meaning that if you don't follow them then your add-on will not be approved on mozilla add-ons. other items are recommendati...
Index - Archive of obsolete content
caught between a rock and a hard place, web designers face a formidable challenge. yet they are finding an unsuspected ally in the battle: web standards. 3819 using the right markup to invoke plugins add-ons, html, plugins this article is about how to invoke a plugin with the correct use of html. it discusses the object...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
lication the flexibility to easily access and manage all message headers in mail applications (like netscape mail or eudora) is probably one of the useful features when compared with web-based mail applications. in general, when a webmail account has more than a few messages, clicking 'next page' sends a request to the server. you receive a new page with the next block of message headers. on slow
speed connections, this process can be slow and frustrating. with inner browsing, a simple request to retrieve the next set of message headers that replace the currently viewed message headers can dramatically improve user experience. implementing inner-browsing on top of html pages modern browsers have good support for the w3c dom and javascript allowing fine-grained control over page content. instead...
MMgc - Archive of obsolete content
ere are a couple options for implementing write barriers. at the finest level of granularity everytime a a white object is written to a black object we push the white object onto the work queue (thus making it grey). another solution is to put the black object on the work queue, thus if multiple writes occur to the black object we only needed one push on the the queue. this could be a significant
speedup if the black object was a large array getting populated with a bunch of new objects. on the other hand if the black is a huge array and only a couple slots had new objects written to them we are wasting time by marking the whole thing. a popular solution to this is what's called card marking. here you divide memory into "cards" and when a white object is written to a black object you mark the c...
Notes on HTML Reflow - Archive of obsolete content
s. in this case, it is likely that the individual incremental reflows will end up doing redundant work. for example, each keystroke typed into a text widget could generate a separate incremental reflow targeted at the text frame. were we to process each individually, the text widget would be flowed once for each keystroke, which would be wasteful if the latency of an individual reflow exceeds the
speed at which text is being typed. the purpose of the dirty reflow is to allow these individual reflows to be coalesced intelligently. a frame that decides it needs a dirty reflow sets the ns_frame_is_dirty state bit on itself, and then calls the reflowdirtychild method on its parent frame. in reflowdirtychild, the parent frame sets the ns_frame_has_dirty_child state bit on itself, and does any bookke...
Source Navigator - Archive of obsolete content
derstand that the label here is not so self-explanatory...): <tt>~/moz1.9/mozilla</tt> (because i saved my source at ~/moz1.9/mozilla.) remember to ensure that "include subdirectories" and "build cross-reference database" are checked. then click "ok". the snavigator then begins to scan your source directories. this takes a few minutes. now you can enjoy searching the mozilla code in a faster
speed. using source navigator (more later) opening a project open a terminal. type <tt>snavigator</tt> followed by striking enter. this shows the "source-navigator projects" dialog. choose the project file that you've just created and then click "open...". source navigator then loads the database and then display the following symbols window: searching a method by typing in the method name viewing...
Creating a hybrid CD - Archive of obsolete content
rid lets you create hybrid cds that work with all three filesystems. mkhybrid was written by james pearson and is is a component of the latest versions of cdrecord. i used version 1.8.1a03 although you'll probably want to get a newer one. here's what i did to create the cd for the second anniversary party. mkhybrid -o ~/party.iso -r -j -hfs -v mozilla.party -map ~/hfsmapping ~/party/ cdrecord -v
speed=2 dev=0,6,0 ~/party.iso its also handy to be able to mount an image file to test it. mount ~/party.iso /mnt/cdrom -t iso9660 -o loop=/dev/loop3,blocksize=1024 umount /mnt/cdrom here is the hfs mapping that i used. the creator "moss" is for netscape 4.x and "mozz" is used for mozilla. it is used as the creator type for readme and other text files because it can handle unix and windows linebreak...
Style System Overview - Archive of obsolete content
th the non-typesafe forms sometimes hide this error), since the struct may be shared with other elements. the rule tree as we call nsrulewalker::forward on all the rules that are matched, we build or walk along the rule tree. the rule tree is a lexicographic tree of matched rules, where each node in the tree is represented by a nsrulenode. some style data is cached on nsrulenode objects to
speed up computation and reduce memory use. the rule tree rules: /* rule 1 */ doc { display: block; text-indent: 1em; } /* rule 2 */ title { display: block; font-size: 3em; } /* rule 3 */ para { display: block; } /* rule 4 */ [class="emph"] { font-style: italic; } rule tree: a: null ↙ ↓ ↓ ↘ b: 1 c: 2 d: 3 ...
Running Tamarin acceptance tests - Archive of obsolete content
-28 10:38:07.221457 end date : 2010-09-28 10:39:26.751797 test time : 0:01:19.530340 passes : 59291 failures : 0 expected failures : 75 tests skipped : 76 the -f flag tells runtests.py to force recompilation of all the scripts. for help on runtests.py options, see below or use python runtests.py -h. notes on using acceptance runtests.py threading in order to
speed up the execution time of the acceptance testsuite, the runtests script automatically detects the number of cores on the machine and sets an equivalent number of threads. this can be overrided with 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 threa...
Running Tamarin performance tests - Archive of obsolete content
exsdk/flex+sdk. (optional) you may compare the performance of the avmshell to another avmshell. for example you may download or build the latest checked in avmshell to compare against a local change. to compare a build against another build set the avm2 environment variable to the other avmshell or use the "-s --avm2" options. results from the two shells will be shown side to side and the percent
speedup will be shown. $ cd tamarin-redux/test/performance $ python runtests.py executing tests at 2008-07-22 13:56:54.820920 avm: c:/dev/tamarin-tracing/bld/shell/avmshell.exe test avm sunspider/access-binary-trees.as 82.0 sunspider/access-fannkuch.as 152.0 sunspider/access-nbody.as ...
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
that the architecture depends on the operating environment (i.e., windows) knows the address of the stack, and that there is only one such address. consequently, implementing threads, with their implication of a unique stack for each thread, requires that the nspr copy the stacks during thread context switches. the actual copying of the stack is not such a hardship as one would imagine. with the
speed of today's processors (even those running win-16), the copying of 10 - 50 kilobytes of data between two locations in memory is barely measurable 1. what is a hardship is that addresses of dynamic variables, those allocated on the call stack, in a function's local frame, are not valid across thread boundaries. the simplest demonstration of the problem is as follows: typedef struct shareddata { ...
Example Sticky Notes - Archive of obsolete content
cy="12px" r="12" fill="#00ff00" transform="translate(7,12)"/> <svg:circle cx="25px" cy="12px" r="12" fill="#0000ff" transform="translate(-7,12)"/> </svg:g> </svg:svg> <children/> </content> <implementation> <!-- here and futher cdata wrappers around javascript code are not mandatory but recommended. this way you protect yourselve from < and > signs breaking your xml layout. it also
speeds up the parsing as the engine doesn't go through cdata sections but simply skip on them. --> <constructor><![cdata[ /** * the code below will be called one time only after * the binding is successfully prepared and bound. * "this" in this context refers to the bound element. */ // your code goes here ]]></constructor> <destructor><![cdata[ /** * the code below will be called one ti...
Building Menus With Templates - Archive of obsolete content
. if you press this button before opening the menu, there will be one child (the template itself). however, after the menu has been opened, there will be two children, one is the template and the other is the generated menupopup. note that the generated content does not get removed again when the menu is closed again; this extra feature of menus is only intended to be a performance enhancement to
speed up the time it takes to display a window by avoiding extra generation that can be put off until later. you might be wondering why we couldn't just put the datasources attribute on the menupopup instead and not have a menupopup inside the action body. you can actually do this, however, you no longer receive the performance benefit as the entire content will be generated right away. the special fea...
Complete - Archive of obsolete content
d experiences ranging from error messages that they cannot understand to crashes and data loss. for more information about version checks, see: extension versioning, update and compatibility the installed jar to use disk space efficiently on the end user's computer, the three directories (content, locale, skin) are packed in a jar file. it is normally uncompressed, trading off some disk space for
speed. this jar file will be installed as-is on the end user's computer, and unpacked at run-time by the application. to tell the application that the files it needs are in a jar, there are changes to chrome.manifest (for firefox etc.) and to install.js (for seamonkey). for example, chrome.manifest originally had: content custombutton chrome/ now it has: content allcustom jar:chrome/allcustom.jar!/cont...
Advanced Rules - Archive of obsolete content
://www.xulplanet.com/rdf/weather#prediction" object="cloudy"/> </conditions> this example is similar but we specify that we want to match on 'cloudy'. the result is that the conditions will only match for cities where the prediction is 'cloudy'. we can add more triples to require more matches. for example, in the example above, we might want to check for the temperature and the wind
speed. to do this just add another triple which checks for the additional resource. the condition will match if all of the triples provide values. the example below will check for an extra triple for the name of the city. it will be assigned to the 'name' variable. the condition will only match if the city has both a name and a prediction. <conditions> <content uri="?list"/> <member container="?lis...
More Event Handlers - Archive of obsolete content
y properties and creates a string from them. this string is then assigned to the value property of the label. note that the event argument must be passed to the updatemousecoordinates function. if you move the mouse quickly across the border of the box, you might notice that the coordinates don't generally stop right at 400. this is because the mousemove events occur at intervals depending on the
speed at which the mouse moves and the mouse is usually moved some distance past the border by the time the next event fires. obviously, it would be much too inefficient to send a mousemove event for every pixel the mouse is moved. element relative coordinates you will often want to get the coordinates of an event relative to the element where the event occurred rather than the entire window. you can d...
XUL accessibility tool - Archive of obsolete content
after installation, look for an entry in the tools menu of the host application, or hit ctrl+alt+shift+f12. once the tool window has loaded, select either a local file, web url, or currently open window from the file menu to generate a xul report for that document. be aware that the report might take a little while to be ready depending on the complexity of the application being analyzed and the
speed of your machine. future work the following things have been suggested or are planned for a future version of the tool: new tests: (aaronlev) warning: hardcoded color and pixel sizings (aaronlev) error: duplicate accesskey in a dialog (already have this for menus) (aaronlev) error: form control without accesskey (aaronlev) warning: accesskey as lowercase letter with descender (underlined g...
XML - Archive of obsolete content
xul is made out of xml you don't need to know all about xml in order to use xul, but you may want to read through this article to get a sense of xul's pedigree as a specialized markup language. xul is based upon xml, so it inherits a lot of the rules and syntax described above from this "meta-language," as you will see. any familiarity you already have with xml will help you quickly get up to
speed developing with xul. xml is a language for creating other languages. it is a language for describing the structure of data. it does not describe the way in which this data is to be presented, like its semantically-challenged cousin html does, and it doesn't have much to say about the data itself. when someone says they are using xml, what they probably mean is that they have used xml to define ...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
ation, the following seems to be the best way to speak soap in xulrunner. several alternatives were considered: soapclient 2.4 - this library contains a few javascript mistakes but nevertheless seems (fairly) widely used, mature and tested. it requires servers to support wsdl which took it out of the running. xulrunner 1.8.* - using an old xulrunner is certainly an option but brings up a host of
speed, stability and memory issues. manual implementation - the author doesn't know enough about soap to implement a robust client in an afternoon. the best solution proved to be jqsoapclient. this library doesn't require a wsdl. though jquery is listed as a dependency, it can be worked around easily. (there is a diff below.) you'll need: sasoapclient.js saxmlutils.js making a soap call var url = 'h...
Mozilla release FAQ - Archive of obsolete content
ms was mozilla released? mozilla is released under the npl/mpl (netscape/mozilla public licenses) which are in some ways similar to the gnu gpl, and in some ways similar to a bsd-style license. take a look at mozilla.org's npl area for details. what are all of the codenames given to various netscape/mozilla projects? gecko (formerly raptor) is the new html rendering engine in mozilla. it features
speed improvements, a more modular nature, and significantly less platform-dependant code. it is more suitable for being embedded in other applications than the previous rendering engine. gemini was a previous rendering engine project, renamed nglayout aurora is the navigation center in mozilla and navigator5 seamonkey refers to versions of mozilla based on xpfe and nglayout normandy refers to...
2006-10-06 - Archive of obsolete content
htning to outlook. extension compatibility for firefox 2 chris hofmann reminds about the push to have extensions work with ff2. also invites people to file bugs about extensions that don't work. also invites people to help extension developers test for compatibility (link to a bunch of extension compatability bugs) discussions reining in the release process a discussion of what can be done to
speed up the release process. the new roadmap - will there be something sometime? simon paquet asked for an update of the road map and either update or removal of the planning blog. adam gutherie replied that cbeard's blog post from nov 2005 is as close to a roadmap as exists right now and agrees that needs to be done about this. re: plan to hold trunk closed for lack of talkback dbaron mentioned t...
2006-10-13 - Archive of obsolete content
t firefox 2 rc3 code freeze the firefox 2 rc3 code was frozen on oct. 10; the target release date for rc3 is october 17 new tinderbox and bonsai servers the build team would like help testing out the new tinderbox and bonsai servers. sunbird and lighting 0.3 sunbird and lighting 0.3 were released on october 11 discussions release process discussion discussion from last week regarding
speeding up and automation of the release process continued. firefox feature brainstorming you can help suggest features for firefox 3 here meetings project meeting a project meeting was held on oct. 9. (meeting notes) bon echo status meeting a bon echo status meeting was held on oct. 10 (meeting notes) gecko 1.9/gran paradiso status meeting a gecko 1.9/gran paradiso status meeting was hel...
Introduction to SSL - Archive of obsolete content
identify the strongest enabled cipher suites they have in common and use those for the ssl session. note: firefox 2 ships with ssl 2.0 support disabled by default, in favor of ssl 3.0. in addition, ssl 2.0 support is entirely removed in firefox 8. decisions about which cipher suites a particular organization decides to enable depend on trade-offs among the sensitivity of the data involved, the
speed of the cipher, and the applicability of export rules. some organizations may want to disable the weaker ciphers to prevent ssl connections with weaker encryption. however, due to u.s. government restrictions on products that support anything stronger than 40-bit encryption, disabling support for all 40-bit ciphers effectively restricts access to network browsers that are available only in the un...
Using the W3C DOM - Archive of obsolete content
neither is supported, it assumes support for basic dom 1 methods and uses those. it should be clear that translating scripts to modify document content is not a trivial undertaking. the benefit of such a conversion is that the script will work in w3c dom-compliant browsers. ...
MSX Emulator (jsMSX) - Archive of obsolete content
ind some interesting project to develop while exploring the possibilities of the <canvas> tag and javascript language in the most recent web browsers like firefox 2. as you may have realized, many challenges on performance are faced when developing in javascript. they present an interesting testbed for pushing the current javascript implementations to their limits and for comparing their relative
speed. jsmsx can also be used to tightly integrate existing msx programs in web page logic. how to help lots of work to optimize the performance and add msx 2.0, 2.0+ and turbor features are still necessary. version 1.0 will release an optimized javascript engine for msx 1.0. version 2.0, 3.0 and 4.0 will be compatible with msx 2.0, 2.0+ and turbor respectively. an uncompress javascript function able t...
Server-Side JavaScript - Archive of obsolete content
er in java) and spidermonkey (javascript interpreter in c) and javascript itself, we have very solid foundations for javascript to be extraordinarily useful and applicable on the server-side again -- with performance in the same range as popular server-side environments like php and ruby on rails. now, with tracemonkey available, javascript (both client side and server-side) can see 20x to 40x
speed improvements according to brendan eich, mozilla cto and creator of javascript. server-side javascript is another way in which, as this article quotes eich, "mozilla wants to 'get people thinking about javascript as a more general-purpose language' and show them that 'it really is a platform for writing full applications.'" many vendors today are embedding mozilla rhino or mozilla spidermonkey in...
Anatomy of a video game - Game development
lated (guessed) because each draw has its own update. simulation systems can basically assume that each full update is ~16ms apart. giving the user control over quality settings would be a nightmare. different monitors input at different rates: 30 fps, 75 fps, 100 fps, 120 fps, 144 fps, etc. systems that are unable to keep up with 60 fps lose visual quality to keep the game running at optimal
speed (eventually it outright fails, if quality becomes too low.) other ways to handle variable refresh rate needs other methods of tackling the problem exist. one common technique is to update the simulation at a constant frequency and then draw as much (or as little) of the actual frames as possible. the update method can continue looping without care about what the user sees. the draw method can...
Game distribution - Game development
don't have to tell people to search for your game in an app store with html5 games. you can just send them a direct url to access the game, which they can then click to play the game right away without the need to use third party plugins or download and install a large package. bear in mind that downloading the game might still take a bit of time depending on the size of the game and your network
speed. in any case, it's a lot easier to promote the game if you can drive traffic directly where you want it and don't have to jump through lots of hoops to play. desktop vs mobile the vast majority of the traffic we are interested in — people playing html5 games — comes from mobile devices so that's something you will have to focus on if you truly want to succeed. mobile devices are where html5...
Building up a basic demo with Babylon.js - Game development
given direction. add the following line below your camera definition: var light = new babylon.pointlight("light", new babylon.vector3(10, 10, 0), scene); the parameters are very similar to the previously defined camera: the name of the light, a position in 3d space and the scene to which the light is added. geometry now the scene is properly rendering we can start adding 3d shapes to it. to
speed up development babylon.js provides a bunch of predefined primitives that you can use to create shapes instantly in a single line of code. there are cubes, spheres, cylinders and more complicated shapes available. let's start by defining the geometry for a box shape — add the following new code below your previous additions: var box = babylon.mesh.createbox("box", 2, scene); a mesh is a way t...
Building up a basic demo with the PlayCanvas engine - Game development
later on. note: the distance values (e.g. for the camera z position) are unitless, and can basically be anything you deem suitable for your scene — milimeters, meters, feet, or miles — it's up to you. try saving the file and loading it in your browser. you should now see a gray window. congratulations! geometry now the scene is properly rendering we can start adding 3d shapes to it. to
speed up development playcanvas provides a bunch of predefined primitives that you can use to create shapes instantly in a single line of code. there are cubes, spheres, cylinders and more complicated shapes available. drawing everything for given shape is taken care of by the engine, so we can focus on the high level coding. let's start by defining the geometry for a cube shape — add the following n...
Building up a basic demo with Three.js - Game development
scene and the camera. right after the function declaration, we're invoking it for the first time to start the loop, after which it will be used indefinitely. again, add this new code below your previous additions. try saving the file and opening it in your browser. you should now see a gray window. congratulations! geometry now our scene is properly rendering, we can start adding 3d shapes. to
speed up development, three.js provides a bunch of predefined primitives, which you can use to create shapes instantly in a single line of code. there's cubes, spheres, cylinders, and more complicated shapes available. detail like drawing required vertices and faces, for a given shape, is handled by the three framework, so we can focus on higher level coding. let's start, by defining the geometry for a...
GLSL Shaders - Game development
rs. vertex shaders transform shape positions into 3d drawing coordinates. fragment shaders compute the renderings of a shape's colors and other attributes. glsl is not as intuitive as javascript. glsl is strongly typed and there is a lot of math involving vectors and matrices. it can get very complicated — very quickly. in this article we will make a simple code example that renders a cube. to
speed up the background code we will be using the three.js api. as you may remember from the basic theory article, a vertex is a point in a 3d coordinate system. vertices may, and usually do, have additional properties. the 3d coordinate system defines space and the vertices help define shapes in that space. shader types a shader is essentially a function required to draw something on the screen. sh...
3D games on the Web - Game development
frame article showing you how easy it is to build 3d environments for virtual reality using the a-frame framework. the rise of libraries and frameworks coding raw webgl is fairly complex, but you'll want to get to grips with it in the long run, as your projects get more advanced (see our webgl documentation to get started.) for real-world projects you'll probably also make use of a framework to
speed up development and help you manage the project you're working on. using a framework for 3d games also helps optimize the performance as a lot is taken care of by the tools you use, so you can focus on building the game itself. the most popular javascript 3d library is three.js, a multi-purpose tool that makes common 3d techniques simpler to implement. there are other popular game development lib...
Audio for Web games - Game development
watch out for bit rates. encoding your audio at lower bit rates means smaller file sizes but lower seeking accuracy. background music music in games can have a powerful emotional effect. you can mix and match various music samples and assuming you can control the volume of your audio element you could cross-fade different musical pieces. using the playbackrate() method you can even adjust the
speed of your music without affecting the pitch, to sync it up better with the action. all this is possible using the standard <audio> element and associated htmlmediaelement api, but it becomes much easier and more flexible with the more advanced web audio api. let's look at this next. element and associated htmlmediaelement api, but it becomes much easier and more flexible with the more advanced w...
Tools for game development - Game development
ecode into high-performance javascript. this is a great tool for porting applications to the web! there is a useful emscripten tutorial available on the wiki. note that we are aiming to cover emscripten in its own section of mdn. gecko profiler the gecko profiler extension lets you profile your code to help figure out where your performance issues are so that you can make your game run at top
speed. shumway shumway is a renderer for adobe flash built entirely in javascript, webgl, etc., bridging the gap between flash and web standards. this article shows how to make use of shumway, and how to contribute fixes and bugs to the project. toolchain for developing and debugging games how does this differ from normal web app debugging? what specialist tools are available? a lot of this is goin...
Bounce off the walls - Game development
o move in the opposite direction and stay within the visible boundaries. remembering that the coordinate system starts from the top left, we can come up with something like this: if(y + dy < 0) { dy = -dy; } if the y value of the ball position is lower than zero, change the direction of the movement on the y axis by setting it equal to itself, reversed. if the ball was moving upwards with a
speed of 2 pixels per frame, now it will be moving "up" with a
speed of -2 pixels, which actually equals to moving down at a
speed of 2 pixels per frame. the code above would deal with the ball bouncing off the top edge, so now let's think about the bottom edge: if(y + dy > canvas.height) { dy = -dy; } if the ball's y position is greater than the height of the canvas (remember that we count the ...
Move the ball - Game development
next steps we've drawn our ball and gotten it moving, but it keeps disappearing off the edge of the canvas. in the third chapter we'll explore how to make it bounce off the walls. « previousnext » ...
2D breakout game using pure JavaScript - Game development
shing up starting with pure javascript is the best way to get a solid knowledge of web game development. after that, you can pick any framework you like and use it for your projects. frameworks are just tools built with the javascript language; so even if you plan on working with them, it's good to learn about the language itself first to know what exactly is going on under the hood. frameworks
speed up development time and help take care of boring parts of the game, but if something is not working as expected, you can always try to debug that or just write your own solutions in pure javascript. note: if you are interested in learning about 2d web game development using a game library, consult this series' counterpart, 2d breakout game using phaser. note: this series of articles can be u...
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 solid framework, with a good support and community available, and a good set of plugins. frameworks
speed up development time and help take care of the boring parts, allowing you to concentrate on the fun stuff. however, frameworks are not always perfect, so if something unexpected happens or you want to write some functionality that the framework does not provide, you will need some pure javascript knowledge. note: this series of articles can be used as material for hands-on game development works...
Gecko FAQ - Gecko Redirect 1
resentation control to web developers, using open and recommended internet standards instead of proprietary apis. you are encouraged to join this team by getting involved. how does mozilla use gecko? gecko lies at the heart of mozilla and firefox browsers, as well as others, powering all of the individual components. gecko technologies will also power the display of the mozilla.com portal site,
speedily delivering more exciting content and services. gecko's architecture will serve mozilla well into the future, enabling faster time to market, more innovation, less costly development, easier distribution and updating, and better cross platform support. how can other companies and organizations use gecko? because gecko is small, lightweight, and open source, other companies and organizations c...
Delta - MDN Web Docs Glossary: Definitions of Web-related terms
the term delta refers to the difference between two values or states. the name originates from the greek letter Δ (delta), which is equivalent to the letter d in the roman alphabet. delta simply refers to the use of the letter Δ as a shorthand for difference. the term delta is commonly used when communicating changes in
speed, position, or acceleration of a physical or virtual object. it's also used when describing changes in the volume or frequency of sound waves. for example, when describing how far an object on the screen moves left-to-right, one might use the term delta x or Δx. likewise, given the new value of x and its old value, you might compute the delta like this: let deltax = newx - oldx; more commonly, you receive the delta and use it to update a saved previous condi...
frame rate (FPS) - MDN Web Docs Glossary: Definitions of Web-related terms
the frames per second, or fps, is how many frames can be repainted in one second. the goal frame rate for in web site computer graphics is 60fps. movies generally have a frame rate of 24 fps. they are able to have fewer frames per second because the illusion of life is created with motion blurs. ...
First input delay - MDN Web Docs Glossary: Definitions of Web-related terms
on on a web page and the browser’s response to that interaction. scrolling and zooming are not included in this metric. the time between when content is painted to the page and when all the functionality becomes responsive to human interaction often varies based on the the size and complexity of the javascript needing to be downloaded, parsed, and executed on the main thread, and on the device
speed or lack thereof (think low end mobile devices). the longer the delay, the worse the user experience. reducing site initialization time and eliminating long tasks can help eliminate first input delays. see also requestidlecallback lazy loading ...
Gzip compression - MDN Web Docs Glossary: Definitions of Web-related terms
mpression. it is based on the deflate algorithm that allows files to be made smaller in size which allows for faster network transfers. gzip is commonly supported by web servers and modern browsers, meaning that servers can automatically compress files with gzip before sending them, and browsers can uncompress files upon receiving them. learn more how to enable compression and gzip for page
speed. gzip on wikipedia ...
Perceived performance - MDN Web Docs Glossary: Definitions of Web-related terms
, be that a button press or a page load. perceived performance is not how fast your site is; it's how fast your users think it is. perceived performance is not measured by when your site is done loading but when it has loaded enough for users to believe it has loaded and is interactive. in terms of conversion rates, perceived performance is more important than the actual load and response times.
speed index is a common metric for measuring perceived performance, though it's not perfect. other features, such as good ux design, including animations, and lazy loading, can make your site appear more responsive, even if the download and response times remain the same. actual performance is a measurement from when a request is made, through the downloading, parsing and execution of all resources, a...
Prefetch - MDN Web Docs Glossary: Definitions of Web-related terms
the content is downloaded and cached for anticipated future use without the user making an explicit request for it. dns prefetching domain lookups can be slow, especially with network latency on mobile phones. they are most relevant when there are a plethora of links to external websites that may be clicked on, like search engine results, dns prefetching resolves domain names in advance thereby
speeding up load times by reducing the time associated with domain lookup at request time. <link rel="dns-prefetch" href="https://example.com/"> link prefetching link prefetching is a performance optimization technique that works by assuming which links the user is likely to click, then downloading the content of those links. if the user decides to click on one of the links, then the page will be re...
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
it prevents the appearance of network congestion whose capabilities are initially unknown, and slowly increases the volume of information diffused until the network's maximum capacity is found. to implement tcp slow start, the congestion window (cwnd) sets an upper limit on the amount of data a source can transmit over the network before receiving an acknowledgment (ack). ...
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
udp uses a simple connectionless communication model with a minimum of protocol mechanism. udp provides checksums for data integrity, and port numbers for addressing different functions at the source and destination of the datagram. it has no handshaking dialogues, and thus exposes the user's program to any unreliability of the underlying network; there is no guarantee of delivery, ordering, or duplicate protection. ...
VoIP - MDN Web Docs Glossary: Definitions of Web-related terms
tocol) networks. common voip packages include skype, msn messenger, yahoo and many more. everything transferrred through voip is digital. it is also known as ip telephony, or broadband telephony. the main reason for using voip technology is because of cost. voip allows you to make a call directly from a computer, a special voip phone, or a traditional phone connected to a special adapter. a high
speed internet connection is required for voip. usually, telephone calls over the internet do not incur further charges beyond what the user is paying for internet access, much in the same way that the user doesn't pay for sending individual emails over the internet. learn more general knowledge voip on wikipedia ...
Brotli - MDN Web Docs Glossary: Definitions of Web-related terms
brotli is a general-purpose lossless compression algorithm. it compresses data using a combination of a modern variant of the lz77 algorithm, huffman coding, and second-order context modeling, providing a compression ratio comparable to the best currently available general-purpose compression methods. brotli provides better compression ratios than gzip and deflate
speeds are comparable, but brotli compressing is a slower process than gzip compression, so gzip may be a better option for the compression of non-cachable content. brotli is compatible with most modern browsers, but you may want to consider a fallback. learn more brotli.org brotli github repository brotli on wikipedia brotli on caniuse ...
MDN Web Docs Glossary: Definitions of Web-related terms
simd simple header simple response header sisd site site map sld sloppy mode slug smoke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification speculative parsing
speed index sql sql injection sri stacking context state machine statement static method static typing strict mode string stun style origin stylesheet svg svn symbol symmetric-key cryptography synchronous syntax syntax error ...
What is accessibility? - Learn web development
oducts. building accessible sites benefit everyone: semantic html, which improves accessibility, also improves seo, making your site more findable. caring about accessibility demonstrates good ethics and morals, which improves your public image. other good practices that improve accessibility also make your site more usable by other groups, such as mobile phone users or those on low network
speed. in fact, everyone can benefit from many such improvements. did we mention it is also the law in some places? what kinds of disability are we looking at? people with disabilities are just as diverse as people without disabilities, and so are their disabilities. the key lesson here is to think beyond your own computer and how you use the web, and start learning about how others use it — you ...
Installing basic software - Learn web development
service. an ftp program, used on older web hosting accounts to manage files on servers (git is increasingly replacing ftp for this purpose). there are loads of (s)ftp programs available including cyberduck, fetch and filezilla. an automation system, like webpack, grunt, or gulp to automatically perform repetitive tasks, such as minifying code and running tests. libraries, frameworks, etc., to
speed up writing common functionality. a library tends to be an existing javascript or css file that provides ready-rolled functionality for you to make use of in your code. a framework tend to take this idea further, offering a complete system with some custom syntaxes for you to write a web app on top of. more tools besides! what tools do i actually need, right now? that looks like a scary list, ...
Tips for authoring fast-loading HTML pages - Learn web development
before adding them to your page, using compression features built into image-manipulation tools such as photoshop, or using a specialized tool such as compress jpeg or tiny png,. specify sizes for images and tables if the browser can immediately determine the height and/or width of your images and tables, it will be able to display a web page without having to reflow the content. this not only
speeds the display of the page but prevents annoying changes in a page's layout when the page completes loading. for this reason, height and width should be specified for images, whenever possible. tables should use the css selector: property combination: table-layout: fixed; and should specify widths of columns using the <col> and the <colgroup> elements. use lazy loading for images by default...
Use JavaScript within a webpage - Learn web development
ng. flashing is annoying and can cause seizures. additionally, if an animation lasts more than a couple seconds, give the user a way to cancel it. let users initiate interactions. that means, don't update content, redirect, or refresh automatically. don't use carousels or display popups without warning. have a plan b for users without javascript. people may have javascript turned off to improve
speed and security, and users often face network issues that prevent loading scripts. moreover, third-party scripts (ads, tracking scripts, browser extensions) might break your scripts. at a minimum, leave a short message with <noscript> like this: <noscript>to use this site, please enable javascript.</noscript> ideally, replicate the javascript functionality with html and server-side scriptin...
Index - Learn web development
s module focuses on testing web projects across different browsers. we look at identifying your target audience (e.g. what users, browsers, and devices do you most need to worry about?), how to go about doing testing, the main issues that you'll face with different types of code and how to mitigate them, what tools are most useful in helping you test and fix problems, and how to use automation to
speed up testing. 260 handling common html and css problems article, beginner, css, codingscripting, html, learn, selectors, testing, cross browser, linting now you should be familiar with the main types of cross browser html and css problems that you'll meet in web development, and how to go about fixing them. 261 handling common javascript problems article, beginne...
Drawing graphics - Learn web development
requestanimationframe() or if you call window.cancelanimationframe() after calling requestanimationframe() but before the frame is called. note: it's good practice to call cancelanimationframe() from your main code when you're done using the animation, to ensure that no updates are still waiting to be run. the browser works out complex details such as making the animation run at a consistent
speed, and not wasting resources animating things that can't be seen. to see how it works, let's quickly look again at our bouncing balls example (see it live, and also see the source code). the code for the loop that keeps everything moving looks like this: function loop() { ctx.fillstyle = 'rgba(0, 0, 0, 0.25)'; ctx.fillrect(0, 0, width, height); for(let i = 0; i < balls.length; i++) { b...
Fetching data from the server - Learn web development
ates are a lot quicker and you don't have to wait for the page to refresh, meaning that the site feels faster and more responsive. less data is downloaded on each update, meaning less wasted bandwidth. this may not be such a big issue on a desktop on a broadband connection, but it's a major issue on mobile devices and in developing countries that don't have ubiquitous fast internet service. to
speed things up even further, some sites also store assets and data on the user's computer when they are first requested, meaning that on subsequent visits they use the local versions instead of downloading fresh copies when the page is first loaded. the content is only reloaded from the server when it has been updated. a basic ajax request let's look at how such a request is handled, using both xm...
Introduction to web APIs - Learn web development
plement functionality more easily. third-party apis — constructs built into third-party platforms (e.g. twitter, facebook) that allow you to use some of those platform's functionality in your own web pages (for example, display your latest tweets on your web page). javascript libraries — usually one or more javascript files containing custom functions that you can attach to your web page to
speed up or enable writing common functionality. examples include jquery, mootools and react. javascript frameworks — the next step up from libraries, javascript frameworks (e.g. angular and ember) tend to be packages of html, css, javascript, and other technologies that you install and then use to write an entire web application from scratch. the key difference between a library and a framework is ...
Web performance resources - Learn web development
lay swap the browser will not block rendering and will use the backup system fonts that are defined. optimiize font weight to match the web font as closely as possible. icon web fonts if possible avoid icon web fonts and use compressed svgs. to further optimize inline your svg data within html markup to avoid http requests. tools learn to use the firefox dev tools to profile your site. page
speed insights can analyze your page and give some general hints to improve performance. lighthouse can give you a detailed breakdown of many aspects of your site including performance, seo and accessibility. test your page's
speed using webpagetest.org, where you can use different real device types and locations. try the chrome user experience report which quantifies real user metrics. define a p...
What is web performance? - Learn web development
t by showing a loading spinner, or a series of useful hints and tips (or jokes, or whatever else you think might be appropriate). such an approach is much better than just showing nothing, which will make it feel like it is taking a lot longer and possibly lead to your users thinking it is broken and giving up. performance measurements: web performance involves measuring the actual and perceived
speeds of an application, optimizing where possible, and then monitoring the performance, to ensure that what you've optimized stays optimized. this involves a number of metrics (measurable indicators that can indicate success or failure) and tools to meaure those metrics, which we will discuss throughout this module. to summarize, many features impact performance including latency, application size,...
Multimedia: video - Learn web development
tadata" may download up to 3% of the video on page load. this is a useful option for some small or moderately sized files. changing the setting to auto tells the browser to automatically download the entire video. do this only when playback is very likely. otherwise, it wastes a lot of bandwidth. consider streaming video streaming allows the proper video size and bandwidth (based on network
speed) to be delivered to the end user. similar to responsive images, the correct size video is delivered to the browser, ensuring fast video startup, low buffering, and optimized playback. conclusion optimizing video has the potential to significantly improve website performance. video files are relatively large compared to other website files, and always worthy of attention. this article explains ...
Server-side web frameworks - Learn web development
rages good development practices: for example, a framework that encourages a model-view-controller architecture to separate code into logical functions will result in more maintainable code than one that has no expectations on developers. similarly, framework design can have a large impact on how easy it is to test and re-use code. performance of the framework/programming language: usually "
speed" is not the biggest factor in selection because even relatively slow runtimes like python are more than "good enough" for mid-sized sites running on moderate hardware. the perceived
speed benefits of another language, e.g. c++ or javascript, may well be offset by the costs of learning and maintenance. caching support: as your website becomes more successful then you may find that it can no longe...
Getting started with Ember - Learn web development
berjs works well for building apps that desire either or both of the following traits: single page applications, including native-like web apps, and progressive web apps (pwas) ember works best when it is the entire front end of your application. increasing cohesion among many team's technology stacks community-backed "best practices" allow for faster long-term development
speed. ember has clear conventions that are useful for enforcing consistency and helping team members get up to
speed quickly. ember with add-ons emberjs has a plugin architecture, which means that add-ons can be installed and provide additional functionality without much, if any, configuration. examples include: prember: static website rendering for blogs or marketing content. fastboot...
Implementing feature detection - Learn web development
rview: cross browser testing next feature detection involves working out whether a browser supports a certain block of code, and running different code depending on whether it does (or doesn't), so that the browser can always provide a working experience rather than crashing/erroring in some browsers. this article details how to write your own simple feature detection, how to use a library to
speed up implementation, and native features for feature detection such as @supports. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross-browser testing. objective: to understand what the concept of feature detection is, and be able to implement suitable solutions in css and javascript. the concept ...
Client-side tooling overview - Learn web development
ript languages. objective: to understand what types of client-side tooling there are, and how to find tools and get help with them. overview of modern tooling writing software for the web has become more sophisticated through the ages. although it is still entirely reasonable to write html, css, and javascript "by hand" there is now a wealth of tools that developers can use to
speed up the process of building a web site, or app. there are some extremely well-established tools that have become common "household names" amongst the development community, and new tools are being written and released every day to solve specific problems. you might even find yourself writing a piece of software to aid your own development process, to solve a specific problem that existing tools d...
Mozilla accessibility architecture
we also override ::getaccnextsibling(), ::getaccprevioussibling() for the dom-less children; otherwise they do not know how to find each other. it is also useful to override these the child getters to return nothing, as we do in nsleafaccessible, nstextaccessible and other accessible implementations where we want to be sure to avoid children. returning nothing for leaf and text objects also helps
speed up tree construction and traversal. 4. accessible events accessible events are dom events translated into the event mechanism of the given platform, using the enumerated event numbers listed in nsiaccessibleeventreceiver.idl. the accessibility client can find out what kind of event occurred as well as what accessible node the event occured on. table of gecko event to accessible event translation...
Embedding API for Accessibility
setboolpref("browser.accept.video", acceptvideo); no audio setboolpref("browser.accept.audio", acceptaudio); no timed events setboolpref("browser.accept.timed_events", accepttimedevents); no timer
speed setintpref("timer.relative_
speed", percent); /* 100 corresponds to normal
speed, 200 to double
speed */ no allow cycling in lists and links setboolpref("keyboardnav.allow_cycling", allowcycling); no mouse pointer moves with keyboard focus ...
Simple SeaMonkey build
ozilla development are: recommended: 8gb of ram (having only 4gb ram and 4gb swap may give memory errors during compile) 35 gb free disk space. this will accomodate visual studio 2013 community edition, the required sdks, the mozillabuild package, the mercurial source repository and enough free disk space to compile. a fast ssd is recommended; the firefox build process is i/o-intensive. high
speed internet installing build tools if your system is not listed below, see the build prerequisites page. debian linux: # this one-liner should install all necessary build deps sudo aptitude install zip mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev libidl-dev mesa-common-dev autoconf2.13 yasm libgtk2.0-dev libdbus-1-dev libdbus-glib-1-dev python-...
SVG Guidelines
readable. nested transforms some editors use <g> tags to do nested transforms, which is usually not needed. you can avoid this by doing basic algebra, for example: <g transform="translate(-62, -310)"><shape transform="translate(60, 308)"/></g> can be cut down to: <shape transform="translate(-2,-2)"/> because: -62+60 = -310+308 = -2 performance tips these rules are optional, but they help
speeding up the svg. avoid using a <use> tag when that <use> tag is being referenced only once in the whole file. instead of using css/svg transforms, apply directly the transform on the path/shape definition. tools tools can help to clean svg files. note, however that some of the rules stated above can be hard to detect with automated tools since they require too much context-awareness. to thi...
How Mozilla determines MIME Types
firstly, the operating system is asked for a mime type. (on unix, this means checking mime.types.) if that fails, a user-supplied helper app is searched for by extension, and the specified mime type will be used. (i.e. the list in edit/p...
How to get a stacktrace with WinDbg
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.) .sympath 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 is complete. once the download is complete, you need to configure windbg to examine child processes, ignore a specific event caused by flash player, and record a log of loaded modules. you will also want to open a log file to save data ...
OSFile.jsm
by web applications. os.file is designed for efficient, unrestricted, manipulation of files by firefox itself and by add-ons. why is off main thread file i/o important? one thing that all developers need to remember is that the duration of a file i/o operation is unbounded. depending on the current load of the kernel, the current disk activity, the current load of the bus, the current rotation
speed of the disk, the amount of battery power, etc. operations can take an arbitrary amount of time. we are talking about several seconds to execute operations that look trivial, such as closing a file, or checking when it was last modified. if the operation is called on the main thread, this means that the whole user experience is stuck for several seconds, which is quite bad. why is i/o efficiency...
Translation phase
rates with your repositories. visit the mozilla translator (mt) download page to get your own mt client. version 5.26 is the latest version. virtaal an offline, stand-alone version of pootle that is also built on the translate toolkit api. these are the mozilla application projects that are localized using the l10n tools above: firefox the award-winning firefox® web browser has security,
speed and new features that will change the way you use the web. see the list of the most critical strings for localizing in firefox, as well as a guide to understanding how they're organized. thunderbird enjoy safe, fast and easy email, mozilla-style. the thunderbird® email client includes intelligent spam filters, powerful search and customizable views. seamonkey seamonkey® is the all-in-one ap...
Localization sign-off reviews
ed to verify the technical accuracy of your new changes. text in green font represent additions you've made in this new revision. text in red font represents content you've removed since the last released revision. unseen here, orange font represents content that was replaced in your new release revision. using these colors helps us to identify potential bugs and approve your latest revision with
speed while maintaining critical accuracy. all approved! once your work is entirely approved, be prepared to celebrate! you've accomplished a massive undertaking and you deserve to be rewarded! go grab a drink with friends and enjoy your latest success! ...
Power profiling overview
determined in a non-instantaneous fashion, i.e. by dividing an energy amount by a non-infinitesimal time period. strictly speaking, such a computation gives the average power but this is often referred to as just the power when context makes it clear. in the context of computing, a fully-charged mobile device battery (as found in a laptop or smartphone) holds a certain amount of energy, and the
speed at which that stored energy is depleted depends on the power consumption of the mobile device. that in turn depends on the software running on the device. web browsers are popular applications and can be power-intensive, and therefore can significantly affect battery life. as a result, it is worth optimizing (i.e. reducing) the power consumption caused by firefox and firefox os. intel processor ...
Emscripten
es. practically any portable c or c++ codebase can be compiled into javascript using emscripten, ranging from high performance games that need to render graphics, play sounds, and load and process files, through to application frameworks like qt. emscripten generates fast code — its default output format is asm.js , a highly optimizable subset of javascript that can execute at close to native
speed in many cases. note: sound interesting? read more about emscripten and try some demos, then get started with using it. other articles of interest on mdn our games zone contains some useful content related to games development, which is a common area of use for emscripten. our emscripten techniques page is a place to store useful emscripten-related ideas that haven't made it onto the emscr...
Hash Tables
this chapter describes the hash table functions in the plds (portable library — data structures) library of nspr. the hash table library functions are declared in the header file plhash.h. warning: the nspr hash table library functions are not thread safe. a hash table lookup may change the internal organization of the hash table (to
speed up future lookups). hash table types and constants hash table functions hash table types and constants plhashentry plhashtable plhashnumber plhashfunction plhashcomparator plhashenumerator plhashallocops hash table functions pl_newhashtable pl_hashtabledestroy pl_hashtableadd pl_hashtableremove pl_hashtablelookup pl_hashtableenumerateentries pl_hashstring pl_comparestrings pl_comparevalues see also xpcom hashtable guide...
PLHashTable
syntax #include <plhash.h> typedef struct plhashtable plhashtable; description the opaque plhashtable structure represents a hash table. entries in the table have the type plhashentry and are organized into buckets. the number of buckets in a hash table may be changed by the library functions during the lifetime of the table to optimize
speed and space. a new hash table is created by the pl_newhashtable function, and destroyed by the pl_hashtabledestroy function. ...
An overview of NSS Internals
a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module. multiple elements of nss's own modules have been implemented with this interface, and nss makes use of this interface when talking to those modules. this strategy allows nss to work with many hardware devices (e.g., to
speed up the calculations required for cryptographic operations, or to access smartcards that securely protect a secret key) and software modules (e.g., to allow to load such modules as a plugin that provides additional algorithms or stores key or trust information) that implement the pkcs#11 interface. a core element of nss is freebl, a base library providing hash functions, big number calculations...
Index
a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module. multiple elements of nss's own modules have been implemented with this interface, and nss makes use of this interface when talking to those modules. this strategy allows nss to work with many hardware devices (e.g., to
speed up the calculations required for cryptographic operations, or to access smartcards that securely protect a secret key) and software modules (e.g., to allow to load such modules as a plugin that provides additional algorithms or stores key or trust information) that implement the pkcs#11 interface. a core element of nss is freebl, a base library providing hash functions, big number calculations...
NSS 3.48.1 release notes
3.48.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_48_1_rtm/src/ other releases are available in nss releases. new in nss 3.48.1 no new functionality is introduced in this release. bugs fixed in nss 3.48.1 bug 1606992 - cache the most recent pbkdf2 password hash, to
speed up repeated sdr operations, important with the increased kdf iteration counts. this bugzilla query returns all the bugs fixed in nss 3.48: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.48 compatibility nss 3.48.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a progra...
NSS 3.49.1 release notes
3.49.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_49_1_rtm/src/ other releases are available in nss releases. new in nss 3.49.1 no new functionality is introduced in this release. bugs fixed in nss 3.49.1 bug 1606992 - cache the most recent pbkdf2 password hash, to
speed up repeated sdr operations, important with the increased kdf iteration counts. this bugzilla query returns all the bugs fixed in nss 3.49: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.49 compatibility nss 3.49.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a progra...
NSS 3.49.2 release notes
3.49.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_49_2_rtm/src/ other releases are available in nss releases. new in nss 3.49.2 no new functionality is introduced in this release. bugs fixed in nss 3.49.2 bug 1606992 - cache the most recent pbkdf1 password hash, to
speed up repeated sdr operations, important with the increased kdf iteration counts. nss 3.49.1 sped up pbkdf2 operations, though pbkdf1 operations are also relevant for older nss databases. bug 1608327 - fix compilation problems with neon-specific code in freebl bug 1608895 - fix a taskcluster issue with python 2 / python 3 this bugzilla query returns all the bugs fixed in nss 3.49: https://bugzi...
NSS 3.50 release notes
99514 for details. added nist sp800-108 kbkdf - pkcs#11 implementation. see bug 1599603 for details. bugs fixed in nss 3.50 bug 1599514 - update dtls 1.3 implementation to draft-30 bug 1603438 - fix native tools build failure due to lack of zlib include dir if external bug 1599603 - nist sp800-108 kbkdf - pkcs#11 implementation bug 1606992 - cache the most recent pbkdf1 password hash, to
speed up repeated sdr operations, important with the increased kdf iteration counts. nss 3.49.1 sped up pbkdf2 operations, though pbkdf1 operations are also relevant for older nss databases (also included in nss 3.49.2) bug 1608895 - gyp builds on taskcluster broken by setuptools v45.0.0 (for lacking python3) bug 1574643 - upgrade hacl* verified implementations of chacha20, poly1305, and 64-bit curve...
NSS 3.53 release notes
ion the hg tag is nss_3_53_rtm. nss 3.53 requires nspr 4.25 or newer. nss 3.53 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_53_rtm/src/ other releases are available in nss releases. notable changes in nss 3.53 when using the makefiles, nss can be built in parallel,
speeding up those builds to more similar performance as the build.sh/ninja/gyp system. (bug 290526) seed is now moved into a new freebl directory freebl/deprecated (bug 1636389). seed will be disabled by default in a future release of nss. at that time, users will need to set the compile-time flag (bug 1622033) to disable that deprecation in order to use the algorithm. algorithms marked as de...
nss tech note1
arena that you are passing to the decoder. this will allow you to free both the input data and the decoded data at once when freeing the arena. sec_asn1decodeitem can decode both ber and der data, while sec_quickderdecodeitem can only decode der data. sec_quickderdecodeitem does not support streaming data. this feature will most likely never be added, as this decoder gets most of its extra
speed from not making a copy of the input data, which would be required when streaming. sec_quickderdecodeitem supports sec_asn1_optional together with sec_asn1_skip sec_asn1_debug_break is not supported by sec_asn1decodeitem </tt> ...
NSS_Initialize
- don't open the cert db and key db's, just initialize the volatile certdb. nss_init_nomoddb - don't open the security module db, just initialize the pkcs #11 module. nss_init_forceopen - continue to force initializations even if the databases cannot be opened. nss_init_norootinit - don't try to look for the root certs module automatically. nss_init_optimizespace - optimize for space instead of
speed. use smaller tables and caches. nss_init_pk11threadsafe - only load pkcs#11 modules that are thread-safe, i.e., that support locking - either os locking or nss-provided locks . if a pkcs#11 module isn't thread-safe, don't serialize its calls; just don't load it instead. this is necessary if another piece of code is using the same pkcs#11 modules that nss is accessing without going through nss, fo...
Performance Hints
for example, you could rewrite function sum(a) { result = 0; for (i=0; i < a.length; i++) result += a[i]; return result; } as function sum(a) { var result = 0; for (var i=0; i < a.length; i++) result += a[i]; return result; } this is not equivalent code because the second version does not modify global variables result and i. ...
Shumway
amples. it can be run locally through a web server or you can use the version hosted on mozilla's github. several methods exist to allow inspector access to your swf file. once your flash content is loaded, you can see how shumway manages it in detail. several buttons are available at the bottom of the screen to enable or disable various shumway options. note: if your applet runs at an abnormal
speed, try toggling "turbo" at the bottom of the inspector window. you may wish to do this before opening your swf file. limitations of shumway might be encountered through testing. there are two places where shumway bugs are tracked: github (via issues and pull requests) manages problems relating to shumway, itself. bugzilla is intended for problems with integrating shumway into firefox. end-u...
Creating JavaScript tests
han the granularity of the os scheduler or when run on platforms with higher latencies than your development workstation. these tests will also show up as infrequent oranges on our heavily loaded test machines, lowering the value of our test suite for everyone. just don't do it, it's never worth it. do not add performance tests to the test suite. it is not generally even possible to tell if the
speed of any particular feature is going to be important in the real world without running a real-world benchmark. it is very hard to write a good real-world benchmark. for this reason, the best place to find out if a change is performance sensitive is on arewefastyet.com. focus on writing fast, light tests that cover a single feature. there is basically no cost to adding a new test, so add as many fe...
Functions
copied from the stack into reserved slots of the function object. to evaluate a name, instead of walking the scope chain, we just take the value from the reserved slot. the function object's parent is the global object. flat closures and null closures have been removed: https://bugzilla.mozilla.org/show_bug.cgi?id=730497 https://bugzilla.mozilla.org/show_bug.cgi?id=739808 name lookups in order of
speed, fastest to slowest. arg and local instructions. if a name definitely refers to an argument or local variable of the immediately enclosing function, it can be accessed using jsop_{get,set,call}{arg,local} instructions. some of these can even be fused with other operations into combo instructions like jsop_getargprop, jsop_forlocal, and jsop_inclocal. because arguments and locals can't be del...
SpiderMonkey Internals: Thread Safety
aiting for gc to finish. threads must not do anything that would affect gc while outside a request. and obviously you shouldn't block or otherwise dilly-dally while in a request; it prohibits gc. as an optimization, each thread has its own size-classified freelists containing chunks of gc-managed memory ready to be allocated. this allows allocation to avoid locking most of the time (a significant
speed win). a thread needs to lock on allocation only when the relevant per-thread freelist is empty. when this happens, the thread also refills that freelist from the jsruntime-wide gc allocator while it's in the lock. ...
Tracing JIT
files. an assembler runs in a single pass over its input, transforming one lins value to zero or more nins values. it is important to keep in mind that this pass runs backwards from the last lins in the input lir code to the first, generating native code in reverse. running backwards sometimes makes the logic difficult to follow, but it is an essential factor in maintaining the assembler's high
speed and small size. in the spidermonkey tracing jit there is only ever one assembler active at a time, associated with the currently active fragmento. nanojit/regalloc.* nanojit's register allocator. this is a local register allocator, meaning that it does not allocate registers across basic blocks. it is correspondingly very simple: register allocation is done immediately, step-by-step as code is...
JIT Optimization Outcomes
the most typical operations that are relevant for fast program execution are property accesses and function calls. this page documents the meaning of different optimization outcomes. general outcomes general outcomes shared between various optimization strategies. genericfailure the optimization attempt failed, and the reason was not recorded. genericsuccess optimization succeeded. disabled the optimization has been explicitly disallowed. notypeinfo optimization failed because there was no type information associated with an object containing the property. ...
JIT Optimization Strategies
ries a battery of strategies, from the most optimized but most restrictive to the least optimized but least restrictive. for each strategy attempted, its outcome is tracked. an outcome is either success or a reason why the strategy failed to apply. this page documents the various optimization strategies and their outcomes. it provides information on what they attempt to do, what general level of
speed-up they provide, what kind of program characteristics can prevent them from being used, and common ways to enable the engine to utilize that optimization. getproperty getproperty_argumentslength attempts to optimize an arguments.length property access. this optimization only works if the arguments object is used in well-understood ways within the function. the function containing the arguments...
SpiderMonkey 1.8.5
lease by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.5 is supported on all the platforms where firefox 4 runs. spidermonkey 1.8.5 includes a just-in-time compiler (jit) (several, actually) that compiles javascript to machine code, for a significant
speed increase. it is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8 the following features in earlier versions of spidermonkey have been dropped. support for extended class methods (in particular, jsequalityop) ...
SpiderMonkey 1.8.7
bed in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.7 is supported on all the platforms where firefox 10 runs. spidermonkey 1.8.7 includes type inference, which boosts the
speed of the jägermonkey jit by about 30% over version 1.8.5. type inference largely obviates tracemonkey, so the tracemonkey jit has been removed. the jit is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8.7 this ...
SpiderMonkey 1.8.8
ech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —insert-actual-release-date-here platform support spidermonkey 1.8.8 is supported on all the platforms where firefox insert-actual-firefox-version-number-here runs. spidermonkey 1.8.8 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant
speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8.8 the following features in earlier versions of spidermonkey have b...
SpiderMonkey 17
experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — 25 march 2013 platform support spidermonkey 17 is supported on all the platforms where firefox 17 runs. spidermonkey 17 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant
speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 17 the following features in earlier versions of spidermonkey have been...
SpiderMonkey 24
was motivated by garbage collector improvements, which lean quite heavily on c++'s support for raii through constructors and destructors.) if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 24 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant
speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 24 spidermonkey now provides a fully c++ interface, so embedders rely...
SpiderMonkey 31
supported on all the platforms where firefox 31 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 31 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant
speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 31 the first change most embedders will notice is that spidermonkey m...
SpiderMonkey 38
atform support spidermonkey 38 is supported on all the platforms where firefox 38 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010. spidermonkey 38 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant
speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 38 .... xxx will need updating for actual new gc stuff at time! a m...
SpiderMonkey 45
2016 platform support spidermonkey 45 is supported on all platforms able to run firefox 45. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note the minimum supported version is msvc 2013. spidermonkey 45 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant
speed increase. it is supported on x86, x86_64, and arm architectures. on several other platforms (sparc, mips), the jit is provided but not supported. on remaining platforms the jit is disabled; javascript code runs in an interpreter, as it has in previous versions. it's the same language, just not as fast. migrating to spidermonkey 45 spidermonkey 45 is not binary-compatible with previous releases...
Running Automated JavaScript Tests
jit-tests is -r filename (or --retest filename). the first time this is run, it runs the suite and writes a list of tests that failed to the given filename. the next time it is run, it will run only the tests in the given filename, and then will write the list of tests that failed when it is done. thus, you can keep retesting as you fix bugs and only the tests that failed the last time will run,
speeding things up a bit. running jit-tests on treeherder when viewing treeherder after a push to the mozilla repositories, jit-tests are run by calling make check, and appear under b. creating new tests for jit-tests creating new tests for jit-tests is easy. just add a new js file to the tests/basic directory (or any appropriate directory under 'tests'). the test harness will automatically find th...
Redis Tips
in your redis memory at all? for example, if you have a job queueing system, you might want redis to manage the queues themselves, and store pointers for the job data which might be retrieved by workers from some different, disk-resident db. (this is, for instance, how tj holowaychuk's implemented kue: https://github.com/learnboost/kue.) memory usage in redis is important to think about. the
speed 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. keyspace design here are some things i keep in mind when creating keys: keys are like urls and should read like nice urls keys are like urls with p...
Avoiding leaks in JavaScript XPCOM components
de to access xpcom objects (i.e., it wraps native xpcom objects for javascript) and it allows javascript code to implement xpcom interfaces (i.e., it wraps javascript objects for xpcom). for javascript objects that implement xpcom interfaces, the interface between reference counting and garbage collection is quite simple. (the implementation is slightly more complicated, but only to optimize for
speed and reduce creation and destruction of wrapper objects.) the wrapper object is reference counted, and as long as it exists, it makes the javascript object that it wraps be one of the roots used by the javascript garbage collector's mark phase. one might think that the wrappers of native xpcom objects (to allow them to be used from javascript) would just work the other way around. and in the simp...
Components.Constructor
it is equivalent to the following javascript function: function components_constructor(contractid, interfacename, initializer) { var ccargs = arguments; function ctor() { var instance = components.classes[contractid] .createinstance(components.interfaces.nsisuppor...
mozIStorageConnection
memory cache (specified by "pragma cache_size=") is full or the entire file is read. the cache must be active on the database for this to work. this means that you must have a transaction open on the connection, or have a transaction open on another connection that shares the same pager cache. this cached data will go away when the transaction is closed. this preload operation can dramatically
speed up read operations because the data is loaded as one large block. normally, pages are read in on demand, which can cause many disk seeks. void preload(); parameters none. removefunction() deletes a custom sql function that was created with either mozistorageconnection.createfunction() or mozistorageconnection.createaggregatefunction(). void removefunction( in autf8string afunctionname ...
nsIDOMGeoPositionCoords
sn't support altitude detection. read only. accuracy double the accuracy of position information, in meters. read only. altitudeaccuracy double the accuracy of altitude information, in meters. zero if the device doesn't support altitude detection. read only. heading double the current heading at which the user is moving, in degrees. read only.
speed double the
speed at which the user is moving, in meters per second (confirm this). read only. ...
nsIDownload
umable boolean indicates if the download can be resumed after being paused or not. this is only the case if the download is over http/1.1 or ftp and if the server supports it. read only. size long long the total size of the file in bytes, or ll_maxuint if the file's size is unknown. read only. source nsiuri the source uri of the download. read only.
speed double the downloads transfer
speed in bytes per second. read only. starttime long long the time at which the transfer was started. read only. state short the downloads current state. see nsidownloadmanager.constants. read only. target nsiuri the target of the transfer. read only. targetfile nsilocalfile indicates the location ...
nsIMsgDatabase
in unsigned long len2); getnewlist() the list of messages currently in the new state. if there are no such messages, null may be returned. the caller should free when done using nsmemory.free(). void getnewlist(out unsigned long count, [array, size_is(count)] out nsmsgkey newkeys); getcachedhits() these are used for caching search hits in a database, to
speed up saved search folders. nsisimpleenumerator getcachedhits(in string asearchfolderuri); refreshcache() void refreshcache(in string asearchfolderuri, in unsigned long anumkeys, [array, size_is (anumkeys)] in nsmsgkey anewhits, out unsigned long anumbadhits, [array, size_is(anumbadhits)] out nsmsgkey astalehits); update...
Performance
mit has gone through, the data is guaranteed to be committed. the problem is that these requirements make some operations, especially commits, very slow. for each commit, sqlite does two disk syncs among many other file operations (see the "atomic commit" section of http://www.sqlite.org/php2004/slides-all.html for more information on how this works). these disk syncs are very slow and limit the
speed of a commit to the rotational
speed of the mechanical disk. vacuuming and zero-fill sqlite has a vacuum command to compress unused space from the database. sqlite works like a memory manager or a file system. when data is deleted, the associated bytes are marked as free but are not removed from the file. this means that the file will not shrink, and some data may still be visible in the file. the...
Xptcall Porting Guide
ended up with larger stubs than i would have preferred rather than battle the compiler over what would happen to the stack before my asm code began running. i believe that the non-assembly parts of these files can be copied and reused with minimal (but not zero) platform specific tweaks. feel free to copy and paste as necessary. please remember that safety and reliability are more important than
speed optimizations. this code is primarily used to connect xpcom components with javascript; function call overhead is a tiny part of the time involved. i put together xptcall/src/md/test as a place to evolve the basic functionality as a port is coming together. not all of the functionality is exercised, but it is a place to get started. xptcall/tests has an api level test for ns_invokebyindex, but no...
Mozilla
creating a language pack to create a language pack, or a localization repack, you first need to go through the initial setup process. creating a localized windows installer of seamonkey preamble: not all of the programs listed below are necessary. some of them are simply the ones i use because i like them, while others are scripts that i've created to
speed up the work. you can in every case choose the program you prefer to do some operations, and you can also decide not to use any of my scripts and manually enter all of the commands by hand. it's your choice! creating a login manager storage module the login manager manages and stores user passwords. extensions can replace the built-in pass...
Accessibility Inspector - Firefox Developer Tools
through the main features of the accessibility inspector and how to use it. a (very) brief guide to accessibility accessibility is the practice of making your websites usable by as many people as possible. this means trying your best to not lock anyone out of accessing information because of any disability they may have, or any other personal circumstances such as the device they are using, the
speed of their network connection, or their geographic location or locale. you can find more extensive information in the accessibility section of mdn web docs. here we are mainly talking about exposing information to people with visual disabilities — this is done via the accessibility apis available inside web browsers, which expose information on what roles the different elements on your page play...
Index - Firefox Developer Tools
analysis 110n:priority, debugging, dev tools, firefox, guide, networking, tools the network monitor includes a performance analysis tool, to help show you how long the browser takes to download the different parts of your site. 53 throttling 110n:priority, debugging, dev tools, firefox, guide, networking, tools the network monitor allows you to throttle your network
speed to emulate various connection
speeds so you can see how your app will behave under different connection types. 54 page inspector css, dom, html, stylesheets, web development, web development:tools, l10n:priority use the page inspector to examine and modify the html and css of a page. 55 how to links for various how to's can be found here. these links des...
Animation - Web APIs
e browser's automatically removing filling animations behavior. animation.play() starts or resumes playing of an animation, or begins the animation again if it previously finished. animation.reverse() reverses playback direction, stopping at the start of the animation. if the animation is finished or unplayed, it will play from end to beginning. animation.updateplaybackrate() sets the
speed of an animation after first synchronizing its playback position. automatically removing filling animations it is possible to trigger a large number of animations on the same element. if they are indefinite (i.e., forwards-filling), this can result in a huge animations list, which could create a memory leak. for this reason, modern browsers have implemented the part of the web animations spec t...
AudioBufferSourceNode.start() - Web APIs
inning of the audio buffer, and offsets past the end of the audio which will be played (based on the audio buffer's duration and/or the loopend property) are silently clamped to the maximum value allowed. the computation of the offset into the sound is performed using the sound buffer's natural sample rate, rather than the current playback rate, so even if the sound is playing at twice its normal
speed, the midway point through a 10-second audio buffer is still 5. duration optional the duration of the sound to be played, specified in seconds. if this parameter isn't specified, the sound plays until it reaches its natural conclusion or is stopped using the stop() method. using this parameter is functionally identical to calling start(when, offset) and then calling stop(when+duration). return...
Detecting device orientation - Web APIs
formation provided within the devicemotionevent object passed as a parameter of the handlemotion function. the motion event contains four properties: devicemotionevent.acceleration devicemotionevent.accelerationincludinggravity devicemotionevent.rotationrate devicemotionevent.interval motion values explained the devicemotionevent objects provide web developers with information about the
speed of changes for the device's position and orientation. the changes are provided along three axis (see orientation and motion data explained for details). for acceleration and accelerationincludinggravity, those axes correspond to the following: x: represents the axis from west to east y: represents the axis from south to north z: represents the axis perpendicular to the ground for rotation...
DeviceMotionEvent - Web APIs
warning: currently, firefox and chrome do not handle the coordinates the same way. take care about this while using them. constructor devicemotionevent.devicemotionevent() creates a new devicemotionevent. properties devicemotionevent.accelerationread only an object giving the acceleration of the device on the three axis x, y and z. acceleration is expressed in m/s2. devicemotionevent.accelerationincludinggravityread only an object giving the acceleration of the device on the three axis x, y and z with the effect of gravity. acceleration is expressed in m/s2. ...
Document: scroll event - Web APIs
ations. instead, it is recommended to throttle the event using requestanimationframe(), settimeout(), or a customevent, as follows. note, however, that input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary. this example optimizes thescroll event for requestanimationframe. ...
EffectTiming.easing - Web APIs
] or the definition is invalid. ease a decelerated rate of change, going from fast to slow. equivalent to cubic-bezier(0.25, 0.1, 0.25, 1). ease-in an accelerated rate of change, going from slow to fast. equivalent to cubic-bezier(0.42, 0, 1, 1). ease-out another decelerated rate of change, going from fast to slow. equivalent to cubic-bezier(0, 0, 0.58, 1). ease-in-out this rate of change
speeds up in the middle. equivalent to cubic-bezier(0.42, 0, 0.58, 1). frames(<integer>) specifies a frames timing function, which breaks the animation down into a number of equal time intervals but also displays the start (0%) and end (100%) states for an equal amount of time to the other intervals. the browser flips to a different static frame when each interval is reached, rather than animating sm...
Element: DOMMouseScroll event - Web APIs
is -32768. if the event indictes scrolling down by a page, the value is +32768. any other value represents the number of lines to scroll, with the direction indicated by the value's sign. note: trusted events are never sent with a value of 0 for detail. trusted events are never fired with 0. note: if the platform's native mouse wheel events only provide scroll distance by pixels, or if the
speed can be customized by the user, the value is computed using the line height of the nearest scrollable ancestor element of the event's target. if that element's font size is smaller than mousewheel.min_line_scroll_amount, that preference's value is used as the line height. ...
Element: scroll event - Web APIs
ations. instead, it is recommended to throttle the event using requestanimationframe(), settimeout(), or a customevent, as follows. note, however, that input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary. this example optimizes thescroll event for requestanimationframe. ...
Introduction to the File and Directory Entries API - Web APIs
getting shut down. video game or other apps with lots of media assets the app downloads one or several large tarballs and expands them locally into a directory structure. the app pre-fetches assets in the background, so the user can go to the next task or game level without waiting for a download. audio or photo editor with offline access or local cache (great for performance and
speed) the app can write to files in place (for example, overwriting just the id3/exif tags and not the entire file). offline video viewer the app can download large files (>1gb) for later viewing. the app can access partially downloaded files (so that you can watch the first chapter of your dvd, even if the app is still downloading the rest of the content or if the app didn't complete t...
GeolocationCoordinates.heading - Web APIs
the geolocationcoordinates.heading read-only property is a double representing the direction in which the device is traveling. this value, specified in degrees, indicates how far off from heading due north the device is. zero degrees represents true true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). if geolocationcoordinates.
speed is 0, heading is nan. if the device is not able to provide heading information, this value is null. syntax let heading = geolocationcoordinatesinstance.heading value a double representing the direction in which the device is traveling. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.heading' in that specificat...
GeolocationCoordinates - Web APIs
this value can be null. geolocationcoordinates.heading read only secure context returns a double representing the direction towards which the device is facing. this value, specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). if
speed is 0, heading is nan. if the device is unable to provide heading information, this value is null. geolocationcoordinates.
speed read only secure context returns a double representing the velocity of the device in meters per second. this value can be null. methods the geolocationcoordinates interface neither implements, nor inherits any method. specifications specification statu...
GeolocationPosition - Web APIs
properties the geolocationposition interface doesn't inherit any properties. geolocationposition.coords read only secure context returns a geolocationcoordinates object defining the current location. ...
Using the Geolocation API - Web APIs
hat you need to draw your position on a map. hence many geolocation success callbacks look fairly simple: function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; // do something with your latitude and longitude } you can however get a number of other bits of information from a geolocationcoordinates object, including altitude,
speed, what direction the device is facing, and an accuracy measure of the altitude, longitude, and latitude data. handling errors the error callback function, if provided when calling getcurrentposition() or watchposition(), expects a geolocationpositionerror object instance as its first parameter. this object type contains two properties, a code indicating what type of error has been returned, and ...
HTMLCanvasElement.getContext() - Web APIs
onformance rules. contextattributes you can use several context attributes when creating your rendering context, for example: const gl = canvas.getcontext('webgl', { antialias: false, depth: false }); 2d context attributes: alpha: boolean that indicates if the canvas contains an alpha channel. if set to false, the browser now knows that the backdrop is always opaque, which can
speed up drawing of transparent content and images. desynchronized: boolean that hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop (gecko only) willreadfrequently: boolean that indicates whether or not a lot of read-back operations are planned. this will force the use of a software (instead of hardware accelerated) 2d canvas and can save mem...
HTMLMarqueeElement - Web APIs
fault value is −1, which means the marquee will scroll continuously. htmlmarqueeelement.scrollamount sets the amount of scrolling at each interval in pixels. the default value is 6. htmlmarqueeelement.scrolldelay sets the interval between each scroll movement in milliseconds. the default value is 85. note that any value smaller than 60 is ignored and the value 60 is used instead, unless true
speed is true. htmlmarqueeelement.true
speed by default, scrolldelay values lower than 60 are ignored. if true
speed is true, then those values are not ignored. htmlmarqueeelement.vspace sets the vertical margin. htmlmarqueeelement.width sets the width in pixels or percentage value. event handlers htmlmarqueeelement.onbounce fires when the marquee has reached the end of its scroll position. i...
HTMLMediaElement.defaultPlaybackRate - Web APIs
the value 0.0 is invalid and throws a not_supported_err exception. example var obj = document.createelement('video'); console.log(obj.defaultplaybackrate); // 1 specifications specification status comment html living standardthe definition of 'htmlmediaelement.defaultplaybackrate' in that specification. ...
LocalFileSystem - Web APIs
reate two file systems: one that's temporary and one that's persistent. (to learn more about the storage types, see the basic concepts article.) in most cases, you need to create only one file system, but in a few cases, it might be useful to create a second one. for example, if you were to create a mail app, you might create a temporary storage for caching assets (like images and attachments) to
speed up performance, while creating persistent storage for unique data—such as drafts of emails that were composed while offline—that should not be lost before they are backed up into the cloud. using persistent storage the requestfilesystem() method lets you ask for persistent or temporary storage. persistent storage is storage that stays in the browser unless the app or the user removes it, ...
MediaPositionState - Web APIs
being performed. properties duration a floating-point value giving the total duration of the current media in seconds. this should always be a positive number, with positive infinity (infinity) indicating media without a defined end, such as a live stream. playbackrate a floating-point value indicating the rate at which the media is being played, as a ratio relative to its normal playback
speed. thus, a value of 1 is playing at normal
speed, 2 is playing at double
speed, and so forth. negative values indicate that the media is playing in reverse; -1 indicates playback at the normal
speed but backward, -2 is double
speed in reverse, and so on. position a floating-point value indicating the last reported playback position of the media in seconds. this must always be a positive value. ...
MediaSession.setPositionState() - Web APIs
the mediasession method setpositionstate() is used to update the current document's media playback position and
speed for presentation by user's device in any kind of interface that provides details about ongoing media. this can be particularly useful if your code implements a player for type of media not directly supported by the browser. call this method on the navigator object's mediasession object. syntax navigator.mediasession.setpositionstate(statedict); parameters statedict optional an object conforming to the mediapositionstate dictionary, providing updated information about the playback position and
speed of the document's ongoing media. if the object is empty, the existing playback state information is cleared. return value undefined. exceptions typeerror this erro...
MediaSession - Web APIs
f mediametadata which contains rich media metadata, for display in a platform ui. playbackstate indicates whether the current media session is playing. valid values are none, paused, or playing. methods setactionhandler() sets an event handler for a media session action, such as play or pause. see the method page for a full list. setpositionstate() sets the current playback position and
speed of the media currently being presented. examples the following example creates a new media session and assigns action handlers to it: if ('mediasession' in navigator){ navigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhand...
Media Session API - Web APIs
ui. mediasession allows a web page to provide custom behaviors, for standard media playback interactions. dictionaries mediaimage a mediaimage object contains information describing an image associated with the media. this might be a cd or dvd cover, a movie poster, a poster frame, or the like. mediapositionstate used to contain information about the current playback position, playback
speed, and overall media duration when calling the mediasession method setpositionstate() to establish the media's length, playback position, and playback
speed. mediasessionactiondetails provides information needed in order to perform the action which has been requested, including the type of action to perform and any other information needed, such as seek distances or times. examples the followi...
NetworkInformation - Web APIs
navigator interface. note: this feature is available in web workers. properties this interface also inherits properties of its parent, eventtarget. networkinformation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. networkinformation.downlinkmax read only returns the maximum downlink
speed, in megabits per second (mbps), for the underlying connection technology. networkinformation.effectivetype read only returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'. this value is determined using a combination of recently observed round-trip time and downlink values. networkinformation.rtt read only returns the estimated effective round-trip time ...
Network Information API - Web APIs
ing a video may not be desirable. if a cellular connection is found, then the preloadvideo flag is set to false. for simplicity and clarity, this example only tests for one connection type. a real-world use case would likely use a switch statement or some other method to check all of the possible values of networkinformation.type. regardless of the type value you can get an estimate of connection
speed through the networkinformation.effectivetype property. let preloadvideo = true; var connection = navigator.connection || navigator.mozconnection || navigator.webkitconnection; if (connection) { if (connection.effectivetype === 'slow-2g') { preloadvideo = false; } } interfaces networkinformation provides information about the connection a device is using to communicate with the netwo...
OffscreenCanvas.getContext() - Web APIs
ontextattributes you can use several context attributes when creating your rendering context, for example: offscreen.getcontext("webgl", { antialias: false, depth: false }); 2d context attributes: alpha: boolean that indicates if the canvas contains an alpha channel. if set to false, the browser now knows that the backdrop is always opaque, which can
speed up drawing of transparent content and images then. (gecko only) willreadfrequently: boolean that indicates whether or not a lot of read-back operations are planned. this will force the use of a software (instead of hardware accelerated) 2d canvas and can save memory when calling getimagedata() frequently. this option is only available, if the flag gfx.canvas.willreadfrequently.enable is set t...
PannerNode.setVelocity() - Web APIs
the setvelocity() method of the pannernode interface defines the velocity vector of the audio source — how fast it is moving and in what direction. this method was removed from the specification because of gaps in its design and implementation problems. the velocity relative to the listener is used to control the pitch change needed to conform with the doppler effect due to the relative
speed. as the vector controls both the direction of travel and its velocity, the three parameters x, y and z are expressed in meters per second. the default value of the velocity vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setvelocity(0,0,17); returns void. example in the following example, you can see an example of how the createpanne...
PerformanceTiming.domInteractive - Web APIs
ntiming interface instead. the legacy performancetiming.dominteractive read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser finished its work on the main document, that is when its document.readystate changes to 'interactive' and the corresponding readystatechange event is thrown. this property can be used to measure the
speed of loading web sites that users feels. nevertheless there are a few caveats that happens if scripts are blocking rendering and not loaded asynchronously or with custom web fonts. check if you are in one of these cases before using this property as a proxy for the user experience of a web site's
speed of loading. syntax time = performancetiming.dominteractive; specifications specifica...
RTCRemoteOutboundRtpStreamStats - Web APIs
an integer value indicating the total number of rtcp sender report (sr) blocks that this ssrc has sent. usage notes the rtcremoteoutboundrtpstreamstats object's remotetimestamp proeprty provides statistics based on the received data's ntp timestamp taken from an rtcp sender report (sr) block. be aware that the remote clock may not be synchronized with the local clock (either in current time or
speed at which time elapses). specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcremoteoutboundrtpstreamstats' in that specification. candidate recommendation initial definition. ...
ReadableStream.tee() - Web APIs
you might do this for example in a serviceworker if you want to fetch a response from the server and stream it to the browser, but also stream it to the serviceworker cache. ...
SpeechSynthesisUtterance.rate - Web APIs
if unset, a default value of 1 will be used. syntax var myrate = speechsynthesisutteranceinstance.rate; speechsynthesisutteranceinstance.rate = 1.5; value a float representing the rate value. it can range between 0.1 (lowest) and 10 (highest), with 1 being the default pitch for the current platform or voice, which should correspond to a normal speaking rate. other values act as a percentage relative to this, so for example 2 is twice as fast, 0.5 is half as fast, etc. some speech synthesis engines or voices may constrain the minimum and maximum rates further. ...
SpeechSynthesisUtterance - Web APIs
tterance() returns a new speechsynthesisutterance object instance. properties speechsynthesisutterance also inherits properties from its parent interface, eventtarget. speechsynthesisutterance.lang gets and sets the language of the utterance. speechsynthesisutterance.pitch gets and sets the pitch at which the utterance will be spoken at. speechsynthesisutterance.rate gets and sets the
speed at which the utterance will be spoken at. speechsynthesisutterance.text gets and sets the text that will be synthesised when the utterance is spoken. speechsynthesisutterance.voice gets and sets the voice that will be used to speak the utterance. speechsynthesisutterance.volume gets and sets the volume that the utterance will be spoken at. events listen to these events using addeventlist...
Streams API concepts - Web APIs
d the end is called the ultimate sink. note: this functionality isn't fully thought through yet, or available in many browsers. at some point the spec writers hope to add something like a transformstream class to make creating transform streams easier. backpressure an important concept in streams is backpressure — this is the process by which a single stream or a pipe chain regulates the
speed of reading/writing. when a stream later in the chain is still busy and isn't yet ready to accept more chunks, it sends a signal backwards through the chain to tell earlier transform streams (or the original source) to slow down delivery as appropriate so that you don't end up with a bottleneck anywhere. to use backpressure in a readablestream, we can ask the controller for the chunk size desire...
Streams API - Web APIs
with streams being available to javascript, this all changes — you can now start processing raw data with javascript bit by bit as soon as it is available on the client-side, without needing to generate a buffer, string, or blob. there are more advantages too — you can detect when streams start or end, chain streams together, handle errors and cancel streams as required, and react to the
speed of the stream is being read at. the basic usage of streams hinges around making responses available as streams. for example, the response body returned by a successful fetch request can be exposed as a readablestream, and you can then read it using a reader created with readablestream.getreader(), cancel it with readablestream.cancel(), etc. more complicated uses involve creating your own strea...
TextEncoder.prototype.encodeInto() - Web APIs
gth. thus, a more optimistic approach might be to allocate s.length * 2 + 5 bytes, and perform reallocation in the rare circumstance that the optimistic prediction was wrong. if the output is expected to be long-lived, it makes sense to compute minimum allocation rounduptobucketsize(s.length), the maximum allocation size s.length * 3, and to have a chosen (as a tradeoff between memory usage and
speed) threshold t such that if rounduptobucketsize(s.length) + t >= s.length * 3, you simply allocate for s.length * 3. otherwise, first allocate for rounduptobucketsize(s.length) and convert. if the read item it the return dictionary is s.length, the conversion is done. if not, reallocate the target buffer to written + (s.length - read) * 3 and then convert the rest by taking a substring of s startin...
A basic 2D WebGL animation example - Web APIs
it can apply that may improve performance based on that information. with the vertex data now provided to webgl, we set vertexnumcomponents to the number of components in each vertex (2, since they're 2d vertexes) and vertexcount to the number of vertexes in the vertex list. then the current rotation angle (in degrees) is set to 0.0, since we haven't performed any rotation yet, and the rotation
speed (in degrees per screen refresh period, typically 60 fps) is set to 6. finally, animatescene() is called to render the first frame and schedule the rendering of the next frame of the animation. compiling and linking the shader program constructing and linking the program the buildshaderprogram() function accepts as input an array of objects describing a set of shader functions to be compiled a...
WebGL best practices - Web APIs
he number of bytes consumed by each texture, for example. the cap also must typically be updated as the browser window resizes, and older resources above the limit must be purged. keeping the application's vram usage under this cap will help to avoid out-of-memory errors and associated instability. consider rendering to a smaller backbuffer size a common (and easy) way to trade off quality for
speed is rendering into a smaller backbuffer, and upscaling the result. consider reducing canvas.width and height and keeping canvas.style.width and height at a constant size. batch draw calls (prefer fewer-but-larger draw calls) fewer, larger draw operations will generally improve performance. if you have 1000 sprites to paint, try to do it as a single drawarrays() or drawelements() call. it's comm...
Using the Web Animations API - Web APIs
n’s playbackrate. we use updateplaybackrate() instead of setting the playbackrate directly since that produces a smooth update: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * .9); } }, 3000); but urging them on by clicking or tapping causes them to
speed up by multiplying their playbackrate: var gofaster = function() { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * 1.1); } document.addeventlistener("click", gofaster); document.addeventlistener("touchstart", gofaster); the background elements also have playbackrates that are impacted when you click or tap. what happens when you make alice and the red queen run twice as fast? ...
Window.open() - Web APIs
with the features of the browser at the disposal of the user and your code should not interfere with the final decision resting with the user. do not use target="_blank" always provide a meaningful name to your target attribute and try to reuse such target attribute in your page so that a click on another link may load the referenced resource in an already created and rendered window (therefore
speeding up the process for the user) and therefore justifying the reason (and user system resources, time spent) for creating a secondary window in the first place. using a single target attribute value and reusing it in links is much more user resources friendly as it only creates one single secondary window, which is recycled. on the other hand, using "_blank" as the target attribute value will crea...
Window.requestAnimationFrame() - Web APIs
return value a long integer value, the request id, that uniquely identifies the entry in the callback list. this is a non-zero value, but you may not make any other assumptions about its value. you can pass this value to window.cancelanimationframe() to cancel the refresh callback request. example in this example, an element is animated for 2 seconds (2000 milliseconds). the element moves at a
speed of 0.1px/ms to the right, so its relative position (in css pixels) can be calculated in function of the time elapsed since the start of the animation (in milliseconds) with 0.1 * elapsed. the element's final position is 200px (0.1 * 2000) to the right of its initial position. const element = document.getelementbyid('some-element-you-want-to-animate'); let start; function step(timestamp) { if ...
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
ch updates the mouse look direction's yaw and pitch based on the mouse delta values from the mousemove event. the pitch is restricted so that you can't look beyond straight up and straight down. each time this is called, the new offsets are used to update the current values of mousepitch and mouseyaw. let mouseyaw = 0.0; let mousepitch = 0.0; const inverseorientation = quat.create(); const mouse_
speed = 0.003; function rotateviewby(dx, dy) { mouseyaw += dx * mouse_
speed; mousepitch += dy * mouse_
speed; if (mousepitch < -math.pi * 0.5) { mousepitch = -math.pi * 0.5; } else if (mousepitch > math.pi * 0.5) { mousepitch = math.pi * 0.5; } } finally, we need code that actually applies the computed yaw and pitch to the viewer's orientation. this function, applymousemovement(), h...
Accessibility: What users can do to browse more safely - Accessibility
sure to content leading to seizures and / or other physical reactions. personalization and accessibility settings from the article, "understanding success criterion 2.3.1: three flashes or below threshold" "flashing can be caused by the display, the computer rendering the image or by the content being rendered. the author has no control of the first two. they can be addressed by the design and
speed of the display and computer" hardware and operating systems on many computers offer control that is not afforded to developers. the user can do much to protect himself by learning his operating system, its personalization and accessibility settings. those in the public sector who must accomodate those with special sensitivities, should consider setting aside at least one work station and becomin...
An overview of accessible web applications and widgets - Accessibility
link, button, or form on the page in a linear order, using shift-tab to navigate backwards. it's a one-dimensional form of navigation—forward and back, one element at a time. on fairly dense pages, a keyboard-only user often has to press the tab key dozens of times before accessing the needed section. implementing desktop-style keyboard conventions on the web has the potential to significantly
speed up navigation for many users. here's a summary of how keyboard navigation should work in an aria-enabled web application: the tab key should provide focus to the widget as a whole. for example, tabbing to a menu bar should not put focus on the menu's first element. the arrow keys should allow for selection or navigation within the widget. for example, using the left and right arrow keys shou...
Cognitive accessibility - Accessibility
, or being momentarily saddened by a tweet or video they just saw online. a third example could be sleep deprivation. it may seem like an overwhelming challenge to address the wide range of cognitive differences, especially when solutions for two different people may be conflicting. one way to handle this is to focus on cognitive skills. ...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
whether or not touch devices use momentum-based scrolling for a given element. syntax values auto use "regular" scrolling, where the content immediately ceases to scroll when you remove your finger from the touchscreen. touch use momentum-based scrolling, where the content continues to scroll for a while after finishing the scroll gesture and removing your finger from the touchscreen. the
speed and duration of the continued scrolling is proportional to how vigorous the scroll gesture was. also creates a new stacking context. formal definition initial valueautoapplies toscrolling boxesinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | touch examples html <div class="scroll-touch"> <p> this paragraph has momentum scrolling </p> </div> <div cl...
update - CSS: Cascading Style Sheets
per. slow the layout may change dynamically according to the usual rules of css, but the output device is not able to render or display changes quickly enough for them to be perceived as a smooth animation. examples: e-book readers or severely underpowered devices. fast the layout may change dynamically according to the usual rules of css, and the output device is not unusually constrained in
speed, so regularly-updating things like css animations can be used. example: computer screens. examples html <p>if this text animates for you, you are using a fast-updating device.</p> css @keyframes jiggle { from { transform: translatey(0); } to { transform: translatey(25px); } } @media (update: fast) { p { animation: 1s jiggle linear alternate infinite; } } result ...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
ations you also need to take notice of if you want to learn flexbox, and find out why flexbox is different to some other modules. note: css versions 1 and 2 were a single monolithic specification where all of css was defined in one large document. as css became a more feature rich language, maintaining one huge specification became problematic, with different parts of css moving on at different
speeds. css was therefore modularised, and the various css specifications are different modules that make up css today. these modules relate to each other, and are at different stages of development. the box alignment module for many people the first reason they start to look at flexbox is because of the ability to properly align flex items inside a flex container. flexbox provides access to propert...
CSS Images - CSS: Cascading Style Sheets
l-gradient() conic-gradient() repeating-conic-gradient() url() element() image() cross-fade() data types <gradient> <image> guides using css gradients presents a specific type of css images, gradients, and how to create and use these. implementing image sprites in css describes the common technique grouping several images in one single document to save download requests and
speed up the availability of a page. specifications specification status comment css images module level 4 working draft added image-resolution, conic-gradient(), and image() css images module level 3 candidate recommendation added image-orientation, image-rendering, object-fit and object-position compatibility standardthe definition of 'css ...
Using CSS transitions - CSS: Cascading Style Sheets
instead of having property changes take effect immediately, you can cause the changes in a property to take place over a period of time. for example, if you change the color of an element from white to black, usually the change is instantaneous. with css transitions enabled, changes occur at time intervals that follow an acceleration curve, all of which can be customized. animations that involve transitioning between two states are often called implicit transitions as the states in between the start and final states are implicitly defined by the browser. ...
WebKit CSS extensions - CSS: Cascading Style Sheets
-locale -webkit-logical-height -webkit-logical-width m -webkit-margin-after-collapse -webkit-margin-after -webkit-margin-before-collapse -webkit-margin-before -webkit-margin-bottom-collapse -webkit-margin-collapse -webkit-margin-end** -webkit-margin-start** -webkit-margin-top-collapse -webkit-marquee-direction -webkit-marquee-increment -webkit-marquee-repetition -webkit-marquee-
speed -webkit-marquee-style -webkit-marquee -webkit-mask-box-image-outset -webkit-mask-box-image-repeat -webkit-mask-box-image-slice -webkit-mask-box-image-source -webkit-mask-box-image-width -webkit-mask-box-image -webkit-mask-repeat-x -webkit-mask-repeat-y -webkit-mask-source-type -webkit-max-logical-height -webkit-max-logical-width -webkit-min-logical-height -webkit-min-logical-width ...
<alpha-value> - CSS: Cascading Style Sheets
color is used and half of the background color is used. values outside the range of 0 to 1 are permitted, but are clamped to like within the range 0 to 1. if the alpha value is given as a percentage, 0% corresponds to fully transparent while 100% indicates fully opaque. interpolation when animated, values of the <alpha-value> css data type are interpolated as real, floating-point numbers. the
speed of the interpolation is determined by the timing function associated with the animation. examples setting text color opacity here an alpha value is used to set partially transparent text: /* <rgba()> */ color: rgba(34, 12, 64, 0.6); color: rgba(34.0 12 64 / 60%); setting shape image threshold here an alpha value is used to determine which parts of an image are considered part of a shape: ...
<color> - CSS: Cascading Style Sheets
fault document background color. interpolation in animations and gradients, <color> values are interpolated on each of their red, green, and blue components. each component is interpolated as a real, floating-point number. note that interpolation of colors happens in the alpha-premultiplied srgba color space to prevent unexpected gray colors from appearing. in animations, the interpolation's
speed is determined by the timing function. accessibility considerations some people have difficulty distinguishing colors. the wcag 2.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result. see color and color contrast for more information. examples color value tester in this example we provide a <div> and a text input. entering ...
image-rendering - CSS: Cascading Style Sheets
neighbor and other non-smoothing scaling algorithms such as 2×sai and hqx-family algorithms. this value is intended for pixel-art images, such as in browser games. pixelated when scaling the image up, the nearest-neighbor algorithm must be used, so that the image appears to be composed of large pixels. when scaling down, this is the same as auto. note: the values optimizequality and optimize
speed present in an early draft (and coming from its svg counterpart image-rendering) are defined as synonyms for the smooth and pixelated values respectively. formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | crisp-edges | pixelated examples setting image scaling algorithms in practical use, the pixelated a...
<integer> - CSS: Cascading Style Sheets
during the lc phase, was [-227-1; 227-1], but other values like 224-1 and 230-1 were also proposed. however, the latest spec doesn't specify a range anymore. interpolation when animated, values of the <integer> data type are interpolated using discrete, whole steps. the calculation is done as if they were real, floating-point numbers; the discrete value is obtained using the floor function. the
speed of the interpolation is determined by the timing function associated with the animation. examples valid integers 12 positive integer (without a leading + sign) +123 positive integer (with a leading + sign) -456 negative integer 0 zero +0 zero, with a leading + -0 zero, with a leading - invalid integers 12.0 this is a <number>, not an...
<length> - CSS: Cascading Style Sheets
in firefox 59 an experimental unit that attempts to render at exactly one millimeter regardless of the size or resolution of the display. this is rarely actually what you want, but may be useful in particular for mobile devices. interpolation when animated, values of the <length> data type are interpolated as real, floating-point numbers. the interpolation happens on the calculated value. the
speed of the interpolation is determined by the timing function associated with the animation. examples length unit comparison the following demo provides you with an input field in which you can enter a <length> value (e.g. 300px, 50%, 30vw) to set the width of a result bar that will appear below it once you've pressed return. this allows you to compare and contrast the effect of different length ...
<number> - CSS: Cascading Style Sheets
er an integer or a number with a fractional component. syntax the syntax of <number> extends the syntax of <integer>. a fractional value is represented by a . followed by one or more decimal digits, and may be appended to an integer. there is no unit associated with numbers. interpolation when animated, values of the <number> css data type are interpolated as real, floating-point numbers. the
speed of the interpolation is determined by the timing function associated with the animation. examples valid numbers 12 a raw <integer> is also a <number>. 4.01 positive fraction -456.8 negative fraction 0.0 zero +0.0 zero, with a leading + -0.0 zero, with a leading - .60 fractional number without a leading zero 10e3 scientific notation -3.4...
<percentage> - CSS: Cascading Style Sheets
percentage> data type consists of a <number> followed by the percentage sign (%). optionally, it may be preceded by a single + or - sign, although negative values are not valid for all properties. as with all css dimensions, there is no space between the symbol and the number. interpolation when animated, values of the <percentage> data type are interpolated as real, floating-point numbers. the
speed of the interpolation is determined by the timing function associated with the animation. examples width and margin-left <div style="background-color:navy;"> <div style="width:50%; margin-left:20%; background-color:chartreuse;"> width: 50%, left margin: 20% </div> <div style="width:30%; margin-left:60%; background-color:pink;"> width: 30%, left margin: 60% </div> </div> the a...
position - CSS: Cascading Style Sheets
ns visual presentation: understanding sc 1.4.8 | understanding wcag 2.0 performance & accessibility scrolling elements containing fixed or sticky content can cause performance and accessibility issues. as a user scrolls, the browser must repaint the sticky or fixed content in a new location. depending on the content needing to be repainted, the browser performance, and the device's processing
speed, the browser may not be able to manage repaints at 60 fps, causing accessibility concerns for people with sensitivities and jank for everyone. one solution is to add will-change: transform to the positioned elements to render the element in its own layer, improving repaint
speed and therefore improving performance and accessibility. formal definition initial valuestaticapplies toall elementsinh...
<position> - CSS: Cascading Style Sheets
m | <length> | <percentage> ]? | [ [ left | right ] [ <length> | <percentage> ] ] && [ [ top | bottom ] [ <length> | <percentage> ] ] ] note: the background-position property also accepts a three-value syntax. this is not allowed in other properties that use <position>. interpolation when animated, a point's abscissa and ordinate values are interpolated independently. however, because the
speed of the interpolation is determined by a single timing function for both coordinates, the point will move in a straight line. examples valid positions center left center top right 8.5% bottom 12vmin right -6px 10% 20% 8rem 14px invalid positions left right bottom top 10px 15px 20px 15px specifications specification status comment css values and units module l...
<shape> - CSS: Cascading Style Sheets
offset for the bottom of the rectangle relative to the top border of the element's box. left is a <length> representing the offset for the left of the rectangle relative to the left border of the element's box. interpolation when animated, values of the <shape> data type are interpolated over their top, right, bottom, and left components, each treated as a real, floating-point number. the
speed of the interpolation is determined by the timing function associated with the animation. example img.clip04 { clip: rect(10px, 20px, 20px, 10px); } specifications specification status comment css level 2 (revision 1)the definition of '<shape>' in that specification. recommendation defines with the clip property. browser compatibility the compatibil...
table-layout - CSS: Cascading Style Sheets
ayout algorithm. the widths of the table and its cells are adjusted to fit the content. fixed table and column widths are set by the widths of table and col elements or by the width of the first row of cells. cells in subsequent rows do not affect column widths. under the "fixed" layout method, the entire table can be rendered once the first table row has been downloaded and analyzed. this can
speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths provided. cells use the overflow property to determine whether to clip any overflowing content, but only if the table has a known width; otherwise, they won't overflow the cells. formal definition initial valueautoapplies totable and inline-table elementsinheritednocomputed valu...
will-change - CSS: Cascading Style Sheets
ing and the browser will keep the optimizations for much longer time than it would have otherwise. so it is a good practice to switch will-change on and off using script code before and after the change occurs. don't apply will-change to elements to perform premature optimization. if your page is performing well, don't add the will-change property to elements just to wring out a little more
speed. will-change is intended to be used as something of a last resort, in order to try to deal with existing performance problems. it should not be used to anticipate performance problems. excessive use of will-change will result in excessive memory use and will cause more complex rendering to occur as the browser attempts to prepare for the possible change. this will lead to worse performance. ...
Audio and Video Delivery - Developer guides
king, and time ranges sometimes it's useful to know how much <audio> or <video> has downloaded or is playable without delay — a good example of this is the buffered progress bar of an audio or video player. this article discusses how to build a buffer/seek bar using timeranges, and other features of the media api. html5 playbackrate explained the playbackrate property allows us to change the
speed or rate at which a piece of web audio or video is playing. this article explains it in detail. using the web audio api explains the basics of using the web audio api to grab, manipulate and play back an audio source. streaming media tutorials live streaming web audio and video live streaming technology is often employed to relay live events such as sports, concerts and more generally tv a...
Audio and video manipulation - Developer guides
ch means you can put video inside 3d scenes. note: you can find the source code of this demo on github (see it live also). playback rate we can also adjust the rate that audio and video plays at using an attribute of the <audio> and <video> element called playbackrate. playbackrate is a number that represents a multiple to be applied to the rate of playback, for example 0.5 represents half
speed while 2 represents double
speed. note that the playbackrate property works with both <audio> and <video>, but in both cases, it changes the playback
speed but not the pitch. to manipulate the audio's pitch you need to use the web audio api. see the audiobuffersourcenode.playbackrate property. html <video id="my-video" controls src="https://udn.realityripple.com/samples/6f/08625b424a.m4v...
Media events - Developer guides
so when recovering from being stalled, when looping media restarts, and after seeked, if it was playing before seeking. progress sent periodically to inform interested parties of progress downloading the media. information about the current amount of the media that has been downloaded is available in the media element's buffered attribute. ratechange sent when the playback
speed changes. seeked sent when a seek operation completes. seeking sent when a seek operation begins. stalled sent when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming. suspend sent when loading of the media is suspended; this may happen either because the download has completed or because it has been paused for any...
HTML5 - Developer guides
lowing you to communicate with the server in new and innovative ways. offline and storage: allowing webpages to store data on the client-side locally and operate offline more efficiently. multimedia: making video and audio first-class citizens in the open web. 2d/3d graphics and effects: allowing a much more diverse range of presentation options. performance and integration: providing greater
speed optimization and better usage of computer hardware. device access: allowing for the usage of various input and output devices. styling: letting authors write more sophisticated themes. semantics sections and outlines in html5 a look at the new outlining and sectioning elements in html5: <section>, <article>, <nav>, <header>, <footer> and <aside>. using html5 audio and video the <audio...
Index - Developer guides
video player article we described how to build a cross-browser html5 video player using the media and fullscreen apis. this follow-up article looks at how to style this custom player, including making it responsive. 14 web audio playbackrate explained apps, audio, media, video, playbackrate the playbackrate property of the <audio> and <video> elements allows us to change the
speed, or rate, at which a piece of web audio or video is playing 15 writing web audio api code that works in every browser api you probably have already read the announcement on the web audio api coming to firefox, and are totally excited and ready to make your until-now-webkit-only sites work with firefox, which uses the unprefixed version of the spec. 16 audio and vid...
Separate sites for mobile and desktop - Developer guides
good the first option is the most popular by far: use user-agent detection to route users on phones to a separate mobile site, typically at m.example.com. in a nutshell, this technique uses server-side logic to solve all three goals of mobile web development at once — if the user’s browser looks like it’s on a phone, you serve them mobile content, formatted for their phone and optimized for
speed. conceptually simple, this is the easiest option to add to an existing site, especially if you are using a cms or web application that supports templates. since only the mobile-specific content, styles, and scripts are sent to mobile users, this method also provides for the best performance out of any of the other options presented here. finally, it also allows for completely different user exper...
Optimization and performance - Developer guides
when building modern web apps and sites, it's important to make your content perform well. that is, to make it work quickly and efficiently. this lets it work effectively both for users of powerful desktop systems as well as for handheld devices with less power. there are several tools available to check the performance of a website or blog. the most notable tools are listed below. google page
speed insights lighthouse webpagetest browser developer tools the above resources also include web performance best practices. making web performance a priority by considering web performance throughout the development process is important in ensuring users get the best user experience possible. there are no subpages at this time. ...
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
roll. if no value is specified, the default value is −1, which means the marquee will scroll continuously. scrollamount sets the amount of scrolling at each interval in pixels. the default value is 6. scrolldelay sets the interval between each scroll movement in milliseconds. the default value is 85. note that any value smaller than 60 is ignored and the value 60 is used instead, unless true
speed is specified. true
speed by default, scrolldelay values lower than 60 are ignored. if true
speed is present, those values are not ignored. vspace sets the vertical margin in pixels or percentage value. width sets the width in pixels or percentage value. event handlers onbounce fires when the marquee has reached the end of its scroll position. it can only fire when the behavior attribute...
<picture>: The Picture element - HTML: Hypertext Markup Language
e none of the offered <source> elements are able to provide a usable image. common use cases for <picture>: art direction. cropping or modifying images for different media conditions (for example, loading a simpler version of an image which has too many details, on smaller displays). offering alternative image formats, for cases where certain formats are not supported. saving bandwidth and
speeding page load times by loading the most appropriate image for the viewer's display. if providing higher-density versions of an image for high-dpi (retina) display, use srcset on the <img> element instead. this lets browsers opt for lower-density versions in data-saving modes, and you don't have to write explicit media conditions. content categories flow content, phrasing content, em...
<var>: The Variable element - HTML: Hypertext Markup Language
tion: <var>x</var> = <var>y</var> + 2 </p> the output: overriding the default style using css, you can override the default style for the <var> element. in this example, variable names are rendered using bold courier if it's available, otherwise it falls back to the default monospace font. css var { font: bold 15px "courier", "courier new", monospace; } html <p>the variables <var>min
speed</var> and <var>max
speed</var> control the minimum and maximum
speed of the apparatus in revolutions per minute (rpm).</p> this html uses <var> to enclose the names of two variables. result specifications specification status comment html living standardthe definition of '<var>' in that specification. living standard html5the definition of '<...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
rces that will be used in the next navigation/page load (e.g. when you go to the next page). this is fine, but isn't useful for the current page! in addition, browsers will give prefetch resources a lower priority than preload ones — the current page is more important than the next. see link prefetching faq for more details. <link rel="prerender"> renders a specified webpage in the background,
speeding up its load if the user navigates to it. because of the potential to waste users bandwidth, chrome treats prerender as a nostate prefetch instead. <link rel="subresource"> was supported in chrome a while ago, and was intended to tackle the same issue as preload, but it had a problem: there was no way to work out a priority for the items (as didn't exist back then), so they all got fetched w...
HTTP conditional requests - HTTP
me resource and do the same on its copy. what happens next is very unfortunate: when they commit back to the server, the modifications from the first client are discarded by the next client push, as this second client is unaware of the first client's changes to the resource. the decision on who wins, is not communicated to the other party. which client's changes are to be kept, will vary with the
speed they commit; this depends on the performance of the clients, of the server, and even of the human editing the document at the client. the winner will change from one time to the next. this is a race condition and leads to problematic behaviors, which are difficult to detect and to debug: there is no way to deal with this problem without annoying one of the two clients. however, lost updates an...
Save-Data - HTTP
a value of on indicates explicit user opt-in into a reduced data usage mode on the client, and when communicated to origins allows them to deliver alternative content to reduce the data downloaded such as smaller image and video resources, different markup and styling, disabled polling and automatic updates, and so on. ...
HTTP Index - HTTP
g the user agent should wait before making a follow-up request. there are three main cases this header is used: 177 save-data http, http header, reference, request header, save-data, header the save-data header field is a boolean which, in requests, indicates the client's preference for reduced data usage. this could be for reasons such as high transfer costs, slow connection
speeds, etc. 178 sec-websocket-accept draft, http, needscompattable, needscontent, reference, sec-websocket-accept, websockets, header the sec-websocket-accept header is used in the websocket opening handshake. it would appear in the response headers. that is, this is header is sent from server to client to inform that server is willing to initiate a websocket connection. 17...
Protocol upgrade mechanism - HTTP
ult is the same as if you included all of the listed extensions in one such header. sec-websocket-extensions: extensions extensions a comma-separated list of extensions to request (or agree to support). these should be selected from the iana websocket extension name registry. extensions which take parameters do so by using semicolon delineation. for example: sec-websocket-extensions: super
speed, colormode; depth=16 sec-websocket-key provides information to the server which is needed in order to confirm that the client is entitled to request an upgrade to websocket. this header can be used when insecure (http) clients wish to upgrade, in order to offer some degree of protection against abuse. the value of the key is computed using an algorithm defined in the websocket specification, so...
Proxy servers and tunneling - HTTP
everse proxy acts in behalf of servers. forward proxies can hide the identities of clients whereas reverse proxies can hide the identities of servers. reverse proxies have several use cases, a few are: load balancing: distribute the load to several web servers, cache static content: offload the web servers by caching static content like pictures, compression: compress and optimize content to
speed up load time. forwarding client information through proxies proxies can make requests appear as if they originated from the proxy's ip address. this can be useful if a proxy is used to provide client anonymity, but in other cases information from the original request is lost. the ip address of the original client is often used for debugging, statistics, or generating location-dependent content...
408 Request Timeout - HTTP
t is sent on an idle connection by some servers, even without any previous request by the client. a server should send the "close" connection header field in the response, since 408 implies that the server has decided to close the connection rather than continue waiting. this response is used much more since some browsers, like chrome, firefox 27+, and ie9, use http pre-connection mechanisms to
speed up surfing. note: some servers merely shut down the connection without sending this message. status 408 request timeout specifications specification title rfc 7231, section 6.5.7: 408 request timeout hypertext transfer protocol (http/1.1): semantics and content ...
HTTP response status codes - HTTP
is similar to 401 but authentication is needed to be done by a proxy. 408 request timeout this response is sent on an idle connection by some servers, even without any previous request by the client. it means that the server would like to shut down this unused connection. this response is used much more since some browsers, like chrome, firefox 27+, or ie9, use http pre-connection mechanisms to
speed up surfing. also note that some servers merely shut down the connection without sending this message. 409 conflict this response is sent when a request conflicts with the current state of the server. 410 gone this response is sent when the requested content has been permanently deleted from server, with no forwarding address. clients are expected to remove their caches and links to the resour...
Closures - JavaScript
for instance, when creating a new object/class, methods should normally be associated to the object's prototype rather than defined into the object constructor. the reason is that whenever the constructor is called, the methods would get reassigned (that is, for every object creation). consider the following case: function myobject(name, message) { this.name = name.to...
Logical nullish assignment (??=) - JavaScript
ng so do not take effect (e.g., if expr is a function call, the calling never takes place). logical nullish assignment short-circuits as well meaning that x ??= y is equivalent to: x ?? (x = y); and not equivalent to the following which would always perform an assignment: x = x ?? y; examples using logical nullish assignment function config(options) { options.duration ??= 100; options.
speed ??= 25; return options; } config({ duration: 125 }); // { duration: 125,
speed: 25 } config({}); // { duration: 100,
speed: 25 } specifications specification logical assignment operatorsthe definition of 'assignment operators' in that specification. ...
Critical rendering path - Web Performance
w for both layout and re-paint times when measuring how long an animation frame may take. the styles applied to each node increase the paint time, but removing style that increases the paint by 0.001ms may not give you the biggest bang for your optimization buck. remember to measure first. then you can determine whether it should be an optimization priority. optimizing for crp improve page load
speed by prioritizing which resources get loaded, controlling the order in which they are loaded, and reducing the file sizes of 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) optimizi...