1. Firefox 3.6 Alpha 1 – web developer changes

    As covered on the Mozilla Developer Center, Firefox 3.6 Alpha 1 is now available for download. And we’ve been busy since Firefox 3.5.

    Web developers will be interested in a number of features that are new in Firefox 3.6 Alpha 1:

    • The TraceMonkey JavaScript engine has continued to get faster.
    • We’ve made a huge number of improvements to overall DOM and element layout performance. In some cases we’re much, much faster. We’ll cover details on those in a later post.
    • The compositor landing has made it possible to fix a large number of interactions between web content, CSS and plugins. We’ll be talking about this in a later post as well.
    • We now support the -moz-background-size CSS property which lets you set the size of background images.
    • We now support CSS Gradients.
    • We now support multiple background images.
    • We now support the rem unit as a CSS unit.
    • image-rendering is supported for images, background images, videos and canvases.
    • We now send a reorder event to embedded frames and iframes when their document is loaded.
    • We’ve removed the getBoxObjectFor() method. It was non-standard and exposed all kinds of non-standard stuff to the web.
    • We now send a hashchange event to a page whenever the URI part after the # changes.
    • We now have Geolocation address support for user-readable position information.
    • We now support the complete attribute on document.readystate.

    You can keep track of this list and other features for XUL and add-ons developers on the Firefox 3.6 for developers page on developer.mozilla.org

    Unlike the year that passed between Firefox 3 and Firefox 3.5, we expect that this 3.6 release will be released in a small number of months. Our main focus for the 3.6 release will be end-user perceived performance, TraceMonkey and DOM performance and new web developer features.

    Enjoy and test away!

  2. bringing multi-touch to Firefox and the web

    The ever-energetic Felipe Gomes was nice enough to intern with Mozilla this summer in between busy semesters in Brazil. During that time he’s been working on multi-touch support for Firefox on Windows 7. A nice result of that work is that he’s also found ways to bring multi-touch support to the web. He’s made a short video and written up some short technical information to go with it.

    This post has also been cross-posted to Felipe’s personal blog.

    Multitouch on Firefox from Felipe on Vimeo.

    I’ve been anxious to demonstrate the progress on our multi-touch support for Firefox, and this video showcases some possible interactions and use cases for what web pages and webapps can do with a multi-touch device.

    We’re working on exposing the multi-touch data from the system to regular web pages through DOM Events, and all of these demos are built on top of that. They are simple HTML pages that receive events for each touch point and use them to build a custom multi-touch experience.

    We’re also adding CSS support to detect when you’re running on an touchscreen device. Using the pseudo-selector :-moz-system-metric(touch-enabled) you can apply specific styles for your page if it’s being viewed on a touchscreen device. That, along with physical CSS units (cm or in), makes it possible to adjust your webapp for a touchscreen experience.

    Firefox 3.6 will include the CSS property, but is unlikely to include the DOM events described below.

    Here is an example of what the API looks like for now. We have three new DOM events (MozTouchDown, MozTouchMove and MozTouchRelease), which are similar to mouse events, except that they have a new attribute called streamId that can uniquely identify the same finger being tracked in a series of MozTouch events. The following snippet is the code for the first demo where we move independent <div>s under the X/Y position of each touch point.

    var assignedFingers = {};
    var lastused = 0;
     
    function touchMove(event) {
        var divId;
        if (lastused < = 4)
            return;
     
        if (assignedFingers[event.streamId]) {
            divId = assignedFingers[event.streamId];
        }
        else {
            divId = "trackingdiv" + (++lastused);
            assignedFingers[event.streamId] = divId;
        }
     
        document.getElementById(divId).style.left = event.clientX + 'px';
        document.getElementById(divId).style.top  = event.clientY + 'px';
    }
     
    document.addEventListener("MozTouchMove", touchMove, false);
    document.addEventListener("MozTouchRelease",
                              function () { lastused--; }, false);

    On the wiki page you can see code snippets for the other demos. Leave any comments regarding the demos or the API on my weblog post. We really welcome feedback and hope to start some good discussion on this area. Hopefully as touch devices (mobile and notebooks) are getting more and more popular we’ll see new and creative ways to use touch and multitouch on the web.

  3. experimenting with HTML5 video at the BBC

    The BBC has a post up describing an experiment that they have put together that uses HTML5 video that works in Firefox 3.5 and Safari.

    BBC HTML5 Video Experiment

    The demo uses jQuery and drives a simple carousel that shows the current chapter as the video plays. It also shows subtitles as the video plays.

    One really great, and somewhat subtle thing about this experiment? You can select the subtitles. They are just text.

  4. a 20 second survey to help improve hacks.mozilla.org

    I asked this on the mozhacks twitter account earlier today but I’d like to get more feedback:

    what’s your single favorite thing about hacks.mozilla.org?

    The survey is totally anonymous and takes 20 seconds or so. It’s limited, much like twitter, to a very short response. If you have ideas on improvement there’s room for that as well so please, respond away! If we get enough good feedback we’ll post results here as well.

    Thanks!