A Quick Guide to Internet Explorer 8 Developer Features

This topic gives you a hands-on introduction to the new Windows Internet Explorer 8 features for developers.

  • Web Services 
    • Accelerators 
    • Share your webpage updates with Web Slices 
  • Web Standards Support 
    • CSS 2.1 Compliance 
    • Accessibilty features 
    • Better AJAX Development 
    • DOM Improvements 
    • Native JSON Support 
    • Mutable DOM Prototypes 
    • Selectors API 
    • Improved Namespace Support 
  • Compatibilty: 
    • Versioning 
    • Improved Protected Mode API Support: 
  • User Control 
    • User Preference Protection Settings 
  • Platform Improvements 
    • Developer Tools: 
    • Script Error Improvements 
    • Circular Memory Leak Mitigation 
    • Platform Performance Improvements 

Web Services

Accelerators

Accelerators are contextual services that quickly access a service from any webpage. Users often copy and paste from one webpage to another, but Internet Explorer 8 Accelerators make this easier.

Accelerators enable users to find information without leaving the current webpage. For example, suppose a user is interested in a restaurant and wants to see its location. By selecting the address, the user can view a preview of the map, with an option to click to a full webpage with additional information from a mapping service.

Picture of the mapping service Accelerator

Accelerators can also be used to send information to a service. For example, suppose a user reads an interesting article and wants to blog about a portion of the article. The user can select a portion of the article and use a blog Accelerator to navigate to the user's blog site with the selected text already available in the Edit field.

Users can access an Accelerators by selecting content and clicking the button that appears next to the selection. Alternatively, users can access Accelerators from the context menu for selections, links, and the current webpage. Accelerators for the current webpage are also available from All Accelerators on the Page menu.

Accelerators are services that the user can install and manage. Users can install them from the Internet Explorer Gallery or through any website that advertises Accelerators.

Accelerators are described by an XML file that provides the interface of how the browser should communicate with the service through URL templates. Web-based services should take advantage of XML-based Accelerators, because they are easy to create, test, and deploy to users.

This is a simple sample that shows a map Accelerator that you can host on a website.

Create the Accelerator XML file: Copy the sample code below to a text editor and save it as "GetMap.xml". The following code describes the functionality of the Accelerator.

<?xml version="1.0" encoding="UTF-8"?>
  <openServiceDescription xmlns="https://www.microsoft.com/schemas/openservicedescription/1.0">
  <homepageUrl>https://maps.live.com</homepageUrl>
  <display>
    <name>Map with Windows Live</name>
    <icon>https://www.live.com/favicon.ico</icon>
  </display>
  <activity category="map">
    <activityAction context="selection">
      <preview action= "https://maps.live.com/geotager.aspx">
        <parameter name="b" value="{selection}"/>
        <parameter name="clean" value="true"/>
        <parameter name="w" value="320"/>
        <parameter name="h" value="240"/>
        </preview>
      <execute action="https://maps.live.com/default.aspx">
        <parameter name="where1" value="{selection}" type="text" />
      </execute>
    </activityAction>
  </activity>
</openServiceDescription>

Host the install button by adding this code example to the website on which you want to advertise the Accelerator.

<button onclick="javascript:window.external.addService('GetMap.xml')">Add Map Activity</button>

Test the Accelerator:

  1. Click Install on your website to install the Accelerator. This launches the Accelerator installation dialog box.
  2. Select the Make this my default provider check box. This sets the Accelerator to appear in the top listing.
  3. Go to a website that contains a street address.
  4. Select the address and click the blue button that appears next the mouse cursor. (Alternatively, you can right-click to get the context menu.)
  5. Hover over the Map with Live Maps Accelerator. This displays the preview of the map Accelerator.
  6. Click the Map with Live Maps Accelerator. This navigates to the map website in a new tab.

For more information, see OpenService Accelerators Developer Guide.

Share your webpage updates with Web Slices

Web Slices are enabled by adding HTML annotations directly to the webpage. Web Slices use a combination of the hAtom 0.1 Microformats Wiki Microformat and the Web Slices format to describe a portion of a webpage the user can subscribe to.

The basic properties of a Web Slice are the Web Slice container, title, and content.

Web Slice:

  • Required.
  • Uses class name hslice.
  • The Web Slice element must include an ID.
  • Represents the entire region of a Web Slice that contains the title, description, and other Web Slice properties.

Entry Title:

  • Required.
  • Uses class name entry-title as defined in the hAtom 0.1 Microformats Wiki.
  • There can be multiple instances of Entry Title.

Entry Content:

  • Optional
  • Uses class name entry-content as defined in the hAtom 0.1 Microformats Wiki.
  • If the Entry Content is missing, assume it is an empty string.
  • There can be multiple instances of Entry Content.

This is an example of how to mark up an auction item with the link, title, and description properties.

https://www.auction.microsoft.com/item


   <div class="hslice" id="auction">
  <p class="entry-title">item - $66.00</p>
  <div class="entry-content">high bidder:buyer1
  ...
  </div>
</div>

For more information see Subscribing to Content with Web Slices and Internet Explorer 8 Web Slice Style Guide.

Web Standards Support

CSS 2.1 Compliance

Cascading Style Sheets (CSS) is a simple mechanism for adding style (such as fonts, colors, spacing, and positioning) to web documents. Before the introduction of CSS, stylistic properties were set directly within HTML with different attributes. With CSS, authors can separate a page's data (specified in HTML) from the display logic, which improves markup organization and makes site maintenance easier.

The W3C CSS working group has made great strides toward converging on a final specification for CSS, Level 2 Revision 1 (CSS2.1). At the time of this writing, the specification status is "Candidate Recommendation." The main goal of this effort is to enable web developers and designers to write their pages once and have them render properly in many browsers. The new Developer Tools included with Internet Explorer 8 will also help in this endeavor. Internet Explorer 8 supports the latest feature set as defined in the specification.

Although one of the main goals for Internet Explorer 8 is CSS2.1 compliance, it is also forward-looking toward CSS, Level 3 (CSS3). CSS3 is the next step in the evolution of Cascading Style Sheets, and unlike CSS2.1, which consists of one single document, the CSS3 specification is broken down into different modules to speed up the process of converging on clear specifications and implementations of different features. Additionally, CSS3could further clarify some of the ambiguities in the CSS2.1 specification while providing new features to web authors.

See CSS Improvements in Internet Explorer 8 for more information.

Data URI Support

Data URIs offer web developers the opportunity to embed small external resources (such as CSS files or images) directly into a URL on a webpage.

<img alt="Image fed from data url" src="data:image/png;base64,iVBORw0KGgoAAA..." />

The primary use case for data Uniform Resource Identifiers (URIs) is the encapsulation of a binary file inside an URL (a stylesheet or image). Because the binary file can be represented inline as a string, it may be saved to the local store and retrieved at a later time without the need to fetch anything from the network.

Data URIs also offer an alternative to traditional URIs in that they don't require a separate download. This is advantageous in scenarios where subdownloads are blocked or unavailable.

The Data URI implementation attempts to balance security with functionality.

For more information, see data Protocol for Internet Explorer 8 support on MSDN.

Printing Improvements

Internet Explorer 8 includes several printing enhancements. These form the basis for a full implementation of CSS2.1 pagination recommendations, and provide authors with more control and functionality in the print medium. In particular, support has been added for the following printing constructs:

  • @page rule
  • left,right and first page selectors
  • "avoid", "left", and "right" values for page-break-after and page-break-before properties
  • page-break-inside property
  • orphans property

These improvements give developers greater control over how content is paginated across finite views. Developers can specify margin area, portions of content that must be kept together or split across pages, and much more. With this in mind, readability of printed web content can be greatly improved.

For more information, see CSS How-to - Optimize Pages for Printing Using CSS on MSDN.

Alternate style sheets

Internet Explorer 8 supports alternate style sheets. Specified by CSS, Level 2 (CSS2) and HTML 4.0, alternate style sheets allow page authors to define and name styles for a page (for example, to show different design options to customers), allow users to select a presentation style that suits their needs, or display a document with or without annotations.

By using the Style commands (available from the Page or View menus), the user can select among the style sheets exposed by a website or disable style entirely.

Deprecating CSS expressions

Also known as dynamic properties, this nonstandard CSS extension introduced in Microsoft Internet Explorer 5 supports the definition of property values by using JScript or VBScript expressions. While powerful, this feature was never standardized, has a high performance cost, and increases the browser's attack surface. Moreover, its main usage scenario has been to work around CSS bugs and limitations in Internet Explorer (for instance, to simulate max-width or pseudo-classes such as : first-child). These workarounds will be redundant in Internet Explorer 8.

Using the -ms prefix

Internet Explorer 8 introduces the -ms prefix for some non-CSS2.1 properties. Prefixes are used in CSS for all vendor-specific properties. Previous versions have not required or accepted the prefix on Internet Explorer-only non-standard properties. Internet Explorer 8 is changing that. It is important to update your site if it uses any of these properties.

The following properties should be used with a prefix:

  • -ms-accelerator
  • -ms-background-position-x
  • -ms-background-position-y
  • -ms-behavior
  • -ms-block-progression
  • -ms-filter
  • -ms-ime-mode
  • -ms-layout-flow
  • -ms-layout-grid
  • -ms-layout-frid-char
  • -ms-layout-grid-line
  • -ms-layout-grid-mode
  • -ms-layout-grid-type
  • -ms-line-break
  • -ms-interpolation-mode
  • -ms-overflow-x
  • -ms-overflow-y
  • -ms-scrollbar-3dlight-color
  • -ms-scrollbar-arrow-color
  • -ms-scrollbar-base-color
  • -ms-scrollbar-dark-shadow-color
  • -ms-scrollbar-face-color
  • -ms-scrollbar-highlight-color
  • -ms-scrollbar-shadow-color
  • -ms-scrollbar-track-color
  • -ms-text-align-last
  • -ms-text-autospace
  • -ms-text-justify
  • -ms-text-kashida-space
  • -ms-text-overflow
  • -ms-text-underline-position
  • -ms-word-break
  • -ms-word-wrap
  • -ms-writing-mode
  • -ms-zoom

The following CSS3 properties should be used without a prefix:

  • box-sizing
  • rubyAlign
  • rubyOverhang
  • rubyPosition

Using filters

Due to its proprietary non-standard syntax, Microsoft strongly recommends that new filter declarations use the quoted -ms-filter property syntax, which requires the filter to be quoted. For instance, the following code sample shows filter syntax for Internet Explorer 7 and earlier browsers.

filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80,FinishOpacity=70,Style=2);

The following code sample show's the same syntax as above, but using the ms- prefix version of filter.

-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80,FinishOpacity=70,Style=2)";

Note that -ms-filter property values must be quoted. Internet Explorer 8 processes existing unquoted filter declarations such as the one in the previous example. However, the property is applied if and only if its syntax is valid (all parentheses are present). If not, standard CSS 2.1 error recovery rules apply and the property no longer applies to your document. This may result in different rendering than Internet Explorer 7.

Encoding Detection

Prior to Internet Explorer 8, Internet Explorer defaulted to the code page of the referring document to decode a style sheet. Internet Explorer 8 now complies with the CSS2.1 style sheet representation priorities defined by the standard. You now have the ability to control character set decoding by using the charset attribute of the link element or the charset parameter of the HTTP Content-Type header. This level of control may be especially relevant for those style sheets that use generated content.

CSS Compatibility

One of the most important goals of Internet Explorer 8 is to be the most standards-compliant version of the browser ever. See CSS Compatibility and Internet Explorer for details about CSS compliance in recent versions of Internet Explorer, including support in Internet Explorer 8.

Accessibilty features

WC3's Accessible Rich Internet Applications (ARIA) Support

The World Wide Web Consortium (W3C) defines ARIA as syntax for enabling people with disabilities to access dynamic web content and custom user interfaces. Internet Explorer 8 uses ARIA role, state, and property information to communicate with assistive technologies. Instead of building separate simplified webpages for accessibility, use ARIA to mark up your rich web applications with roles, states, and properties. For example, to match the behavior created through a script, you can define a div element as a button, check box, or another ARIA role.

To learn more about ARIA and how to use it in your web content, use the following W3CARIA working drafts:

UI Automation Support

Microsoft UI Automation is the accessibility and software test automation API. It was introduced in Windows Vista and Microsoft .NET Framework 3.0, and is supported in Windows XP and later. Through UI Automation, Internet Explorer 8 relays to assistive technologys the ARIA markup information that supersedes the Microsoft Active Accessibility information set. For example, the minimum and maximum values of a custom webpage slider control are marked up using ARIA.

Because Microsoft Active Accessibility does not implement the concept of a slider, Assistive Technologies cannot get the information they need using it. However, when communicating with Internet Explorer 8 through UI Automation, Assistive Technologies can access the behavior of the control and its values.

The following webpages provide information on the background, implementation, and use of Microsoft Active Accessibility:

Better AJAX Development

Improving developer productivity was one of the primary goals for Internet Explorer 8. The Internet Explorer team set out to achieve this goal in part by providing cross-browser interoperability, compliance with standards, and additional powerful APIs.

Internet Explorer 8 offers a simple and powerful programming model for Asynchronous JavaScript and XML (AJAX) development, encompassing interaction between browsers, webpages, and servers. As a result, you will find it easier to build webpages that provide improved user experience, greater functionality, and better performance. These APIs are based on web standards as defined in the W3C HTML5 Working Group and the W3C Web Applications Working Group.

The following AJAX improvements bridge the gap between the browser and webpage to help you create a better user experience:

  • AJAX navigations enable users to navigate back and forth without leaving the AJAX application (webpage), and can be used to save the state of the AJAX application in the Address bar. This allows websites to trigger an update to browser components, such as the Address bar, by setting the value of windows.location.hash, which raises an onhashchange event to alert components in the webpage to alter their state, as well as creating an entry in the travel log.
  • Web Storage is a simple-to-use method for storing and retrieving strings of key-value pairs. Data can be stored per tab instance of a session or stored on the local machine. This allows pages to cache text on the machine, reducing the effect of network latencies by providing faster access to pre-cached data. Several innovative uses are possible, such as in combination with the new network connectivity event, to allow a page to cache data if it detects that the computer is offline. Data URIs (which are text strings) can also be easily cached on the local machine.
  • Connectivity events allow websites to check whether a user is connected to the network through the window.navigator.onLine property, and to get notified of connectivity changes by way of the ononline and onoffline events.
  • Six connections per host for broadband scenarios instead of two, and a scriptable property, improve performance by allowing parallel downloads in Internet Explorer 8. This also increases functionality by ensuring that a request is not blocked to a host if two connections already exist. Websites can optimize downloads based on the maxConnectionsPerServer property.
  • XMLHttpRequest (XHR) enhancements include a timeout property that can be set to cancel the request if necessary, allowing developers to better manage long-running synchronous and asynchronous requests.

Cross-domain communication is an integral part of AJAX development and mashup web applications. To help you build cross-domain communications that are safe and easy to implement, Internet Explorer 8 includes these three features:

  • Cross-domain request (XDR), developers can create cross-site data aggregation scenarios. Similar to the The XMLHttpRequest Object (W3C Working Draft) object but with a simpler programming model, the XDomainRequest object is the easiest way to make anonymous requests to third-party sites that support XDR and opt into making their data available across domains. Because the XDomainRequest object ensures that the server and client explicitly opt-in, data aggregation for public sites (such as blogs) is simple, secure, and fast. As announced, XDR integrates with the Access Control framework from the W3C Web Applications Working group for cross-domain data that is "public"-that is, not user-specific.
  • Cross-document messaging (XDM) APIs allow easy, secure, and standardized communication through IFrames between documents from different domains with one simple call to the postMessage method.
  • Cross-domain security is further enhanced with an HTML sanitizer called toStaticHTML, which filters potentially harmful HTML content. Additionally, Internet Explorer 8 fully supports the ECMAScript 3.1 JavaScript Object Notation (JSON) parser. Developers can use the native JSON.parse and JSON.stringify APIs to safely translate between JavaScript objects and JSON data. By removing potentially harmful content, these parsing features go a long way toward securing the end user. Both toStaticHTML and JSON can be used with XDM, XDR and XHR, among other features in Internet Explorer 8.

For code samples and more information on these features, What's New in Internet Explorer 8. The IE Developer Center also contains documents for the APIs listed here.

DOM Improvements

Internet Explorer 8 has resolved many of the (Document Object Model (DOM)) inconsistencies found in previous versions of Internet Explorer with its new standards mode rendering engine. Developers who choose to opt out of this rendering mode can use IE7 Standards mode for compatibility with legacy content by adding the <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> tag in the document's <head> element (or send the equivalent HTTP header on the server).

Internet Explorer 8 makes significant progress toward compliance and interoperability with W3C DOM standards. To improve JavaScript programming interoperability with the DOM standards, Internet Explorer 8 includes many fixes for standards-compliance issues in the implementation of the DOM L1 & 2 Core specification, as well as the DOM L2 HTML specification.

A few examples of common bugs that have been fixed in the Internet Explorer 8DOM include the following:

For more information on these changes, see HTML Enhancements in Internet Explorer 8.

Native JSON Support

JSON is a simple and lightweight data-interchange format based on a subset of the object literal notation of the JavaScript language. The JScript engine shipped with Internet Explorer 8 implements the ECMAScript 3.1 JSON proposal for native JSON-handling functions which uses Douglas Crockford's JSON in JavaScript API.

Note  The link to json.js is to the API script, not a webpage. Save it to your hard disk drive to open and view.

Native support for JSON is achieved by introducing a global JSON object with two built-in methods: JSON.stringify and JSON.parse. The new global built-in JSON object is defined in the JScript engine and is created during the engine initialization phase.

The global JSON object is similar to any other intrinsic global object in the JScript engine such as Math, Date, and so on, and can be modified or overridden by the developer. If a user overrides the JSON object with a self-defined JSON object, the user-defined object takes precedence over the built-in JSON object. In such a scenario, the user needs to implement the stringify and parse methods on the self-defined JSON object because the built-in methods are no longer be accessible to the user-defined JSON object.

The JSON.stringify method serializes a JScript value and returns a representative JSON text string, while the JSON.parse method deserializes a JSON text string and safely revives it into a JScript object.

Because it is a native implementation and one that removes the dependency on the JScript eval method to "revive" JSON strings back into JScript objects, this implementation is both fast (for both serialization and deserialization of data) and secure compared to equivalent framework implementations.

Impact on existing websites

To maintain backward compatibility, this feature is available only when a site chooses to use the latest version of JScript features by using the " Internet Explorer 8 Standards" layout (document) mode. This feature might affect the behavior of webpages that depend on a global variable JSON or use json2.js. Though the global JSON object can be overridden, when a page chooses to use the "Internet Explorer 8 Standards" layout (document) mode it is not an undefined object anymore. With JSON now being instantiated as a global name by the JScript engine, checks such as if(!this.JSON) would now evaluate to false and would need to be changed appropriately in the user code.

The webpages that use JSON in JavaScript are unlikely to be affected. With very few exceptions, all these pages will continue to work, and likely work faster. These exceptions are due to the differences that exist between the Internet Explorer native JSON implementation and JSON in JavaScript. For example, during serialization the native JSON implementation detects cycles and does not go in infinite recursion like JSON in JavaScript. You can find more about these exceptions at the JScript Blogs. For more information, refer to the JSON Object Documentation and see Versioning and JScript Engine's Version Support.

Mutable DOM Prototypes

Web applications have come a long way since the static webpage. Today, web developers need improved programming functionality, flexibility, and features to enable them to build the next generation of web applications. The Internet Explorer web platform provides many of the features and functionality necessary to build those applications. JavaScript, the principal scripting language used on the web, is often used to code innovative new features that supplement the web platform, cater to website-specific scenarios, normalize differences between browsers, and so on.

To provide web developers with the programming tools necessary to build new JavaScript scenarios that innovate, extend, and build upon the web platform, Internet Explorer 8 offers a collection of features that extend some of JavaScript's advanced functionality into the DOM.

DOM Prototype support

Internet Explorer 8 extends the semantic capability of JavaScript prototypes into the DOM. When web developers want to interact with a webpage through JavaScript, they must use and interact with DOM objects, which are not part of the core JavaScript language. In previous versions of Internet Explorer, the DOM only provided object "instances" to the JavaScript programmer. For example, the DOM createElement method creates and returns an element instance, as in the following code example.

var div = document.createElement('DIV'); \/\/ Returns a new instance of a DIV element

This div instance is "derived" from a prototype that defines all of the properties that are available to that instance. Prior to Internet Explorer 8, the JavaScript constructor and prototype objects for div instances (and all other instances), were not available to the web developer. Internet Explorer 8 (when running in IE8 standards mode) reveals the constructor and prototype objects to JavaScript. In addition to allowing the customization of DOM object instances by way of their prototypes, DOM prototypes also help to clarify the internal representation of the DOM and its unique hierarchy in Internet Explorer, compared to other browsers.

For more information, see Document Object Model Prototypes, Part 1: Introduction. For the complete list of DOM prototypes with their properties and methods, see the reference page

Getter/setter support

An accessor, also called a getter/setter property, is a new type of JavaScript property available in Internet Explorer 8. By using accessor properties, web developers can create or customize dynamic data–like properties that execute JavaScript code when their values are accessed or modified. The DOM prototype hierarchy defines all of its properties as built-in accessors. Web developers can also customize built-in accessors to fine-tune the default behavior of the DOM. Internet Explorer 8 is the first browser to implement support for the ECMAScript 3.1 standard syntax for creating accessor properties (Object.defineProperty). For more information, see Document Object Model Prototypes, Part 2: Accessor (getter/setter) Support.

Selectors API

Selectors are a query language for searching and "selecting" tags (elements) within a webpage. They are most commonly seen in CSS to "select" a group of elements to which certain properties will be applied.

Selector
{ 
   property: value;
   property2: value;
}

In Internet Explorer 7, there is no way of "executing" the selector independently of CSS. The Internet Explorer 8 implementation of the Selectors API is based on the specification of the W3C Web Applications Working Group: W3C Selectors API

For more information, see Selecting Objects with JavaScript .

Improved Namespace Support

Internet Explorer 8 offers web developers the opportunity to write standards-compliant HTML-based webpages that support features (such as Scalable Vector Graphics (SVG), XUL, and MathML) in namespaces, provided that the client has installed appropriate handlers for those namespaces via binary behaviors. (A binary behavior is a type of ActiveX control.)

Internet Explorer 5 through Internet Explorer 7 provide limited element namespace support. (This support keeps the parser from treating elements with namespaces as native HTML elements.) By using element namespaces, web developers can apply behaviors to those elements through special HTML markup (called HTML Component (HTC), and Component Object Model (COM)) developers can apply binary behaviors. Only elements in a namespace can have binary behaviors applied to them.

Internet Explorer 8 improves its namespace support by supporting default namespace declarations on elements not included in the set of known HTML tag names.

<html>
 <body>
  <newtag xmlns="https://my/namespaceURI">
   <folder>Hello</folder>
  </newtag>
 </body>
</html> 

In the previous example, both the newtag and folder elements will be treated as namespaced elements in Internet Explorer 8. For more information see Internet Explorer Namespace Support .

Compatibilty:

Versioning

Versioning Internet Explorer 8 modes

Versioning and Internet Explorer rendering modes enable Internet Explorer 8 to remain compatible with today's web content. These modes also provide a mechanism for introducing new features and stricter standards of compliance.

Internet Explorer 8 has three different layout modes:

  • Quirks: Backward compatibility with Internet Explorer 5 rendering behavior.
  • Internet Explorer 7 Standards: Backward compatibility with Internet Explorer 7 JavaScript and layout behavior.
  • Internet Explorer 8 Standards: Latest features, including the CSS2.1-compliant layout engine and DOM/HTML breaking changes.

By default, Internet Explorer attempts to display content by using its most standards-compliant mode: Internet Explorer 8 Standards mode. To allow the existing site content to remain compatible with Internet Explorer 8, site operators may designate the correct layout mode for Internet Explorer 8 clients by using a new compatibility mode switch.

For more information, see Defining Document Compatibility.

Versioning and Cross-Document Interaction

Internet Explorer 8 introduces the Internet Explorer 8 standards mode by default; this allows web designers to use the latest rendering features available in the browser. In addition to layout changes, Internet Explorer 8 standards mode also affects the behavior of scripted APIs (DOM). To opt out of Internet Explorer 8 standards mode, the meta tag may be used to obtain Internet Explorer 7 compatibility mode:

<meta http-equiv="X-UA-Compatible" content="IE=7">

Versioning of the DOM APIs introduces additional complexity for web developers who interact through script with framesets and inline frames, HTC files (element behaviors), and various HTML dialogs that are in different modes. For example, a frame that is in Internet Explorer 8 standards mode may interact with another frame that is in Internet Explorer 7 compatibility mode. Script authors must understand how versioning will affect DOM APIs that have different behaviors when invoked across document boundaries. The following scenarios illustrate these behaviors:

  • A single webpage may host one or more iframe that contain documents of different modes. For example, a webpage in Internet Explorer 7 compatibility mode (such as a portal) may host newer Internet Explorer 8 standards mode content.
  • A webpage may create a new window or dialog box (for example, through window.open) that loads content from a document of a different mode. The webpage then proceeds to call DOM APIs on that new window.

Other scenarios, such as frameworks and mashups injected through write or <script src="framework.js">, are not explicitly handled by cross document versioning because they do not involve the creation of a new document. In these scenarios, web developers must author their content carefully so that it works well with any document mode.

For more information, see Defining Document Compatibility.

Versioning and JScript Engine's Version Support

Versioning of language feature sets in the JScript engine allows Internet Explorer 8 to remain compatible with today's web content while developers update the content to use the newly introduced feature set. For Internet Explorer 8, the versioning support for JScript features is exposed and controllable through the Internet Explorer layout (document) mode.

The Microsoft JScript engine shipped in Internet Explorer 8 supports two different versions:

  • Version 5.8: Latest features, including native JSON support, accessor property for mutable DOM prototypes, and JScript breaking changes. The JScript engine uses this version of language support when a page uses the layout mode as "Internet Explorer 8 standards" mode.
  • Version 5.7: Backward compatibility with Internet Explorer 7JScript behavior. The JScript engine uses this version when a page uses the layout mode as anything other than the "Internet Explorer 8 standards" mode.

Update your site to render in IE7 mode

You may experience one of the following issues when you use Internet Explorer 8:

  • Misaligned webpage layout
  • Overlapping text or images
  • JavaScript functionality issues and errors

These issues may occur because Internet Explorer 8 displays webpages using "standards mode" by default, whereas most current webpages are created and tested to work with Internet Explorer 7 standards mode. Getting Internet Explorer 8 to always render a site or page such as Internet Explorer 7 can be done by just adding a tag. No additional changes are required.

There are two options for doing this:

  • On a per-site basis

    The site owner can add the following HTTP header.

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    
  • On a per-page basis

    The site owner can add a special HTML tag to each document, right after the tag.

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    

The meta tag retains Internet Explorer 7 rendering behavior while still accessing all Internet Explorer 8 has to offer. This allows your site visitors who are using Internet Explorer 8 a seamless experience while you work behind the scenes to update your web properties. When your site is updated to render in Internet Explorer 8, you can remove the tag or continue to use the tag functionality, as it will remain as part of Internet Explorer 8 upon final release.

Note: Adding the Internet Explorer 7 compatibility tag should address most display issues. However, browser detection may also have to be updated on your site. To learn more, see Understanding User-Agent Strings.

For more information on this specific meta tag update, see the knowledge base article Some Web sites may not be displayed correctly or work correctly in Windows Internet Explorer 8. Other compatibility options are described in Internet Explorer Compatibility center Internet Explorer Compatibility Center.

Improved Protected Mode API Support:

Internet Explorer 8 makes it easier for developers to programmatically start, maintain, and interact with a protected mode Internet Explorer process. Building on the User Account Control (UAC) integration in Internet Explorer 7, the IWebBrowser2 interface provides new process creation methods that properly conform to user privilege levels. With a low-cost change to existing code, developers can now spawn and control protected mode Internet Explorer processes while avoiding confusing workarounds.

Internet Explorer 8 also provides new broker functions that allow access between applications, processes, and resources secured to other integrity levels in Windows Vista. For example, medium-integrity applications can access protected mode cookies. In addition, protected mode Internet Explorer processes—including browser extensions and (Browser Helper Objects (BHOs)—have limited access to registry keys and low-integrity file locations. For more information, refer to the Protected Mode Internet Explorer Reference on MSDN.

User Control

User Preference Protection Settings

Internet Explorer 8 includes the User Preference Protection feature, which puts users in charge of their default search provider and allows them to approve any changes to the default provider before they are made.

In Internet Explorer 7, the default search provider is stored in the DefaultScope registry key (in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes). Applications that write to this key continue to work in Internet Explorer 8; however, the user will be prompted to approve any change to their default provider the next time an Internet Explorer window is opened.

If multiple programs write to the DefaultScope registry key before a new Internet Explorer window is opened, the last writer (of the registry key) prevails, in that the new search default requested in the last registry write will be presented to the user.

Developers are encouraged to use the new IOpenService interface (defined in openservice.idl) to request a change to the search default. The user is presented with an approval dialog box immediately when the API is called. The application name and publisher of your application (obtained from the calling DLL) will be displayed in this dialog box. as shown in the following screen shot.

Screen shot of the search provider default dialog box

#include <openservice.h&>

HRESULT hr;

CoInitialize(NULL);

CComPtr<IOpenServiceManager> pServiceManager;

hr = pServiceManager.CoCreateInstance(CLSID_OpenServiceManager);

CComPtr<IOpenService> pService;

// Install the provider to get an IOpenService pointer.

hr = pServiceManager->InstallService(MYSEARCHSERVICEURL, &pService);

hr = pService->SetDefault(TRUE, NULL);

CoUninitialize();     

Platform Improvements

Developer Tools:

Internet Explorer 8 includes tools needed by web developers to efficiently debug and profile their sites directly in the browser. Instead of switching between the browser and a separate development environment, developers can immediately debug a site's HTML, CSS, and JScript from within the browser. The built-in JScript profiler helps developers better understand and therefore improve a site's performance. Internet Explorer 8 Developer Tools, which provide visibility into the browser's internal representation of the site rather than just a source view, also help to determine why a site does not render or behave as expected. By making a site easier to edit, Internet Explorer 8 Developer Tools make experimentation and iterative development easy. This enables rapid prototyping and helps developers improve their skills. For more information, see Discovering Internet Explorer Developer Tools on MSDN.

Script Error Improvements

Internet Explorer 8 fixes two substantial bugs in the reporting of script errors, as well as updates the script error dialog box user interface. Script errors now correctly identify both the resource and line number of the offending script. Previously, when not debugging, Internet Explorer was unable to correctly report which external resource file (*.js) was generating the script error. Line numbers were also frequently offset by one. Together, the fixes to these problems allow web developers to quickly and accurately identify problem areas during web development with and without using the debugger.

Circular Memory Leak Mitigation

Internet Explorer 8 includes improvements to memory management. These improvements mitigate memory leaks that were previously created by circular references between JScript objects and DOM objects.

This feature can affect the behavior of webpages that depend on garbage memory that, only as the result of a memory leak, existed in previous versions of Internet Explorer. In Internet Explorer 8, these pages reference unallocated memory and generate a fault.

This feature affects each website displayed in Internet Explorer 8 regardless of the site's chosen rendering mode. See Circular-Memory Leak Mitigation in Internet Explorer 8 for more information.

Platform Performance Improvements

Internet Explorer 8 incorporates several changes that improve the performance of websites. These changes affect many Internet Explorer subsystems, including the HTML parser, CSS rule processing, markup tree manipulation, and the JScript garbage collector and runtime. In addition, with a three-fold increase in the number of allowable parallel downloads, Internet Explorer 8 can change the download order of webpage elements. The majority of these changes will affect performance only, with little or no impact on functionality of most websites. However, the changes might expose those aspects of websites that depend on the timing of operations or on browser performance. In addition, websites that attempt to access objects that have been freed might be prevented from such access in Internet Explorer 8. The performance improvements in Internet Explorer 8 affect every website loaded in the browser, regardless of the rendering mode. For more information, visit the IE Developer Center on MSDN.