Internet Explorer
New Internet Explorer Testing VHDs Are Available
13After a little delay, the Internet Explorer App Compat Testing VHDs are now available for download on the Microsoft Download Center. Like the previous set of images, these ones are time-bombed for 90 days and will expire on January 11th, 2011.
Live we’ve done in the past, there are five different images that we’ve made available…
- Internet Explorer 6 on Windows XP SP3
- Internet Explorer 7 on Windows XP SP3
- Internet Explorer 8 on Windows XP SP3
- Internet Explorer 7 on Windows Vista SP1
- Internet Explorer 8 on Windows Vista SP1
These images are a bit different then the previous ones we last released in June, the default user account is an admin on the machine, and you have to use a password to log on to the VHD. The password and other important information is in the readme.txt file – so be sure to check that out.
As you test your sites, remember that with Internet Explorer 8 and Internet Explorer 9, you can switch the rendering mode with the F12 Developer Tools and get an almost perfect replication of IE9, IE8 or even IE7. That way, you can save using the VHDs for when there may be an issue with something like Protected Mode, or you need to test IE6.
Internet Explorer App Compat VPC Update
6A bunch of folks have asked about the status of the Internet Explorer App Compat VHDs (VPCs) as the current set have expired and we haven’t published new ones yet. First off, I want to let folks know that we are still committed to them and we haven’t abandoned them! We’ve just run into a few hiccups that weren’t quite what I expected this time around.
At the beginning of this fiscal year, we changed the process that we use to create the VHDs. First, we brought the work in house and are building them internally instead of using a vendor to do it. Second, we found out a little too late that the old system we used for time-bombing had been retired and spent some time working to figure out if there was a replacement program in place or how we could continue to support the Windows XP VHDs. Thankfully we were able to figure out a new process, but with any new process, there are always some hiccups. And this time, there were more hiccups than I had expected.
The big change between these images is that this Windows XP SP3 installation is a “trial sku” instead of the “full package product” (FPP). That means that we don’t have to use the complex time-bombing process any more – though because it’s a trial sku, they do still expire after 90 days. I haven’t tried these VHDs on other VPC hosts, so I can’t speak to if they’ll run without activation.
I finished the last few steps for creating the VHDs late last night, and am working through the release process now. One good thing about moving them in house, I managed to get the download size way down again, and they’re running between 494meg and 583meg! Hopefully the smaller size will be good news for those of you who don’t have super fat interweb pipes.
Hopefully they’ll be up tonight (Pacific time) or sometime early tomorrow. I’ll either update this post, or post a tweet via Twitter when they’re up!
PS: I’m also working with @reybango to get a VHD or other system in place so that those of you not running Windows Vista or Windows 7 can try Internet Explorer 9. Sadly when IE9 runs in a VPC host, you don’t get hardware acceleration, but it’s still an opportunity to try or test your site if you’re not running a supported OS.
Internet Explorer Develop Tools: CSS
2In continuing my series about the IE Dev Tools that come build in to Internet Explorer – today I’ll take a look at the CSS Tab and how you can use it to add, edit, change, or remove CSS rules and dive deeper in to the CSS on your page, where styles are coming from and such.
The CSS Tab
The CSS tab shows the all of the CSS files that your page includes via embedded, linked style sheets, or imported style sheets. Like all of the other tabs, it includes the standard menu bar, the ability to change rendering and browser mode, and the standard buttons Select Element By Click
, Clear Browser Cache
and Save buttons
. Beside the standard buttons is a drop down list that allows you to choose which set of styles you want to look at. It includes all of the styles that Internet Explorer loads for that page, including iFrames.
If you have multiple embedded style blocks, each block will be listed separately within the drop down list. iFrame styles are denoted by the square brackets around the name of the [] stylesheet, for example [iframeSource.htm] stylesheet.css. As you change the drop down, the contents of the CSS display box will show all the rules, along with their individual attributes.
Using the CSS Tools
Like the HTML tab, you can turn on and off rules, or the individual attributes as well as add, remove or edit all of their values and see the changes in real time.
Getting Started
- If you’re in Internet Explorer now, hit F12, if you aren’t switch over to IE8 and load a site that has a bunch of CSS and HTML on it then hit F12 (pretty much page). See if you can find a site that has at least one iFrame on it so you can see how iFrames look as well.
- Switch over to the CSS tab to see all of the CSS files that are loaded on the page you’re viewing.
You’ll now see a list of all the rules that are defined within the selected style.
Turning Rules or Attributes On and Off
The easiest way to turn off style rules or individual attributes within those is to use the checkbox beside each node. Unchecking the rule turns off all of the attributes for that rule, or you can simply choose to turn off the specific attributes.
Changing Existing Rules or Attributes
To change an existing rule, you can do the same thing as in the HTML tab, simply click on the item you want to edit and Internet Explorer will change that item into edit mode. You can change the rule names, attribute names and the attribute values. After you’ve made your change, hit enter and IE will apply the changes to your page.
Adding or Removing Rules or Attributes
This is one of the cooler features of the CSS tab that I often forget about because surfacing it isn’t super obvious. If you right click on a rule or attribute, a content menu appears that allows you to add or delete attributes and rules. You can choose where you want them to fit within the cascade via the Add Rule Before or All Rule After.
When adding an attribute, you do it pretty much exactly like you would type it in a style sheet or style block. When I click Add Attribute, the dev tools, creates a new node for me in the tree view, and I type the style I want to add, followed by a colon, then IE pops me over to a new text box where I can type the value for that style followed by a semi-colon. Once I hit enter, IE will update the page with my changes.
Adding a new rule is similar, in that you click Add Rule After (or Before), and it creates a new node in the tree in the appropriate place. Then using the same Add Attribute right click, you add the appropriate attributes to that node.
CSS Editing with Internet Explorer Developer Tools
There you go – hopefully this will make your editing and debugging of CSS a little easier! Stay tuned for posts on debugging and profiling your JavaScript code!
A Quick Intro: Canvas in IE9
1Yesterday, with the release of Internet Explorer 9 Platform Preview 3, the engineering team announced support for hardware accelerated <canvas>! The <canvas> element is a part of the HTML5 Standards specification and allows for dynamic scriptable rendering of 2D graphics. To use it, you put a simple <canvas> element in your HTML, which defines the drawing area, then through JavaScript, you can get the 2d context and begin dynamically drawing within that region.
Much like SVG, you can draw on the page using basic shapes, but you can also easily include rasterized images, videos and other objects. But unlike SVG, when you draw on the page, the browser doesn’t remember any of the “drawings”. With SVG, the “drawings” just become elements in the DOM and you can script them, change them, basically treat them like any other element. Canvas on the other hand, doesn’t remember the state of the “drawings” so you can’t change them as easily.
Quick Code Sample
<canvas id="myCanvas" width="200" height="200"
style="border: 1px solid black;">
Your browser doesn’t support Canvas, sorry.
</canvas>
var canvasElement = document.getElementById("myCanvas");
if (canvasElement.getContext) {
// The Context exists, so we know we have a canvas element
// we can work with.
var context = canvasElement.getContext("2d");
context.fillStyle = "rgb(255,0,0)";
context.fillRect(30, 30, 50, 50);
}
else {
// There is no Context, so we can't do anything.
// Put fall back code here.
}
Results in…
The More Exciting Stuff…
Okay, so I can draw a little red box on a page, woop-de-doo right! This is when I recommend you check out the IETestDrive.com website where the truly cool demos are. Be sure when you’re looking at these demos that you take a minute to look at the source code as well – it’s pretty interesting to see how few lines of HTML are required, and in many cases how few lines of JavaScript as well!
- Amazon Shelf – A visualization of Amazon’s top books and a way to read a bit more into them
- FishIE Tank – Remember the Windows 7 beta fish, he’s back!
- Mr. Potato Gun – Mr. Potato plus what looks like an air canon is never good for Mr. Potato!
- Asteroid Belt – be sure to look at the HTML for this one, there really isn’t any!
- DeemZoom – this is truly making web apps native!
- Canvas Pad – An interactive canvas drawing app
Enjoy!
PEte
How To: Put HTML5 <video> On A Page
7This week has been kind of fun, we’ve been getting ready for the release of IE9 Platform Preview 3, and around 2pm PST today – it was released! The reception has been awesome so far! This is the build that supports <video>, <audio> and uber cool – <canvas>!
I’m going to save <canvas> for another post but wanted to get a post out tonight about some quick ways to try out the <video> tag and ways to encode H.264 video.
Putting <video> on your page is EASY!
<video poster="http://www2.petelepage.com/videos/poster.jpg" src="http://www2.petelepage.com/videos/skydive.mp4" preload="none" controls style="border-radius: 10px; border: 5px solid black;">
<div style="margin:5px;padding:5px;border:1px solid black;">
<h2>Sad Panda: HTML5 Video Not Supported</h2>
<p>This browser doesn't support HTML5 video with the H.264 video codec, so instead, you get the generic fall back.</p>
<p>You could install the <a href="http://ietestdrive.com">IE9 Platform Preview</a></p>
<p>In reality, you should probably put a Flash or Silverlight fall back here, 'cause not everyone will install a new browser just to see my/your video!</p>
</div>
</video>
Results In…
Sad Panda: HTML5 Video Not Supported
This browser doesn’t support HTML5 video with the H.264 video codec, so instead, you get the generic fall back.
You could install the IE9 Platform Preview
In reality, you should probably put a Flash or Silverlight fall back here, ’cause not everyone will install a new browser just to see my/your video!
The video above was shot while I was in Australia earlier this year, a bunch of my friends and I went sky diving just outside of Sydney to celebrate Christian’s birthday. Eric (the second one) compiled all of our videos together into one single video, put a sound track to it, and made this great video! It’s about 35 megs for the 5:30 minutes worth of video. It won’t start until you hit play, so it shouldn’t cause stuff to start playing without your input!
So What Does Everything Mean?
- preload=”none” tells the browser not to preload the video file unless the user hit’s the play button – saves on bandwidth.
- poster=”" indicated where the browser should load the poster file from, that’s the image the browser shows until you hit play, or it finishes loading the video file
- src=”" – well, that one’s pretty obvious, it’s the video you’re trying to load
- controls – tells the browser to show the video controls. In IE9 PP3, if the video width is less than about 400px, it won’t show the controls because the image is too small, I fought with that one for more than a few minutes! Grrr! Also, I’m using the more relaxed HTML5 syntax here, and not giving the attribute a value, you could do controls=”controls” if you want to make sure your code validates as expected.
You could also add…
- autoplay – plays the video without the user having to click the play button.
- loop – loops the video infinitely, or until the user hits the stop button, or navigates away from the page.
- width or height – sets the width and height of the video element.
Encoding Videos
Getting the <video> element on your page is the easiest part! How big is the video, both from a screen size perspective, and from a file download size is the more challenging part! Is it encoded with the right encoder? Some point and shoot cameras record in H.264 mode, some (like my Canon SD780 IS) don’t
. Encoding the video is likely the most difficult!
So how what’s the best way to resize and encode your video? There are a bunch of tools available today, some free, some paid. Sadly, the free Windows Live Movie Maker won’t encode videos with the H.264 encoder . I’m going to walk through how to do this with Expression Encoder 4 Pro. It’s part of the Expression Studio set of tools. If you’re an MSDN subscriber, you can download it as part of your MSDN subscription. Otherwise, you can download the 60 day free trial from the Expression Site, after that you’ll need to purchase a license for it.
For the rest of the walk through, I’m going to assume you’ve already got Expression Encoder 4 Pro installed, and you’ve got the video file that you want to encode ready to go.
- Start Expression Media Encoder, when it starts, it’ll prompt you with a “Load A New Project” dialog box. Since we’re going to put our video online with the HTML5 video tag, not Silverlight, you want to create a new Transcoding Project.

- Now that we’re in Expression Media Encoder, we need to import the video file that we want to encode. Under the File menu, choose Import and find the file that you want to encode. It’ll take a second to analyze and for Expression Encoder to read the file completely (especially if it’s a big file you want to encode).

- Now we need to chose our output encoding settings, thankfully Encoder 4 Pro makes that pretty easy for us.
In the Presets box in the left, there are a bunch of pre-configured settings you can choose from. Video can get really big, depending on the quality and length of video, so unless I need super high quality, I typically choose one of the Encoding For Online Services profiles, and from there I usually use an standard def profile, but again, you’ll want to experiment with this depending on your needs and the bandwidth of your users and your server. For this example, I chose the “H.264 YouTube SD” profile, which results in a file that’s about 4megs per minute of video. Be sure to click Apply once you’ve chosen your profile to apply the settings. You’ll notice that the area in red now defines the output format, and other information. You can go in and expand out any of those tabs to change how the video is encoded. The video that I’m encoding is 16:9, but you’ll notice the output format is 4:3. Because of that, Expression Encoder will automatically add the black bars above and below the video, and give me a letter box look.
The other important tab you’ll want to make sure you’ve got set up how you want it is the Output tab – this is where Expression Web will save file that it just encoded. I change the output directory from my user folder to the web folder that I’m working on, and also turn off the Sub-folder by Job ID check box. I don’t use Job ID’s, so there’s no need for that.- We’re now ready to encode! Push the Encode button on the bottom left part of the screen and Expression Encoder 4 Pro will start it’s magic… After a couple of minutes, you’re file will be done and ready to go!
Other Resources
There’s a fantastic post on DiveIntoHTML5.org with some really great info about the video tag and how to use it that I’d highly recommend checking out at http://diveintohtml5.org/video.html. On there, he also talks about other encoders that you can use (including some of the free ones), and also the different issues surrounding codecs.
Some Other Fun Videos
I shot these videos last January while I was in St. Maarten. If you’re an airplane buff like I am, it’s a place you HAVE to go at some point, watching a 747-400 land or take off less than 100 feet from you is AMAZING! I never knew a Dash-8-Q400 could give such a good exfoliation when standing behind it ![]()
Sad Panda: HTML5 Video Not Supported
This browser doesn’t support HTML5 video with the H.264 video codec, so instead, you get the generic fall back.
Sad Panda: HTML5 Video Not Supported
This browser doesn’t support HTML5 video with the H.264 video codec, so instead, you get the generic fall back.
Enjoy!
PEte
PS: I tested these links and videos in Internet Explorer 9 Platform Preview 3, and Chrome 5.
[UPDATE 6/24/2010 @ 3:42PM PST] I added the preload=”none” attribute to all the videos so browsers that do support video don’t download the videos unless you ask for them.
Tools For Web Designers and Web Developers
6Building cool websites requires tools beyond your development environment. In my last two posts, I introduced the Internet Explorer Developer Tools, and the HTML Tab within the Internet Explorer Developer Tools. Today, I want to take a quick tangent off of the IE Developer Tools, and look at some other tools available from Microsoft that you may find useful.
Expression Web SuperPreview
Expression Web SuperPreview is part of the Expression Studio set of tools, and is a visual debugging tool that makes it much easier to see and debug different rendering engines side by side! One of the coolest features of Expression Web SuperPreview is that it has the IE6 rendering engine built it, so if you want to see what your site looks like in IE6, without having to find a machine with IE6 on it, you’re good to go! In fact, it’ll show you how your page renders in IE6, plus whatever versions of IE you have installed, as well as Firefox!
You can do side-by-side views of the different browsers, as well as visual overlays, sort of like an onion-skin mode. This is really great if you’re trying to get pixel identical layout. As you move your mouse over different elements in the page, SuperPreview shows you where that element would be in the other browser. And when you click on the element, a little window pops up giving you information about that element. What’s most useful about that is that it will show you the properties that are different. For example, when I look at my site in IE6 and IE8, I immediately notice lots of extra space between the header and the content. If I click on the “Home” link, in IE8, I can see the top is at “230” where as in IE6 it’s at 299.
One thing Expression Web SuperPreview doesn’t really let me do is interact with my page beyond that. I can’t click on links, navigate through pages, enter any information, and it doesn’t execute any JavaScript. But for comparing layouts on static pages, or on pages where you can get them into a state that you want before loading them – this is the tool for you!
Expression Web SuperPreview is a paid product that comes as part of the Expression Studio set of tools. If you’ve got an MSDN subscription, you can download it as part of your subscription, but if you don’t, you can get a 60 day free trial at http://microsoft.com/expression.
Expression Web SuperPreview Remote
I’m calling out the Remote feature of Expression Web SuperPreview separately because it’s still in beta, and you have to sign up for it, but this is super cool. Remote adds an additional browser to the matrix, adding Safari 4.0 for the Mac! Now, if you’re a PC user and don’t have access to a Mac, you can see what your site looks like without having to find a Mac.
Just like you can with Expression Web SuperPreview, you can click on elements and see where they’re laying out on the page and interact with them like you can when running locally, but this way you’re not resource constrained based on the hardware you’re running on your machine. A quick easy way to verify your pages in other browsers and other operating systems.
Expression Web SuperPreview Remote is part of Expression Web SuperPreview, and the only thing that you need to do to use is it is to activate it, which requires a valid email address. Takes only a few seconds to get set up and working! Again, you can get a 60 day free trial of Expression Web SuperPreview at http://microsoft.com/expression.
Expression Encoder Pro
I’ll just include a quick note here on this one, but one of the tools that comes with the Expression Studio set of tools is Expression Encoder Pro. It’s a great tool for encoding video for the web. It’s the primary tool for creating Silverlight video, but it will also encode to H.264 video, which is the codec used by Internet Explorer 9! While I wouldn’t give it to my Mom to use, as someone who is reasonable tech savvy, you should be able to figure it out without any problems.
I’ve used it to encode videos from one format to another, or re-encode them to a smaller size. Super powerful, and fun to play with!
Virtual PC Testing Images
People have often asked about installing multiple versions of Internet Explorer on the same machine, and while there are tools and utilities out there, there isn’t a supported, official way to do it right now. The tools that are available are risky in a couple of ways:
- You’re installing system files from a somewhat random website, are you sure you want to do that? Are you sure they haven’t tampered with the files and inserted malware or anything like that?
- Internet Explorer is part of the operating system, and there are several components that you need to replace to change versions including the JavaScript engine, parts of the network stack, in addition to the rendering engine. If any of those get out of sync, or the OS tries to call an API that didn’t exist in a previous version, you could find your system becoming unstable and not quite working right.
- How many real world customers are using these “Frankenbuilds”? While it may be an interesting test concept, it doesn’t mimic how real world users are visiting your site.
That’s why we strongly encourage you to virtualize your test environment, and we try to make that easier by providing VHD images that you can use to test what your customers will see and use. We provide IE6, IE7 and IE8 on Windows XP, as well as IE7 on Vista and IE8 on Vista. These images used to work on other virtualized hosts other than VPC, and right now, they’re not working. I’m still looking for solutions, and haven’t given up! I recommend that you build your own images in the mean time. The XP hard drives are time bombed because, we’re basically giving away the OS, and that makes some folks here uncomfortable.
You can download the Internet Explorer App Compat VPC Images from the Microsoft Download Center. We’re updating the images today (6/22/10), and are just waiting for them to propagate out through the system.
Using XPERF To Really Dive Into IE Performance
During my TechEd presentation about browser performance, I talked about how if you knew where the browser was spending the most of it’s time, you could optimize for the most expensive parts. The thing that I didn’t cover, was the tools you can use to understand where Internet Explorer is spending it’s time.
Well, last night, the IE team posted a great blog post titled Measuring Browser Performance with the Windows Performance Tools. They’ve given you everything that you need to know in order to dive in here. I won’t include the whole post here, or even recap it, but strongly recommend you check it out!
Enjoy!
PEte
Internet Explorer Developer Tools: HTML
2In one of my previous posts, I introduced the built in, Internet Explorer Developer Tools that come with Internet Explorer 8. Today, I want to take a deeper dive into the HTML Tab and what you can do with it.
The HTML Tab
The HTML tab shows the underlying mark up behind your page as seen by the Internet Explorer document object model (DOM), and not only shows the elements, and layout for the page, but also how the attributes affect how the page looks. The HTML tab is split into two windows, the DOM tree view, and is a set of tabs that help you understand the way your page looks.
As I walk through these tools, follow along, hit F12 to bring up the developer tools, and try changing the way my site looks!
All of these screen shots are from the IE Dev Tools Intro post I made a few days ago.
Using the HTML Tools
Select An Element
There are several ways that you can select an element and then use the different tools in the HTML Tab to edit those elements.
Select Element By Click (CTRL-B) – This is probably the easiest way to select an element and is pretty self explanatory. Clicking on this guy, then clicking on an element will select that element. Moving the mouse around the element you want to select will draw a blue line around the element, if you want to grab the parent element, move the mouse just outside of the element you’re trying to select. Alternatively, you can select the element, then use the DOM view to move up and down the DOM. - You can use the “Search HTML” box to find all element with particular attributes or elements of a particular type.
- The DOM Tree view is another way that you can select particular elements. Usually I use a combination of Select Element By Click and the DOM tree. When the developer tools open, and the page is loaded, you’re shown a view of the DOM, but the tree view isn’t expanded, you can click on the “+” sign to expand out the tree view and see all of the contents of each node in the DOM. This is a really good way to get into and see how elements are related to each other and where they’re falling within the DOM.
If you just want to see an outline of the elements on your page, and see how they’re all fitting together, under the Outline menu bar item, you can select from Table Cells, Tables, DIV Elements, Images, Any Elements, or Positioned Objects.
Changing Attributes and Elements
One of the powerful features of the IE developer tools is that they allow you to change properties and attributes of the elements live while looking at the page. Once you’ve selected the element, you can use any of the tools below to change the element in memory. Remember, this won’t serialize those changes back down to your source file – you’ll have to do that yourself, but it’s a great way to figure out what you do need to change.
The developer tools do have the ability to save the changes you’ve made to your page, but they’re going to save out IE’s DOM version of your page, and not the beautiful code you wrote!
Style Tool
The Style tool shows how your CSS rules have been applied to the currently selected element. By default, the tress is fully expanded, so you can see where the values are coming from. For example, on the left, you’ll notice that in the BODY element, the color and font-size both are displayed with a line through them, those attributes are being overridden by another CSS rule further down in the cascade. You can use the check boxes to turn the attributes on and off as you’re looking at the page to see how particular rules and attributes are being applied to that specific element. Personally, I find this particular tool to be the least useful to me, and much prefer the next too, the Trace Style Tool.
Trace Styles Tool
Alright, like I said, this is the tool that I personally find most useful when I’m trying to figure out why my CSS isn’t rendering like I expect it to in the browser. The Trace Style tool shows you all of the style attributes that are being applied to this element. By expanding out the tree, you can see where the attributes are coming from, and how they cascade. In this particular case, in style.css, the body style rule has been defined twice for some reason, and because of the cascade, the body color of #4e4e4e is being overridden and set to black. If you click on the “style.css” link on the right side of the screen, you’re taken directly to the specific line in the code!
The Trace Style tool gives you two other things I really like – the check boxes so you can turn the styles on and off in real time to see how the rule changes the element. The second one is that you can actually edit those CSS values inline and see how they appear. If you click on the “black” and type “yellow”, you’ll notice the page updates in real time!
Layout Tool
I know I’ve said this before, but for whatever reason, I just can’t seem to remember the difference between margin and padding – every time I think I remember it right, I’m wrong again. The single most helpful tool for me when I get into these types of problems is the Layout Tool. It draws a visual representation of elements and their box model – it shows the size of the element (that’s the light blue in the center in this case the 574×32), the padding, the border, the margin and the offset. All visually in a way that I can see and understand – without having to put “border: 1px solid black;” around my elements to debug them!
Like the other tools, you can also edit the values in line. The inline editor is somewhat picky though, and you have to enter the value in just like you would if you were putting it in as an inline style, so you need to use the value, the units and a semi-colon. For example, if I click on the “32” above and want to change it to 75, I’d need to type “75px;”.
Attributes Tool
Okay, so now we’ve seen all of the styles that are being applied to our page, all the styles that are being applied to the selected element, we’ve been able to visualize the box model for the selected element. But there are attributes on elements that aren’t style, and we need a tool to be able to view and edit those. That’s what the Attributes tool is for – it’s not just the style and CSS attributes, but all attributes that are on the selected element. In this particular case, the Node box indicates we’re looking at an h1 tag, and that h1 tag has only one attribute, which is the class attribute.
To add an attribute to the element, you can click on the plus sign
, it then moves the focus to the table, and provides you with a drop down list of all of the attributes that you can set for that element. You’ll likely notice some attributes like “background (css)” – those attributes will be set as inline style attributes for the selected element.
HTML Editing with Internet Explorer Developer Tools
Well, that wraps up this post, hopefully you found it useful! I’ll be back soon with another post covering the CSS Editing tools, and another for JavaScript!
Internet Explorer: Understanding Compat Features For Developers
0
The IE Engineering team posted a great blog post on the IE Blog yesterday about the compatibility features of Internet Explorer 9 that is really worth checking out – it explains in great depth about the different modes that Internet Explorer offers as well as provides some best practices for how to make sure your code works exactly the way you expect it to!
IE’s Compatibility Features for Site Developers
They even went so far as to create a flow chart type diagram that shows how Internet Explorer chooses which rendering engine to use when displaying a page, both as a png (which I’ve included below) and as SVG diagram!
And in other cool news, the product management team (the team I’m on) also started a blog this week, Ryan Gavin posted the first post and it should be an interesting read. If you’re a web designer or web developer, you’ll likely want to stick with the IE Engineering Blog, but pop over to our other blog once in a while, it should make for some interesting reading about things that aren’t quite engineering related!
Internet Explorer Developer Tools
5One the the coolest features of Internet Explorer 8 that most developers don’t know about are the build in developer tools. Think Firebug, except for Internet Explorer, and built by the IE Team, so you don’t have to download anything, install it, or enable it. Heck, my Mom could bring up the developer tools if she really wanted! Over the next week or so, I’m going to do a short series on the Internet Explorer Developer Tools and what you can do with them. Since Internet Explorer 9 is still in the “Platform Preview”, I’m going to focus on Internet Explorer 8, though there are some cool new IE9 tools, I’ll save those for another day.
Starting the Developer Tools
There are two ways you can open the IE Developer Tools, you can either hit F12, or under the Tools menu icon, you can choose “Developer Tools”. Both of these will open the Developer Tools, which you can either run in a separate window, or docked to the bottom of your browser window as I’ve shown below.

When the Developer Tools open, there are four main tabs that provide the major functionality of the tools
HTML Tab
This tab allows you to see and edit in real time the HTML and applied styles that make up your page as seen by the Internet Explorer DOM. From here you can move through the DOM either via the tree view on the bottom left, or you can click on the little mouse pointer icon, and grab individual elements. When you do that, IE automatically takes you to the element you’ve selected. On the left side of the HTML panel, is another set of tabs, that show the Style and inheritance information for the CSS that’s being applied, an ability to Trace Styles, so you can see what particular style is being applied, and why. The Layout tab is particularly useful if you’re forgetful like me and mix up margin and padding (for years, I’ve not been able to keep it straight, and every time I think I’m remembering it right, I goof it up again). Finally the Attributes tab shows the attributes that are on that element.
The CSS Tab
Shows you all of the styles that are being pulled down for your site, how they cascade against one another and is useful to view and turn off styles individually or at the entire style level. Like the HTML tab, you can edit your styles in real time to see how changing properties affects the page. So if you’re not sure why something isn’t being styled right, this is a great place to look.
The Script Tab
Like any good development tools, debugging is a vital component of understanding why something isn’t working, or why you’re getting that a 3 instead of a 2. The Internet Explorer 8 developer tools let you do everything that you’d expect in a full-fledge debugger (it’s almost as powerful as the debugging tools in VS2010 – not quite, but pretty good). Like the HTML tab, there are several tabs on the right side of this window. There’s the Console tab, so you can output to the console window if you’ve added debugging code to your scripts. The Break Points tab, to help you be able to apply break points and debug into your code on specific lines. There’s also the Local and Watched Variables tab so you can see what’s happening to your variables as your applications is running. And finally the Call Stack tab to dig into the call stack.
The Profiler Tab
This is the one that I think is probably the coolest feature of the Internet Explorer 8 Developer Tools, and that’s the built in code profiler. Want to know what’s happening, what functions are being called, why things are taking longer than you expect, or not getting called, the Profile is your guide to what’s going on. Once you turn the Profiler on, you can run your code and IE will keep track of the number of times every method is called the length of time spend in that method (Exclusive Time), the length of time spend in that method and any methods called by that method (Inclusive Time), as well as where that method is.
Other Useful Developer Tool Features
There’s a couple other things that I want to highlight in this Internet Explorer Developer Tools introduction, that I think are really useful when I’m working on building a new site, or editing an existing one.
Browser Mode and Document Mode
Internet Explorer 8 shipped with two rendering engines, the Internet Explorer 7 rendering engine, and the Internet Explorer 8 rendering engine. By default, as long as you’ve include the right DOCTYPE switch, Internet Explorer 8 will use the Internet Explorer 8 rendering engine. But you can’t always guarantee your users are going to be using IE8, and you want to see how your site will look with the IE7 rendering engine.

Document Mode
Document Mode allows you to manually choose which rendering engine you want IE to render the page with; choosing the Internet Explorer 8 Standards mode uses the IE8 rendering engine, Internet Explorer 7 Standards Mode uses the IE7 rendering engine, or Quirks Mode uses the quirky, IE5.5 rendering engine. Changing the Document Mode does NOT change the user agent string that is sent to the server and is primarily used for testing and seeing how your site will look in IE7.
Browser Mode
Browser Mode changes both the Document Mode, and the User Agent string, which allows Internet Explorer 8 to lie about who it says it is.
- “Internet Explorer 8” uses the IE8 rendering engine and the UA string tells the server that the browser is IE8 by including the “MSIE 8.0” and “Trident/4.0” tokens in the User Agent String.
- ”Internet Explorer 8 Compatibility Mode” uses the IE7 rendering engine and the UA string tells the server that it’s IE7, but if you know better, it’s really IE8. It does this by sending the “MSIE 7.0” token along with the “Trident/4.0” token. That way, if the server is looking for “MSIE 7.0” and you get the expected IE7 behavior.
- ”Internet Explorer 7” uses the IE7 rendering engine and the UA string tells the server that the browser is IE7, it doesn’t include the “Trident/4.0” token, only the “MSIE 7.0”.
If you want to see what your browser is reporting for it’s user agent string, check out http://petelepage.com/samples/uastring.aspx. Then open the Developer Tools and try changing the Browser Mode and Document Mode to see how the page renders in different ways.
Color Picker
Ever wonder what color is on another site, and don’t want to dig into their CSS to find it, or don’t remember what color you picked, the color picker is a little eye dropper tool that lets you click on a particular part of the page and it gives you the HEX color value, so you can just plug it right in where you need it. You can find the Color Picker under the Tools menu!
More To Come!
In my future posts, I’ll dive deeper into each of the above features, and how you can use them to debug your websites!
About: DOM Storage
0One of my sessions at TechEd 2010 this year was about advanced standards support in Internet Explorer 8. The DOM Storage API (which used to be part of the HTML5 Spec but are now in their own spec), were introduced to Internet Explorer in version 8, and provide methods for storing data on the client in a secure manner using the Document Object Model (DOM). DOM Storage allows you to store name value pairs, and unlike cookies, you don’t need to round-trip the data with every request. The other big difference is the quantity of data that you can store. Cookies are limited to about 4k, and 20 name value pairs, whereas DOM Storage allows you to store up to 10 megabytes, with no effective limit on the number of name value pairs. Data in the DOM Store also doesn’t expire, and is available unless the user clears their browser.
There are two types of storage, sessionStorage and localStorage. Session Storage is primarily intended for scenarios where the user is carrying out a single transaction. Information that is put in the store is available across all windows tabs and frames for the entire session the browser stays open. Local Storage persists across sessions, so even after closing and reopening the browser, the data is still available.
Using The Storage APIs
The Storage object use expando properties as the key. As mentioned above, the data is name/value pairs, and only supports strings. If you want to store data other than strings, you need to convert before storing it. If you want to store binary data like images, Flash, Silverlight files and so forth, you can use datauri to display it on the screen.
Session Storage
As I mentioned already, session storage is great for circumstances where you need to store something on the machine only for that session, for example you might want to locally cache certain data so you don’t have to keep downloading it as the user moves through your site. You might also use it for storing inputs the user may have provided on a previous page – maybe shopping cart information, or what comments a user has already seen.
var result = sessionStorage.keyName;
Local Storage
Local Storage allows you to store information that goes beyond the session. I might want to cache some of my user settings locally, so I don’t have to look them up every single time. For example, I might store the users preferred name, their preferred color scheme and their favorite stocks, along with some historical data about those stocks. That way, when the user arrives on my site, we don’t have to query that every single time.
var local = localStorage.keyName;
Storage Events
Internet Explorer fires events when data is either stored or updated, so that you can be sure information is synchronized between multiple instances of the browser. The onstorage is fired in a document when the storage area changes, and the onstoragecommit fires when Internet Explorer writes the localStorage data to disk.
Security and Privacy Implications of DOM Storage
Data in the local store is only available to sites within the domain in which they’re called. For example, if NoCommonGround.com tries to access the localStorage data from PeteLePage.com, it will fail. But, www.PeteLePage.com can access anything from PeteLePage.com. There also isn’t any way to restrict the data by path, so anywhere site within your domain will be able to access from the data store of your domain. Even if you use key names that are hard to guess, there are APIs that allow you to enumerate the keys.
Additional Resources
You can find lots more information about DOM Storage in the following places:
Browser Support*
| Browser | Version Added | Additional Notes |
|---|---|---|
| Internet Explorer | 8.0 | |
| Firefox | 3.0 | |
| Chrome | 3.0 | |
| Safari | 4.0 | |
| Opera | 10.5 |
*From CanIUse.com
