Thursday, August 21st, 2008
Category: Browsers
, CSS
![[image]](http://mowser.com/img?url=http%3A%2F%2Fejohn.org%2Ffiles%2Fqsa-blog.png)
We have all been talking about querySelectAll for awhile, but John Resig gives us a wrap-up that covers the state of play.
He talks about the browsers, and the libraries that wrap them and clean up shop via code like:
JAVASCRIPT:
function querySelectorAll(selector){
try {
return Array.prototype.slice.call(
document.querySelectorAll( selector ) );
} catch(e){}
return myOtherLibrary( selector );
}
Less code. More speed.
Wednesday, August 13th, 2008
Category: Browsers
, CSS
Remember when you wanted a growable area with rounded-goodness and you had to cut up the image into a million pieces to have the top corners and the sides? Since then we have gotten nice effects to help us, and John Resig just posted on how Firefox 3.1 will implement what WebKit already has in the border-image CSS 3 magic:
Now you can create the iPhone search button that iUI contains, using the simple CSS:
CSS:
border-width: 0 5 0 5;
-webkit-border-image: url(toolButton.png) 0 5 0 5 stretch stretch;
-moz-border-image: url(toolButton.png) 0 5 0 5 stretch stretch;
Here you see the reusable button on the left, that will stretch and become the button on the right:

Next up, rounding the borders themselves in all browsers (border-radius!)
Tuesday, August 5th, 2008
Category: Browsers
, Firefox
The video above is a "concept" called Aurora, created by Jesse James Garrett of Adaptive Path. Give it a play and you will see his vision for a very visual immersive, space-age-like environment that is very social.
There are a couple of others too, such as Wei Zhou's bookmarking concept and Aza Raskin's mobile phone concept that we have discussed in the past.
This isn't about these concepts though. The Mozila Labs folks have a call for participation:
Today we’re calling on industry, higher education and people from around the world to get involved and share their ideas and expertise as we collectively explore and design future directions for the Web.
You don’t have to be a software engineer to get involved, and you don’t have to program. Everyone is welcome to participate. We’re particularly interested in engaging with designers who have not typically been involved with open source projects. And we’re biasing towards broad participation, not finished implementations.
We’re hoping to lower the barrier to participation by providing a forum for surfacing, sharing, and collaborating on new ideas and concepts. Our goal is to bring even more people to the table and provoke thought, facilitate discussion, and inspire future design directions for Firefox, the Mozilla project, and the Web as a whole.
Time to get creative and put on your inventor hat. Maybe your idea can get into Firefox?
Monday, August 4th, 2008
Category: Browsers
Flash can get to “ubiquitous†across the entire web with new capabilities in roughly 18 months and the Open Web faces a best case replacement time-frame of 5 years.
Reducing that differential from 42 months to zero is now the defining challenge of the Open Web. HTML is back in the hunt. Time to see how fast we can teach it remember the new tricks we’re so eager to teach.
This is a key comment in Alex's perspective where he discusses his analysis on the browser market, and how it is changing... or isn't changing.
It can be a little depressing, but if you are optimistic like Alex, we can work to make life better. How can we help?
Thursday, July 31st, 2008
Category: Browsers
, IE
The first main play for IE 8 was to get developers on board, and start a conversation with us on what they are fixing, and where they are going.
There were a couple of user features such as Activities and Web Slices, but you could tell they hadn't finished there.
In their latest blog post they talk about reliability and the fact that they now have isolation between web pages and the chrome itself via processes. This means that a page could die, but the browser is fine:
One of our most significant investments is in a feature called Loosely-Coupled IE (“LCIEâ€), which is an architectural attribute that helps isolate different parts of the browser from each other, most notably, the frames from the tabs. LCIE is the foundation that we have built a few of our features on including Automatic Crash Recovery of which I expand on below.
For Beta 2, we added the following changes:
Frame Process Merging
To help improve startup performance, we have reduced the number of processes that we start. Instead of firing up two processes every time you launch the browser (one for the frame and one for your tabs), we now only fire up one frame process the first time you launch IE. Subsequent launches will only start a new tab process or make a new tab in an existing tab process.
For users that are accustomed to browsing websites in multiple “sessionsâ€, for example if you want to log in to multiple email sites simultaneously, you can specify the “-nomerge†command line option to disable this feature.
More tab processes
It turns out that the vast majority of all IE sessions contain three or fewer tabs. Accordingly, in Beta 2 we try to give users three efficient tab processes. This is contingent on the user’s computer capabilities, but the more capable a computer is, the more processes we will use, up to a point. Adding more processes gives users much better isolation in the event of a failure. If each tab is in its own process, websites are completely isolated from each other.
Virtual tabs
We have also added the internal capability to “hot swap†the process from underneath a tab. Previously, Protected Mode worked on a per-process basis. For example, say you add a website to your trusted sites in IE7. If that site links to another site that is not in your trusted sites, it will cause you to switch browser windows when you click the link.
We improved this in IE8 Beta 1 with LCIE when we split the frame from the tabs. With the split we can create a new tab in the same window and switch you to that tab as opposed to being “punted†to a new window.
Virtual tabs lets you navigate across Protected Mode in the same tab since we just switch the process under the tab to the correct integrity level. This is really just “UI-sugar†– virtual tabs do not impact security or protected mode in any way, other than to make it more convenient to transition between protected mode on/off.
LCIE's capability of isolating different parts of the browser coupled with more tab processes and virtual tabs will improve the performance and overall reliability of Internet Explorer.
I saw an early IE 8 beta 2, and there are other very interesting features in there too. Some were subtle but interesting. We should get our hands on it soon!
Category: Browsers
, Canvas
Vladimir Vuki?evi? normally hacks on Mozilla products, but spent a little time on an experiment with IE. An experiment that looks very exciting indeed.
I love canvas, and wish that it was ubiquitous. We have great wrappers out there such as dojo.gfx, but wouldn't it be nice if canvas worked everywhere? (and the full API to boot).
Well, Vladimir has an experiment to get it to IE. The approach is very interesting indeed. It isn't like excanvas which uses VML... and there is a Silverlight bridge being worked on that looks promising. Instead, we have this:
I've been working on a native Canvas implementation for IE based on the same rendering core that's in Firefox.
The same implementation, shoe horned into IE:
With an object tag, a bit of CSS, and (to work around another IE bug) a single line of script, <canvas> elements in HTML just work. I'm excited that this experiment is working out, because lack of Canvas support in IE is one of the reasons people skip Canvas and instead turn to Flash and other plugin technologies.
</canvas>

Congrats on a great hack, and here's to you making it much much more.
Tuesday, July 29th, 2008
Category: Browsers

Nick Stakenburg is beating the drum of getting users to upgrade their browsers, and has created PushUpTheWeb.com.
Pushup is an effort to push the web forward by helping users update their outdated browsers. Give your users a better web experience today by installing Pushup on your domain!
By putting the script up, users will have their browser checked out, and if there is a new version it will let them know in the right hand top corner.
You can configure it to use reminders, and style it how you wish. Friends don't let friends run old browsers!
Monday, July 28th, 2008
Category: Browsers
, JavaScript
, Performance
Gregory Reimer, frontend engineer for sun.com, has written a barrage of tests to answer the question What's the Fastest Way to Code a Loop in JavaScript? specifically for large data sets:
I built a loop benchmarking test suite for different ways of coding loops in JavaScript. There are a few of these out there already, but I didn't find any that acknowledged the difference between native arrays and HTML collections. Since the underlying implementations are different (HTML collections for example lack the pop() and slice() methods, etc), benchmarks that don't test against both are probably missing important information.
My suspicions were confirmed. Accessing the length property is more expensive on HTML collections than on arrays, depending on the browser. In those cases, caching it made a huge difference. However, HTML collections are live, so a cached value may fail if the underlying DOM is modified during looping. On the other hand, HTML collections will never be sparse, so the best way to loop an HTML collection might just be to ignore the length property altogether and combine the test with the item lookup, since you have to do that anyway:
JAVASCRIPT:
// looping a dom html collection
for (var i=0, node; node = hColl[i++];) {
// do something with node
}
If you take a look at the results you will see that in general, reverse while loops are the fastest way to iterate a basic collection, e.g.:
JAVASCRIPT:
var i = arr.length; while (i--) {}
Take a peak at the test suite.
Tuesday, July 22nd, 2008
Category: Browsers
, Design
What's the greater of these evils: contorting site designs around the standard Web-safe fonts, using images to render type, or relying on sIFR to render type with Flash?
Who knows, but man, it sure would be nice if we could reliably use any font we wanted in our web work. And, as it turns out, IE4+ and Safari 3.1 offer mechanisms for doing just that.
Safari's shiny new mechanism is based on the CSS3 @font-face "at-rule", exemplified thusly in the spec:
CSS:
@font-face {
font-family: "Robson Celtic";
src: url("http://site/fonts/rob-celt")
}
H1 { font-family: "Robson Celtic", serif }
The linked font can be a regular old TrueType font. Compare this to IE6/7 which also support the @font-face at-rule but only support special "Embedded OpenType" fonts.
At first blush, you and I might think, "Yay for Safari! And, thanks IE for yet another screw." But that was before we considered the DRM issues. You see, there's an established technology for enforcing the use of fonts in embedded applications, and CSS's @font-face bypasses it by directly linking to TrueType fonts. At least one major font foundry is mighty uncomfortable with the thought of more browsers following Safari's lead.
Hence fontembedding.com, a newly-launched site promoting the virtues of the long-misunderstood and under-loved Embedded OpenType (EOT) format and the evils of linking to TrueType on the Web, complete with a call to action to other browsers to support EOT once the recent W3C EOT submission is ratified (i.e., maybe we can expect to use them cross-browser in 2014). EOT, you see, embeds the URL of the website that licensed the font for embedded use so that User-Agents can enforce font licensing restrictions.
Fascinating.
I wish them luck with EOT; in the meantime I suspect Firefox will implement @font-face and enough high-quality freely embeddable TrueType fonts will emerge to ensure that EOT remains as irrelevant as it ever was.
But then, I've been wrong before.
Still, fun to realize that as soon as Firefox implements @font-face, thanks to TrueType-EOT converters, we can finally use fonts on the web. Myspace will never be the same.
Wednesday, July 9th, 2008
Category: Browsers
, IE
Tavs Dokkedahl sent in a great email about work that he and Allan Jacobs have done on bringing DOM event implementations to IE. Here it is in full:
About a year ago or so I put out the Uniform Event Model (UEM) script which
was an implementation of the W3C DOM 2 Event Interface for IE. As it turned
out that release was very premature - the script was simply incomplete and
definitely not ready for production use.
The design ideas however were good enough. Since then Allan Jacobs has
joined the JSLab team and together we have written a new version of UEM
which is much more stable and modular.
This first release includes support for:
DOM 2 Event Interface in IE DOM 2 UIEvent Interface in IE DOM 2 MouseEvent Interface in IE DOM 2 Legacy keyboard handling in IE (fancy way of saying "handle it like
Firefox")
The code is unobtrusive - no special syntax or semantics are needed. A lot
of documentation is available
There still exists issues with some types of events but at large the code is
stable and is performing well enough to be released to the public. Hopefully
we can get some feedback on how to improve it and catch some early errors.
The size of the script is about 32Kb (when minified) it its basic form but
additional modules are available for inclusion. The download page can be
found at http://www.jslab.dk/jdc.download.php
We are currently working on finishing the DOM 3 KeyboardEvent and DOM 3
textInput interfaces (for IE, Firefox, Opera and Safari) besides various DOM
corrections for other browsers than IE.
Thursday, June 26th, 2008
Category: Browsers
Sam Allen has done something that I was actually going to try to do... use browsers for a period and try to measure what happens to performance and such over that time period. Real usage. Normal usage.
Sam created browser memory profiles from his work and then concluded:
These profiles are meant to provide a picture of what the memory behavior of popular browsers is over a period of time, not to provide absolute benchmark times. Firefox 3.0 shows memory usage that is significantly lower than Firefox 2, which also does very well. Here is a summary of my results.
Safari 3.1
Safari on Windows shows extremely poor memory management, and I do not know whether
it ever reaches a high water mark. If this is by design, it is certainly a design
that looks inefficient and seems to contradict Apple's marketing. Firefox 3.0
This browser exhibits memory usage that is by far lower than the others. It releases
memory to the system and the trend line is nearly flat.
(This is likely due to the
efforts outlined here.) Flock (based on Firefox 2.0)
Flock did very well and this browser and Firefox 2.0 could likely be run for long
periods without causing many problems. The extensions probably reduced the efficiency
somewhat.
Opera 9.5
Opera's performance was about as good as Firefox 2.0 (Flock), and it could likely
be used for very lengthy sessions. However, Kestrel is certainly not a revolutionary
or even notable technology in this arena. Internet Explorer 8 Beta 1
IE did well in the profile, although a worrying trend in the data could indicate
that it would keep escalating. However, this browser could likely sustain many hours
of moderate usage.

Monday, June 23rd, 2008
Category: Browsers

Todd Ditchendorf keeps on pushing with Fluid, the Single Site Browser system that does so much more by giving you rich integration points. Ben and I demonstrated how we use Campfire as a Fluid application that ties us into Growl and more.
The latest version includes the following new features:
Single Window Browsing Mode (General Preferences). Actually this is more correctly called “TargetedLinksCreateTabs†and means that any website which attempts to spawn a new browser window will create a new tab in the current window instead. The user may still create new windows with cmd-N.
True Full Screen Browsing Mode. cmd-opt-F. (Window menu -> Toggle Full Screen Mode)
Change to Embedded SSBs. Now they can be made to obey your “Spaces Behavior†preference (appear in all or not). This is cool cuz you can set a different Embedded SSB in each Space for a different background in each. Unfortunately, this means that by default Embedded SSBs don’t work with Expose quite the way I have demonstrated. However, you can reclaim that Expose behavior by changing the Spaces Behavior setting to “Windows Appear in All Spacesâ€Â
Thumbnail Plug-in: Significantly improved load time/UI response time performance, when refreshing the current page to reload the thumbnails, the selected index is preserved, and adding built-in URL Pattern for Microsoft’s live.com search engine.
Also, I noticed a screencast that Todd did, showing TinyURL integration that gives you a context-menu to do what I just did with Endpoint, it resolves the URL for you. Very nice indeed. I was going to do a bookmarklet for it myself.
Friday, June 13th, 2008
Category: Browsers
, Firefox
, Mobile
It has been a busy week for Mozilla. We have seen news across the board of their technology.
First we have the news that Firefox 3 should be available to download on June 17th. They are having a download party to kick things off.
Stuart Parmenter had a proxy post that delves into the world of fonts and text:
When Mozilla developers decided to incorporate the Cairo subsystem and build a new graphics layer from scratch, they also decided to completely rework the system that renders text in the browser.
Text is an incredibly important part of the Web. While graphics, audio, and video are increasingly common, we still spend the majority of our time on the Web just reading stuff. All the words you read in a web browser are rendered using a font which contains a set of glyphs used to form individual letters. For more simple written languages there may be a straightforward one-to-one mapping of characters to glyphs, but for more complex languages, one glyph may represent multiple characters.
Ben is a huge fan (a.k.a. anal) of this type of thing. Fonts and rendering can make a big difference, and the post goes into detail on what is going on in the new Firefox 3 engine. It discusses kerning, ligatures, hinting, font smoothing, anti-aliasing, and more. After reading this post you may want to watch Helvetica the movie!
Then we go to the mobile side, where Aza Raskin has posted concept video on the new touch screen interface that they will be building for Fennec. There is a ton of detail in Aza's writeup including design principles:
Touch. This concept prototype for Firefox mobile (code name Fennec) is being designed for a touch screen. Why not multitouch? Because Firefox should be able to run on the least common denominator of touch devices. Especially for touch-enabled interfaces direct manipulation is key. Along that line of thought, the interface should be operable with a finger. Switching between input methods is time-consuming and annoying, so the user shouldn’t have to switch to a stylus or other secondary form of input. Firefox will work on non-touchscreen devices, but that’s out of scope for this demo.
Large targets are good. The same fingertip that controls the interface takes up between 1/5th to 1/10th of the vertical/horizontal height/width of the mobile touch-screen. In other words, fingers are fat: hitting small targets is like trying to touch-type with your elbow. All actions should be represented by targets that are large enough to be fast, easy, and (at the very least) not aggravating to hit.
Visual Momentum and Physics are compelling. Nothing shouts “sexy!†like pretty animations and a physics engine. Beyond marketing appeal, there is a strong argument that such physicality helps the user build a mental model of the interface, and that interface physics yields consistency. We are wired to track the movement of things and to be able to remember where they’ve gone, as long as they don’t appear and disappear, which doesn’t happen in the real world. Of course, copying every physical metaphors blindly gets you interfaces like the multi-million dollar blunder that was Microsoft Bob, so we need to select our metaphors carefully.
Typing is difficult. This means we want to minimize the amount of keystrokes required to get anywhere or do anything.
Content is king. With restricted screen size, every pixel counts. As much of the screen as possible should always be dedicated to content, not controls or cruft.
Then we move to the server side with a Weave status update that should be shipping with Firefox 3. It includes new features around data types, bookmark sharing, and a Web client view. Check out the Wiki for more details.
Wednesday, June 4th, 2008
Category: Browsers
, IE
Bill Gates gave his last talk, appropriately, to developers at TechEd. No matter what you think of the guy, he is an icon that helped create the software industry. Without him and Steve Jobs, who do we have? :)
In his speach he talked about Internet Explorer, and how IE 8 will have an update in a couple of months:
Gates also highlighted Microsoft's flagship Web technology, the Internet Explorer (IE) browser, which has been an asset and a curse for the company over the years. While it allowed Microsoft to secure its dominant position in Web-browsing technology, it also triggered Microsoft's U.S. antitrust woes, something that haunts the company to this day. IE also has taken a hit in the past several years as Mozilla Firefox, an open-source browser, has gained a loyal following, forcing Microsoft to step up development and make its own product more innovative.
Gates revealed that beta 2 of the next version of IE, IE 8, will be available in August. He also stumped for what has been his pet interest during his years at Microsoft -- natural human-interface technology that allows people to interact with computers in ways similar to how they interact with each other. Last week, Microsoft revealed that the next version of Windows, Windows 7, will include touchscreen technology, a fact he mentioned in his talked.
I have a funny feeling that we are going to see some really cool things to come out of IE 8. A few surprises.
Friday, May 23rd, 2008
Category: Browsers
, Firefox
Kevin Yank has zoomed into the features in the new Firefox 3 RC 1, and explained two subtle ones that can help us as Web developers:
Soft Hyphens
Tucked away in the list of CSS improvements in Firefox 3 is this innocuous-looking feature: “HTML soft hyphens () are now supported.â€Â
Soft hyphens are one of those obscure gems that HTML has always supported on paper, but that no one has taken any notice of because browser support has been spotty. With the imminent release of Firefox 3, however, soft hyphens will be supported by all major browsers including Internet Explorer, Safari, and Opera.
So, what is a soft hyphen, anyway?
A soft hyphen is a character of text that is usually invisible. It signals a spot in the text (usually in the middle of a long word) where it would be acceptable to break the line with a hyphen.
Here you see it at work:

Inline Blocks
Another obscure-but-useful new feature making its way into Firefox 3 after all the other major browsers support it (mostly) is the inline block. When assigned to an element, a display type of inline-block causes the element to be positioned inline (like a span), but the element’s contents are laid out as if the element were a block.
This feature will come in handy in a number of situations in which the float property is currently being used for lack of a better option.
HTML:
<div class="caption">A short caption</div>
<div class="thumb"><img src="thumb1.jpg"/></div>
<div class="caption">A short caption</div>
<div class="thumb"><img src="thumb2.jpg"/></div>
…
</li></ul>
The code above gives you:
![[image]](http://mowser.com/img?url=http%3A%2F%2Fsitepointstatic.com%2Fblogs%2Fwp-content%2Fuploads%2F2008%2F05%2Fcssgallery-inlineblock-bottom.png)
See it in action.
Tuesday, May 20th, 2008
Category: Browsers

Nicholas C. Zakas was doing some prep work for his new book when he delved into browser cookie restrictions for the big four browsers:
The most interesting fact I discovered is that Safari places no limit
on the number of cookies that can be set per domain. In fact, you can
set enough cookies on the client to cause a server error as the cookie
header can be too long to parse.
He also found out that:
Microsoft indicated that Internet Explorer 8 increased the cookie limit per domain to 50 cookies but I've found that IE7 also allows 50 cookies per domain. Granted, this may have been increased with a system patch rather than having the browser's first version ship like this, but it's still more than the 20 that was commonly understood to be the limit. Firefox has a per-domain cookie limit of 50 cookies. Opera has a per-domain cookie limit of 30 cookies. Safari/WebKit is the most interesting of all as it appears to have no perceivable limit through Safari 3.1. I tested setting up to 10,000 cookies and all of them were set and sent along in the Cookie header. The problem is that the header size exceeded the limit that the server could process, so an error occurred.
So the prevailing knowledge that browsers limit per-domain cookies to 20 is no longer valid. Another interesting inconsistency is how browsers react when too many cookies are set. With the exception of Safari, which sets all cookies regardless of the number, there are two approaches:
The least recently used (LRU) approach automatically kicks out the oldest cookie when the cookie limit has been reached in order to allow the newest cookie some space. Internet Explorer and Opera use this approach. Firefox does something strange: it seems to randomly decide which cookies to keep although the last cookie set is always kept. There doesn't seem to be any scheme it's following at all. The takeaway? Don't go above the cookie limit in Firefox.
The total size of cookies also varies from browser to browser. This is another one that is a little hard to comprehend, but here's what my tests show:
Firefox and Safari allow cookies with up to 4097 characters, that's 4096 for the name and value and one for the equals sign. Opera allows cookies with up to 4096 characters, which is for the name, value, and equals sign. Internet Explorer allows cookies with up to 4095 characters, which is for the name, value and, equals sign.
Next Page »