Support for scoped stylesheets and a new -moz-user-select:none implementation

Apr 5, 2013 14:11 GMT  ·  By

Firefox 21 beta doesn't bring too much to the table for regular users, but there's more under the hood. The CSS user-select selector now works similarly to how it works in WebKit, E4X support has been completely removed from SpiderMonkey, and add-on SDK and libraries are now built into the browser.

The user-select:none selector is useful when you want users to only be able to select a specific portion of the text, to prevent them from copying things they might not want such as images or layout elements.

However, Firefox and WebKit implemented it, since there's no standard spec governing it. Firefox made it impossible to select anything except the specified text, WebKit allowed users to select any text if they selected the element that included it.

Firefox's implementation, -moz-user-select:none is now more in line with -webkit-user-select:none.

There's now support for the HTML5 <main> element and scoped stylesheets. Scoped stylesheets make it possible to apply CSS to just a portion of a page.

This is part of a larger set of features designed to make it possible to create "portable" widgets, pieces of HTML, CSS and JavaScript code that are self-sustained and can be embedded in other pages without affecting them.

Firefox 21 beta removes support or E4X, an obsolete XML for JavaScript (ECMAScript) implementation. Firefox 17 had removed support for it in the content, Firefox 20 removed support for it in the chrome (UI) and Firefox 21 gets rid of the code entirely.

The Add-on SDK loader and libraries are now included in Firefox. Previously, this code had to be included into any extension built with the Add-on SDK.

This meant that it had to be updated each time a new SDK version was released. This way, the APIs will always be at their latest version, lifting some of the burden from add-on developers.