Professional Documents
Culture Documents
Scalable Vector Graphics (SVG) Basic Shapes Clipping, Masking, and Compositing Coordinate Systems, Transformations, and Units Document Structure Gradients and Patterns Interactivity Linking and Views Painting and Color Paths Text New Tools for Web Developers Pinned Sites Platform Versioning New Document Mode User-agent (UA) String Developer Tools Console tab Network tab User-agent switcher tool Measuring real-world performance Data URI ICC Color Profiles Selectors API Level 2 Revision History
Introduction
Welcome to Windows Internet Explorer 9. As a developer, you want to know the latest information about the browsers you and your customers use. Internet Explorer 9 is the latest version of the worlds most popular web browser. We designed Internet Explorer 9 to help the web development community create rich, interoperable, standardscompliant web applications by providing the platform, tools, and features for the future web. This document shows you, the web developer whose customers rely on Internet Explorer, how to use these new enhancements in your websites and applications. Be sure to check out the accompanying Test Drive site for a demonstration of these features in action. To offer feedback and see more information on what's new in Internet Explorer 9, see the Release Notes, as well as What's New in Internet Explorer 9 on MSDN. For the latest news about Internet Explorer 9, see the IE Team Blog. And as always, for the very latest developer information about Internet Explorer, visit the Internet Explorer Developer Center on MSDN. Internet Explorer 9 is intended to help developers better understand
how Internet Explorer 9 has progressed in the following dimensions of the platform: All-around browser performance Web standards support to help enable the same markup to work identically across different browsers New graphics capabilities that harness the power of Windows PCs
Internet Explorer 9 makes significant investments in standards support and interoperability. For instance, new HTML5 support, better support for a number of CSS3 features, anda first for Internet Explorerbuiltin support for SVG are all part of Internet Explorer 9.
Enhanced CSS3 support o Rounded corners via the border-radius property o CSS3 background and border features o The opacity property o RGBA, HSL, and HSLA color models o CSS3 fonts properties and new web font formats o CSS3 media queries o CSS3 namespaces o CSS3 values and units o CSS3 selectors Improved data URI support Document Object Model (DOM) Improvements o Enhanced DOM capabilities o Parsing and serializing XML to and from the DOM o New DOM Level 2 (L2) and Level 3 (L3) support and updated behaviors DOM Core (L2, L3) and Views (L2) DOM Element Traversal DOM Events (L2, L3) DOM L2 HTML DOM L2 Style DOM L2 Traversal and Range o New whitespace handling behavior ECMAScript feature enhancements Added HTML5 support o Geolocation o The video and audio elements o The canvas element o The Selection interface o Improved parsing of HTML elements o Text selection APIs ICC v2 and v4 color profile support on images New Selectors API Level 2 support for the msMatchesSelector method SVG features o Basic shapes: rectangles, circles, ellipses, lines, polylines, and polygons o Clipping, masking, and compositing o Coordinate systems, transforms, and units o Document structure, metadata, and extensibility functionality o Gradients and patterns o Interactivity o Linking and views o Painting and color o Paths, including full capabilities of the path element and d attribute o Text
Additional platform versioning capabilities o Pinned sites o New document mode o New user-agent (UA) string Developer Tools additions o Performance improvements o Console tab o Network tab o UA switcher tool o Real-world performance measurement
Revision History
March 16, 2010: Created for Internet Explorer Platform Preview. April 15, 2010: Updated with information about: CSS3 Namespaces Module support Additional CSS3 selectors support More DOM support details More SVG support details, including embedding limitations ICC color profiles support May 5, 2010: Updated for Internet Explorer Platform Preview Build 2 with information about: More DOM support details New DOM features: o New DOM Core APIs o DOM HTML o DOM Traversal o New DOM L3 events: DOMAttrModified event DOMContentLoaded event Composition events New user-agent (UA) string Data URI changes Developer tools additions: Console tab and UA switcher tool June 23, 2010: Updated for Internet Explorer Platform Preview Build 3 with information about: New CSS3 features: o New background and border features o HSL and HSLA color models o CSS3 Fonts support o CSS3 Values and Units support o New display property values New DOM Element Traversal support New HTML5 features:
o o
video, audio, and canvas elements Selection interface New Selectors API Level 2 support: o matchesSelector method New SVG features: o Clipping, masking, and compositing o Gradients and patterns o Interactivity o Linking and views o Painting and color o Text
August 4, 2010: Updated for Internet Explorer Platform Preview Build 4 with information about: Chakra, the new JavaScript engine Enhanced DOM capabilities New support for the WebIDL specification The window.msPerformance object Fleshed out canvas section with links to examples September 15, 2010: Updated for Internet Explorer 9 Beta with new links and information about: DOMParser and XMLSerializer Pinned Sites October 28, 2010: Updated for Internet Explorer Platform Preview Build 6 with information about: CSS 2D Transforms HTML5 Semantic Elements Fixed supported ICC color profiles version number February 10, 2011: Updated for Internet Explorer 9 Release Candidate with information about: HTML5 Geolocation Pinned Sites (updated) Compatibility Mode (updated) Other miscellaneous document fixes February 18, 2011: Updated with additional information about: Pinned Sites HTML5 Canvas March 14, 2011: Updated for Internet Explorer 9 (RTW): updated version text ECMAScript 5 (added links)
CSS3 2D Transforms
Internet Explorer 9 adds support for CSS3 2D Transforms. CSS 2D Transforms enables elements that are rendered by CSS to be transformed in two-dimensional space. Internet Explorer 9 supports the following 2D Transforms properties: The -ms-transform property applies one or more twodimensional transformation function to an element. The -ms-transform-origin property establishes the origin of transformation for an element. This property is useful when you want to change the default origin (the center).
Note Because the CSS 2D Transforms module has not yet received Candidate Recommendation status from the W3C, both the transform and transform-origin properties must be used with the -ms- prefix to be recognized by Internet Explorer 9. For more information on vendorspecific prefixes, see IE9, Vendor Prefixes, and Developers on the IE Team Blog. Internet Explorer 9 supports the following transformation functions for use with the -ms-transform property: The matrix(a,b,c,d,e,f) function specifies a 2D transformation in the form of a transformation matrix of six values (a through f). The translate(tx,[ty]) function specifies a 2D translation by the vector [tx,ty], where tx is the first translation-value parameter and ty is the optional second translation-value parameter. If ty is not specified, its value is zero. (Translation-value parameters can be either percentages or lengths.). The translateX(tx) function specifies a translation by the given
amount in the x direction. The translateY(ty) function specifies a translation by the given amount in the y direction. The scale(sx,[sy]) function specifies a 2D scale operation by the [sx,sy] scaling vector that is described by the two parameters. If the second parameter is not provided, it takes a value equal to the first. The scaleX(sx) function specifies a scale operation by using the [sx,1] scaling vector, where sx is given as the parameter. The scaleY(sy) function specifies a scale operation by using the [1,sy] scaling vector, where sy is given as the parameter. The rotate(angle) function specifies a 2D rotation by the angle specified in the parameter about the origin of the element, as defined by the transform-origin property. The skewX(ax) function specifies a skew transformation along the x-axis by the given angle. The skewY(ay) function specifies a skew transformation along the y-axis by the given angle. The skew(ax,[ay]) function specifies a skew transformation along the x- and y-axes. The first angle parameter specifies the skew on the x-axis. The second angle parameter specifies the skew on the y-axis. If the second parameter is not given, a value of zero is used for the y angle (that is, no skew on the y-axis).
The -ms-transform-origin property accepts one or two values. Each value can be a keyword, a length, or a percentage. If the -ms-transform-origin property is not set, the transform begins in the center (equal to a -mstransform-origin value of 50% 50%). The first value indicates the horizontal position (the position along the x-axis), and can be negative. This value can be a length value (in any of the supported length units), a percentage (of the total box length), or one of the following three keywords: left (equal to 0% or a zero length), center (equal to 50% or half the box length), or right (equal to 100% or the full box length). The second value indicates the vertical position (the position along the y-axis), and can be negative. This value can be a length value (in any of the supported length units), a percentage (of the
total box height), or one of the following three keywords: top (equal to 0% or a zero height), center (equal to 50% or half the box height), or bottom (equal to 100% or the full box height). If only one value is specified, the second value is assumed to be center. Consider the following markup. div { -ms-transform: translate(200px, 100px) scale(.75, .75) rotate(40deg); -ms-transform-origin: 60% 100%; } In Internet Explorer 9, setting the -ms-transform-origin property to 60% 100% sets the transforms origin point to 60% of the length and 100% of the height of the element to be transformed. The -ms-transform property first moves the element 200 pixels in the x direction and 100 pixels in the y direction. It then scales the element by 75%. Finally, it rotates the element 40 degrees clockwise around the origin point set by the -ms-transform-origin property. For more information on CSS3 2D Transforms, see MSDN.
Internet Explorer 9 also adds functionality to the following existing CSS background and border properties:
background-color: Supports CSS3 Color. background-image: Supports multiple values and SVG images. background-repeat: Supports multiple values, plus the space and round values. background-attachment: Supports multiple values, plus the local value. background-position: Supports multiple values. background: Updated for CSS3. border-color: Supports CSS3 Color.
border-radius (The value given will specify the radius for all four corners of a box.) border-bottom-left-radius border-bottom-right-radius border-top-left-radius border-top-right-radius
For example, take a look at the following markup: border-radius: 100px 66.66px 200px 50px; border: 10px blue double; padding: 24px; width: 400px;height: 125px; This will generate the following when applied to a text block.
identical to those of the RGB color model, and are expressed as integers or percentages. The alpha component is expressed as a value between 0.0 (completely transparent) and 1.0 (completely opaque). For instance, to set the background color to red with 50% transparency, you can include either of the following two CSS declarations in your style sheet: background-color: rgba(255,0,0,0.5); background-color: rgba(100%,0%,0%,0.5); Be aware that though RGB values support hexadecimal notation, RGBA values do not.
<div style="background: navy; opacity: 0.2;"></div> <div style="background: navy; opacity: 0.4;"></div> <div style="background: navy; opacity: 0.6;"></div> <div style="background: navy; opacity: 0.8;"></div> <div style="background: navy; opacity: 1;"></div> </div> This example generates the following output for a 25125-pixel div.
Color Keywords
The CSS3 Color module makes the list of color keywords for CSS identical to that for SVG 1.0. Though SVG support is new in Internet Explorer 9, this change was implemented in Internet Explorer 8. Internet Explorer 9 introduces the CSS3 Color modules currentColor keyword, which indicates the current value of the color property on any property that accepts color. When set on the color property itself, currentColor is equivalent to color:inherit. Internet Explorer 9 also expands the use of the transparent keyword beyond the border-color and background-color properties. It can now be used with any property that accepts the color property.
Font Properties
The font-weight property has been updated so that Internet Explorer 9 calculates font weights as specified in the CSS3 Fonts Module.
The font-size property has been updated so that each keywords scaling factor is as defined in the CSS3 Fonts Module. Also, keywords and HTML heading sizes are now mapped as specified in the CSS3 Fonts Module. The font-stretch property is new in Internet Explorer 9, and selects a normal, condensed, or expanded face from a font family. This property is also available as a @font-face rule descriptor.
Ensured backward compatibility with continued support for Embedded OpenType (EOT) Added support for the Web Open Font Format (WOFF), which
repackages sfnt-based font files (TrueType, OpenType, and Open Font Format fonts) by compressing each table individually using a ZIP compression format Added support for installable (no embedding permission bits set) raw TrueType fonts
To see an example of web fonts in Internet Explorer 9, see the Web Fonts or More Web Fonts demos on the Internet Explorer Test Drive For more information on CSS3 fonts in Internet Explorer 9, see MSDN.
recolored green. The following example styles an SVG element. @namespace svg|circle {fill:red;} svg "http://www.w3.org/2000/svg";
Using the namespace and declaration from this example, all circles created with SVG will be given a red fill. For more information, see the @namespace rule reference page on MSDN.
deg: degrees (angle unit) grad: grads (angle unit) rad: radians (angle unit) turn: turns (angle unit) ms: milliseconds (time unit) s: seconds (time unit) rem: font size of the root element (relative length unit) vw: viewport width (relative length unit) vh: viewport height (relative length unit) vm: smaller of viewport width or height (relative length unit) ch: zero-width (width of the zero glyph in the rendering font; relative length unit)
In addition, Internet Explorer 9 updates the attr() function that is used for generated content. It can now be applied on any property and accept multiple arguments. The following CSS3 function is new for Internet Explorer 9:
calc(): calculates values using arithmetic operators and is usable wherever length values are allowed
For more information on CSS functions, see CSS Values and Units Reference on MSDN.
CSS3 Selectors
Internet Explorer 9 supports the additions to CSS Selector syntax specified in the CSS3 Selectors Proposed Recommendation. Listed here are the selectors that are new for Internet Explorer 9. (For full details about selector support in Internet Explorer, see CSS Compatibility and Internet Explorer on MSDN.) For more information, see the CSS Selectors reference section on MSDN. To see an example of CSS3 selectors in action, go to the Internet Explorer Test Drive site.
Structural Pseudo-Classes
Structural pseudo-classes enable selection based on extra information in the document tree that cant be selected using simple selectors or combinators. The following selects an E element that is the root of the document. E:root The following selects an E element that is the n-th child of its parent. E:nth-child(n) The following selects an E element that is the n-th child of its parent, counting from the last one. E:nth-last-child(n) The following selects an E element that is the n-th sibling of its type. E:nth-of-type(n) The following selects an E element that is the n-th sibling of its type, counting from the last one. E:nth-last-of-type(n) The following selects an E element that is the last child of its parent. E:last-child The following selects an E element that is the first sibling of its type. E:first-of-type
The following selects an E element that is the last sibling of its type. E:last-of-type The following selects an E element that is the only child of its parent. E:only-child The following selects an E element that is the only sibling of its type. E:only-of-type The following selects an E element that has no children (including text nodes). E:empty
E:checked The :indeterminate pseudo-class selects radio buttons and check boxes whose toggle states cannot be determinedthey are neither checked (selected) nor unchecked (cleared). The following selects an E form control element whose state cannot be determined. E:indeterminate Note The :indeterminate pseudo-class is no longer defined in the current CSS3 specification, but is supported in many popular browsers.
ClientRect (TextRectangle) interface o width property o height property Additions to Range interface o getBoundingClientRect method o getClientRects method Screen interface o pixelDepth property Screenview interface o innerWidth property o innerHeight property o pageXOffset property o pageYOffset property o screenX property o screenY property o outerWidth property o outerHeight property
state of interoperability between Internet Explorer 9 and other browsers. It also simultaneously delivers performance gains in many scenarios, due mainly to DOM objects that are represented as native JavaScript objects. The enhanced DOM extends a wide array of new capabilities provided by Chakra, the new JavaScript engine into the objects and APIs provided by the DOM, including:
Selective DOM object extensibility (through Object.preventExtensions) DOM API mutability (by mutating the DOM APIs property descriptors or deleting properties entirely) JSON support of DOM objects Native JavaScript Object features via inheritance (hasOwnProperty, toString, etc.) Native JavaScript Function features via inheritance (call, apply, bind)
These features unify the programming experience between the JavaScript engines native objects and the DOM. In addition the following new DOM features have been added:
W3C DOM exceptions: DOM exceptions are new types of error objects that are thrown as a result of DOM API failures. The error codes for these exceptions map to constants defined on the exception itself. W3C DOM const properties (for instance, Node.ELEMENT_NODE): The const properties are simple fields that provide names for many common numerical return values from other DOM APIs. For example, the number returned by the nodeType DOM API can be compared against the constant to make more readable code: if (myElement.nodeType == Node.ELEMENT_NODE)
var parser = new DOMParser(); var doc = parser.parseFromString("<test>Some XML</test>", "text/xml"); The following script example shows to serialize a DOM node (including nodes from HTML documents) to an XML string by using the XMLSerializer interface: var serializer = new XMLSerializer(); var xmlString = serializer.serializeToString(doc);
It also adds interoperable support for DOM namespaces, such as support for *NS methods and namespace-related properties (createElementNS, namespaceURI, localName, prefix, and others). Internet Explorer 9 also supports many of the most commonly used DOM L3 Core methods and properties:
adoptNode compareDocumentPosition CDATASection importNode inputEncoding isDefaultNamespace isEqualNode isSameNode isSupported lookupNamespaceURI lookupPrefix replaceWholeText textContent
Internet Explorer 9 fully supports both DOM L2 Views properties. For more information, see the DOM Core and Views reference section on MSDN.
Event registration and dispatch APIs (addEventListener, removeEventListener, createEvent, and dispatchEvent) Event capture, bubble, and target phases New event objects (KeyboardEvent, MouseEvent, MutationEvent, and so on; CustomEvent for applicationspecific events; as well as event object interfaces for event types from other standards, such as DragEvent New standards-based event types (composition events, text events, wheel events, DOM mutation events, and so on) from HTML5)
Note DOM Mutation events are included for completeness, but are deprecated in the W3C standard.
DOM L2 HTML
Internet Explorer 9 adds support for the DOM L2 HTML APIs that were not available in previous versions of Internet Explorer, including HTML5 APIs such as getElementsByClassName and characterSet. Internet Explorer 9 has improved the object model in tables, particularly with respect to DOM operations for adding or removing elements. getElementsByClassName The getElementsByClassName method returns all element nodes that have class attributes matching the input string. Its functionality is similar to that of the getElementsByTagName method. characterSet The characterSet attribute returns the preferred MIME name of the character encoding of the current document.
DOM L2 Style
The DOM L2 Style specification defines APIs to programmatically access and change both the styles of individual elements and entire style sheets by removing or modifying rules. Previous versions of Internet Explorer were able to accomplish these tasks using proprietary methods; Internet Explorer 9 adds support for the standardized APIs defined in the DOM L2 Style specification. In addition, support has been added for standardized APIs that have no equivalent in Internet Explorer, such as the getComputedStyle method. See an example of the getComputedStyle method in action on the Internet Explorer Test Drive site. For more information, see DOM Style on MSDN.
For more information, see DOM Range on MSDN. The DOM Traversal portion of the DOM L2 Traversal and Range specification defines a way for you to move around in a document and filter out nodes as necessary. Internet Explorer 9 supports both the two ways to traverse the DOM (NodeIterator and TreeWalker), and the two ways to filter nodes (whatToShow and NodeFilter) that are defined in the W3C specification. For more information, see DOM Traversal on MSDN.
ECMAScript 5
Internet Explorer 9 introduces enhancements to the JavaScript language feature in addition to improved JavaScript performance. In December 2009, ECMA approved the Fifth Edition of ECMA-262 as the successor to the Third Edition (a Fourth Edition was never published), and that same year, Microsoft debuted elements of ECMAScript 5 (ES5) support when native JSON support for JavaScript objects was added to Internet Explorer 8 and Accessor Support for DOM objects was added to Internet Explorer 8. Beyond JSON and DOM Accessor support, though, ES5 standardizes many significant enhancements to the JavaScript language. There are many important ECMAScript 5 features implemented in Internet Explorer 9, including the following:
New array methods: every, filter, forEach, indexOf, isArray, lastIndexOf, map, reduce, reduceRight, some Enhanced object model and object functions: Object.create, Object.defineProperties, Object.defineProperty, Object.freeze, Object.getOwnPropertyDescriptor, Object.getOwnPropertyNames, Object.getPrototypeOf, Object.isExtensible, Object.isFrozen, Object.isSealed, Object.keys, Object.preventExtensions, Object.seal Other computational methods and functions: Date.now, Date.parse support for ISO Date Format, Date.toISOString, Function bind, String trim
Internet Explorer 9 also corrects several issues present in the previous implementations of JavaScript in Internet Explorer. For more information, see the Internet Explorer Team Blog. To see ECMAScript 5 support in action, go to the Internet Explorer Test Drive site.
HTML5
Support for some features of the HTML5 Working Draft specification was introduced in Internet Explorer 8, including:
DOM Storage, defined as part of the HTML5 Web Storage specification. Ajax Navigation, implemented via the window.location.hash property and the onhashchange event, both of which are defined in the History Traversal section of the HTML5 specification. Cross-document messaging, implemented via the postMessage method and the onmessage event, which are both specified as part of the HTML5 Web Messaging module.
Internet Explorer 9 builds on the work done on HTML5 compliance in Internet Explorer 8, and implements the following new features:
HTML5 Geolocation APIs The new video and audio HTML elements The new canvas HTML element The Selection interface More interoperable HTML parsing Several new DOM APIs, as discussed in the DOM L2 HTML section of this document Scaling Vector Graphics (SVG)
Note It is important to remember that, as of this writing, the HTML5 specification is still in the Working Draft stage. Until it reaches the Candidate Recommendation stage, it could change significantly. For more information, see the latest HTML5 working draft.
HTML5 Geolocation
Internet Explorer 9 adds support for geolocation. The Geolocation API enables a web application to access the current geographical location of the PC running Internet Explorer. The webpage can then tailor the user experience according to the location, for instance, to display the position on a map or display up-to-date local information, such as weather or news reports. Location data is returned in terms of latitude and longitude coordinates. The geolocation APIs in Internet Explorer 9 conform to the standards set forth in the Geolocation API Specification.
To see geolocation in action, see the Internet Explorer 9 Test Drive site. For more information on geolocation, see MSDN.
<source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> </video> Here, Internet Explorer 9 picks the first listed supported format (in this case, the second source element) and plays its associated source file. The audio element is defined similarly to the video element, but without the width, height, and poster attributes. To see an example of the audio element in action, go to the Internet Explorer Test Drive site. Internet Explorer 9 supports the following content formats: Element name video
Supported formats MP4 container, H.264 video, Baseline, Main, and High profilesaudio in AAC or MP3 WebM video, if you have the VP8 codec installed MP3, and AAC in MP4 container
audio
download a separate plug-in. Because of APIs defined by the CanvasRenderingContext2D object, canvas enables the following drawing scenarios that include:
rectangles lines fills arcs shadows Bzier curves quadratic curves images video
You can use JavaScript to animate canvas drawings or make interactive experiences that can react to keyboard input, mouse clicks, or any browser event. For instance, this example on the Internet Explorer Test Drive site produces, with just a few lines of JavaScript, randomly placed and colored glowing lines. The canvas element in Internet Explorer 9 supports the width and height attributes. (The default values for width and height are 300 and 150 pixels, respectively, and the default color is transparent black.) Internet Explorer 9 supports the following Canvas 2D Context APIs (members exposed by the CanvasRenderingContext2D object):
the canvas property (back reference to the canvas object) state methods (save, restore) transformation methods (scale, rotate, translate, transform, setTransform) compositing properties (globalAlpha, globalCompositeOperation) color and style properties (strokeStyle, fillStyle) the CanvasGradient object and methods (addColorStop, createLinearGradient, createRadialGradient) the CanvasPattern object and method (createPattern) line attributes (lineWidth, lineCap, lineJoin, miterLimit) shadow attributes (shadowColor, shadowOffsetX, shadowOffsetY, shadowBlur) rectangle methods (clearRect, fillRect, strokeRect) complex shapes methods (beginPath, moveTo, closePath, lineTo, quadraticCurveTo, bezierCurveTo, arcTo, arc, rect, fill, stroke, clip, isPointInPath) the TextMetrics interface (CanvasTextMetrics object), its property (width) and text methods and attributes (font, textAlign, textBaseline, fillText, strokeText, measureText) the images method (drawImage)
the ImageData interface (CanvasImageData object), its properties (data, height, and width) and pixel manipulation methods (createImageData, getImageData, putImageData) the CanvasPixelArray object and its property, length
For a more in-depth introduction to HTML5 Canvas in Internet Explorer 9, see MSDN. Additionally, visit the Internet Explorer Test Drive site to view more demonstrations of the canvas element. For technical information on the canvas element in Internet Explorer 9, see the canvas element reference page on MSDN.
Parsing XHTML
Internet Explorer 9 will parse documents with a mime-type of application/xhtml+xml as XHTML.
Generic Elements
Previously, Internet Explorer would parse elements it didnt recognize as unknown elements. These elements would be flattened, which kept normal CSS styling rules from applying to them, and was not compliant with the HTML5 draft specification. Internet Explorer 9 changes this behavior, and now parses unrecognized elements as generic elements, allowing them to function like normal elements do. This obviates the need for developer workarounds, like calling document.createElement to force Internet Explorer to recognize an element. Following is a simple example of a generic elementin this case an undefined element called mydiv. <style type="text/css"> mydiv { color: blue; font-weight: bold; } </style>
... <p>I am using a <mydiv>generic element</mydiv> in this sentence.</p> Internet Explorer 8 ignores the mydiv tag and its associated CSS rules. This sentence renders as follows.
Internet Explorer 9 parses the mydiv tag as expected, and renders the following.
Overlapping Tags
If your HTML contains overlapping tags, Internet Explorer 8 and earlier versions do not resolve them at parse time. This behavior is contrary to what is specified in the HTML5 draft specification. If you have overlapped some elements for scripting purposes (such as the one illustrated here), this can lead to confusing scripting errors. Internet Explorer 9 follows the HTML5 draft spec and resolves overlapping tags at parse time. Following is a simple example of a script that turns text between overlapping i and b tags red. <script type="text/javascript"> function load() { var elms = document.getElementsByTagName("i"); for(var i = 0; i < elms.length; i++) { var elm = elms[i]; if(elm.parentNode.tagName.toLowerCase() == "b") elm.style.color = "red"; } } </script> ... <body onload="load();"> You should be aware of how <b>this <i>affects</b> script</i>. </body> In Internet Explorer 8 and earlier, this markup results in an unintended
rendering.
Parsing changes to script and style blocks Internet Explorer 8 and earlier versions do not persist text, in either a script or style block, to text nodes in the DOM. Internet Explorer 9 persists text in script or style blocks to the DOM as text nodes, as expected. This makes source code available in the DOM as a text node so you can manipulate it with script.
semantic elements:
The elements now inherit from HTMLElement interface, rather than from HTMLUnknownElement interface, as specified in the HTML5 specification. By default, the elements are now styled as specified in the HTML5 specification.
section nav article aside hgroup header footer figure figcaption mark
Most SVG document structure, interactivity (scripting events), and styling (inline and through CSS) Many presentation elements and their corresponding attributes and DOM interfaces, including: o basic shapes o filling, stroking, marker, and color o gradients and patterns o paths o text
object (that is, simply include an <svg> tag within your HTML) SVG as full document type (with .svg file extension) SVG in XML or XHTML (similar to the HTML5 method, only with XML or XHTML files) SVG as a CSS image SVG using the object element, as in the following (note the type, height, and width attributes): <object data="rect2.svg" width="100%" height="400px" type="image/svg+xml"></object>
SVG using the img, embed, iframe, or frame elements, as in the following:
<embed id="Smiley" src="smiley.svg" type="image/svg+xml"> For more information about SVG support in Internet Explorer 9, see MSDN. For more information about SVG, see the svg element reference page on MSDN.
Basic Shapes
Internet Explorer 9 introduces support for the parsing and rendering of all the basic shapes elements, their attributes, and associated DOM interfaces, as specified in the Basic Shapes module of the SVG 1.1 (Second Edition) specification. The set of basic shapes supported by Internet Explorer 9 consists of the following shapes elements:
Internet Explorer 9 also supports these elements associated DOM interfaces. Following are examples of each of the aforementioned shapes elements. After the markup is a screenshot of the corresponding result in Internet Explorer 9.
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg"> <rect fill="orange" stroke="black" width="150" height="75" x="50" y="25" /> </svg>
For more information, see the rect element reference page on MSDN.
For more information, see the circle element reference page on MSDN.
For more information, see the ellipse element reference page on MSDN.
For more information, see the line element reference page on MSDN.
For more information, see the polyline element reference page on MSDN.
For more information, see the polygon element reference page on MSDN.
Clipping
A clipping path cuts or clips the area that a color, pattern, or image can be drawn. All parts of the graphical element that lie outside the clipping path are not drawn. Clipping paths are fully opaque; the portion of the graphical element that is outside the clipping path is completely invisible. In SVG, the overflow and clip properties establish initial clipping paths, or shapes in which content will be displayed. By default, the initial clipping path is defined as the SVG viewport, or the rectangular area of the page where the SVG content is displayed. The clipPath element defines a clipping path. The clipping path is then referenced using the clip-path property. The clip-rule property applies to graphic elements within a clipPath element, and the clipPathUnits attribute defines a coordinate system for the contents of the clipPath. Clipping paths can be applied to text as well as colors, patterns, and images. Clipping functionality can be accessed programmatically with the SVGClipPathElement DOM interface. Following is a simple example of an SVG clipping path. <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="100"> <clipPath id="clip1"> <circle id="clipShape" cx="60" cy="60" r="50" /> </clipPath> <rect x="20" y="20" width="100" height="100" fill="blue" clip-path="url(#clip1)" /> </svg> This example uses the clipPath element to define a clipping path in the shape of a circle. The clip-path property is then used to apply the clipping path to a rectangle. This produces the following in Internet Explorer 9.
Masking
A mask is similar to a clipping path, except it is semi-transparent. Masks are often used for compositing foreground objects into the current background. The mask element defines a mask. The mask is then referenced using the mask property. The following is a simple example of an SVG mask. <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="4cm" height="4cm" viewBox="0 0 800 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <desc>Example mask01 - three different colored circles used to mask the color of a rectangle </desc> <defs> <g id="circles"> <g stroke="white" stroke-width="2" > <circle cx="100" cy="50" r="50" fill="rgb(255,0,0)" /> <circle cx="50" cy="135" r="50" fill="rgb(0,255,0)" /> <circle cx="150" cy="135" r="50" fill="rgb(0,0,255)" />
</g> </g> <mask id="myMask" > <use xlink:href="#circles" /> </mask> </defs> <rect x="0" y="0" width="100%" height="100%" fill="purple" mask="url(#myMask)" /> </svg> This example uses the mask property to define a mask in the shape of three adjacent circles with different colors. The mask property is then used to apply the mask to a purple rectangle. This produces the following in Internet Explorer 9.
Units and percentages. Arbitrary transformations on any element and the transform attribute. The viewBox and preserveAspectRatio properties (including interaction with the overflow property). Support for transforms and transform list types.
Internet Explorer 9 also supports the DOM interfaces associated with SVG coordinate systems and transformations.
Document Structure
Internet Explorer 9 introduces support for basic SVG document structure, metadata, and extensibility functionality, as specified in the Document Structure, Metadata, and Extensibility modules of the SVG 1.1 (Second Edition) specification. The elements supported by Internet Explorer 9 include:
svg desc
Gradients
Gradient support is provided through the gradient elements (linearGradient and radialGradient) and attributes (gradientUnits and gradientTransform). Gradient colors are defined by the stop element. The gradient elements can be used in the fill and stroke properties of SVG shapes. For example, consider the following markup: <svg version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="MyGradient"> <stop offset="10%" stop-color="yellow" /> <stop offset="90%" stop-color="blue" /> </linearGradient> </defs> <rect fill="url(#MyGradient)" stroke="black" stroke-width="5" x="20" y="20" width="300" height="100"/> </svg> This markup defines a rectangle with a linear gradient. The two stop elements specify color stops along a vector for the color transitionsa yellow one at the 10% point and a blue one at the 90% point. This appears as follows in Internet Explorer 9:
Patterns
Pattern support is provided through the pattern element and its attributes. Like gradients, pattern elements can be used in the fill and stroke properties of SVG shapes. For example, consider the following markup. <svg version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <pattern id="mycircleandsquare" patternUnits="userSpaceOnUse" x="0" y="0" width="150" height="100"> <circle cx="50" cy="50" r="10" fill="yellow" stroke="blue" /> <rect x="100" y="0" width="50" height="50" fill="blue" stroke="yellow" /> </pattern> </defs> <ellipse fill="url(#mycircleandsquare)" stroke="black" stroke-width="5" cx="400" cy="200" rx="350" ry="150" /> </svg> In this example, the pattern element defines a pattern that consists of an alternating small blue square and tiny yellow circle. The ellipse that is then specified is given a fill of the pattern. The following image shows how this appears in Internet Explorer 9.
Interactivity
SVG content can be interactivethat is, it can change in response to user input. Internet Explorer 9 supports SVG interactivity features, as specified in the Interactivity module of the SVG 1.1 (Second Edition) specification, including:
mouse events: o mousedown o mouseup o click o mouseover o mousemove o mouseout cursor/pointer events: o focusin o focusout o activate the Interactivity modules
Additionally, the Internet Explorer 9 supports the focusable attribute as specified in the Interactivity module of the SVG Tiny 1.2 specification. The following markup shows a very simple example of SVG interactivity in action. <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600"> <script type="text/ecmascript"> <![CDATA[ // object representing circle var redcircle; // variable representing circle's radius var r; window.onload = function() { redcircle = document.getElementById('redcircle'); r = parseInt(redcircle.getAttribute("r")); } var grow = function() { r = 2*r; redcircle.setAttribute("r",r); } var shrink = function() { r = r/2; redcircle.setAttribute("r",r); } ]]>
</script> <circle id="redcircle" cx="100" cy="100" r="50" fill="red" onmousedown="grow()" onmouseup="shrink()"/> </svg> When this snippet is loaded, it displays a small red circle.
The same effect can be achieved with mouseover and mouseout events, which will cause the circle to grow and shrink just by moving the cursor over and off of it. ... <circle id="redcircle" cx="100" cy="100" r="50" fill="red" onmouseover="grow()" onmouseout="shrink()"/> ...
Linking
Just like in HTML, the a element is used to create a hyperlink in SVG. For instance, the following markup provides a hyperlink on a rectangle. <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <a xlink:href="http://www.bing.com" target="_blank"> <rect x="20" y="20" width="250" height="250"/> </a> </svg>
Views
Views can be used to instruct the browser to display an SVG image in a certain way. For instance, the following markup defines a link to a view. ... <a xlink:href="#rect-view"> <text x="320" y="70" style="fill:red">Go to Rectangle</text> </a> <view id="rect-view" viewBox="280 245 135 85" /> <rect id="rect-object" style="fill:red" x="280" y="245" width="135" height="85"/> ... In this example, the rect-view view is defined as a viewBox with the given coordinates. When the link (the text Go to Rectangle) is clicked, the rect-view view appears, which reveals the red rectangle. The following markup defines another link to a view. ... <a xlink:href="#circle-view"> <text x="250" y="70" style="fill:blue">Go to Circle</text> </a> <view id="circle-view" viewBox="5 36 128 115" preserveAspectRatio="none"/> <circle id="circle-object" style="fill:blue" cx="70" cy="85" r="45"/> ...
In this example, the circle-view view has the attribute preserveAspectRatio set to none. This means that, even though the shape is a circle, it will not scale uniformly to fill the specified viewBox rectangle when the view is invoked. Instead, it will stretch non-uniformly so that its bounding box exactly matches the viewBox rectangle. This markup appears as follows in Internet Explorer 9 when the page is first loaded.
When you click Go to Circle, the circle-view view is invoked, and the circle is stretched to fill the viewBox rectangle. This makes it appear to be an ellipse.
fill properties: o fill o fill-rule o fill-opacity stroke properties: o stroke o stroke-width o stroke-linecap o stroke-linejoin o stroke-miterlimit
o o o
stroke-dasharray stroke-dashoffset stroke-opacity visibility properties: o display o visibility the marker element painting inheritance (Paint is automatically inherited on containing elements.) the color property
The Painting modules associated DOM interfacesSVGPaint and SVGMarkerElementare also supported. Several examples of fills and strokes in SVG are included in the Paths section of this document.
Paths
SVG paths are outlines of shapes. They can be filled in, stroked (a line is drawn along the path), or used as clipping paths (cutouts of other shapes). Internet Explorer 9 introduces support for SVG paths, as specified in the Paths module of the SVG 1.1 (Second Edition) specification. This includes support for the path element, as well as the d property, which enables parsing of path data. The Paths modules associated DOM interfaces are also supported. The path element enables many different developer scenarios. Following are just a few simple examples. After the markup is a screenshot of the corresponding result in Internet Explorer 9.
</svg>
Text
SVG documents can include text. Text is rendered just like other graphic elements in SVG, which means that coordinate system transformations, painting, clipping, and masking can all be applied to text. Internet Explorer 9 supports text rendering, as specified in the Text module of the SVG 1.1 (Second Edition) specification. The text element specifies the characters to be drawn. Because SVG does not break lines or wrap words automatically, you must determine line breaks in advance. To adjust text properties (such as font, weight, color, kerning, and many others) within a line of text, SVG provides the tspan element. Internet Explorer 9 also supports the Text modules associated DOM interfaces.
Tear off a tab by clicking and dragging it to the taskbar Drag the favorites icon (favicon) from the address bar to the taskbar Drag a custom image with the msPinSite class (a drag-to-pin image) to the taskbar
After a site is pinned, it renders with custom enhancementsfor instance, the Back and Forward buttons match the color scheme of the website. Sites can also be pinned to the Start menu.
Jump Lists
Jump List tasks are application-specific actions that are tailored to a pinned website. They are based on the same feature for applications in Windows 7. By using Jump List tasks, a website can surface its most frequently used commands to users. You can define Jump List tasks based on both your websites features and the key actions a user is expected to perform. The tasks provide a set of static links that users can access at any time, even if Internet Explorer is not running. For more information about Jump List tasks, see How to Create Dynamic Jump Lists on MSDN.
Thumbnail Toolbars
A thumbnail toolbar is essentially a remote control for your website. The toolbar appears underneath the thumbnail preview when you hover over a pinned site's taskbar button. This feature is especially useful for sites that implement video or audio playback, but thumbnail toolbars have many potential uses. Thumbnail toolbar buttons might include controls for controlling playback, adding or sharing favorites, search, changing online status, instant purchases, or rating webpages. For more information about creating thumbnail toolbars, see How to Create Thumbnail Toolbars on MSDN.
Notifications
Just like applications in Windows 7, pinned sites can communicate notifications and status to users by displaying an overlay icon on top of the pinned sites taskbar button. Overlay icons help draw attention to a website when the view to the pinned sites window is blocked, for instance, when the browser window is minimized or blocked by another window. You can use overlay icons to supply important status information or notifications such as network status, online status, or new mail. For more information about notifications, see How to Provide Notifications on MSDN.
and images; and providing a first-run experience that advertises the features of your pinned site after the user pins the site for the first time. For more information on discoverability, see How to Improve Discoverability on MSDN. For how-to information and code samples about pinned sites, see the MSDN Developer Center on Pinned Sites. For a demonstration of pinned sites, see the Internet Explorer 9 Test Drive site.
Platform Versioning
Internet Explorer 8 introduced document compatibility modes, which are an extension of the compatibility mode introduced in Microsoft Internet Explorer 6. Document modes enable you to choose the specific rendering mode that Internet Explorer uses to display your web pages, and are described in detail in Defining Document Compatibility on MSDN.
The user-agent (UA) string identifies the browser to host servers and provides certain system details. (For more information about UA strings, see Understanding User-Agent Strings on MSDN.) Internet Explorer 9 is different from previous versions of Internet Explorer in that it sends the short UA string by default. This change improves overall performance, interoperability, and compatibility. Internet Explorer 9 will no longer send additions to the UA string made by other software installed on the users machine, such as .NET and others. Internet Explorer 9 sends the new Internet Explorer 9 UA string. There are four changes to the UA string for Internet Explorer 8 that developers need to be aware of: 1. The application version is incremented from Mozilla/4.0 to Mozilla/5.0 to match other browsers. This change signals that Internet Explorer 9 is an interoperable browser. 2. The version token is incremented from MSIE 8.0 to MSIE 9.0. 3. The Trident token is incremented from Trident/4.0 to Trident/5.0. 4. Internet Explorer 9 will send the following short UA string without additions made by other software that is installed on the computer:
Console Tab
F12 developer tools in Internet Explorer 9 introduces a Console tab for exposing scripting events. When you inspect script, several toggle buttons appear: Error, Warning, and Message. Each button displays the number of messages of each type.
Network Tab
Internet Explorer 9 adds a network inspection tool to its developer tools. Access the tool by clicking the Network tab. You can then:
Capture HTTP and HTTPS network traffic. Display (and save) the contents of captured requests and responses. Display extra details about captured data, such as cookies, sizes, timings, and cache information.
Data URIs
The data URI is a means of directly embedding data in the context of a web page. The most common example is a tiny image embedded in a web page, such as the following: data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP When placed in the src attribute of an img element, this text effectively embeds the image in the markup of the page. Internet Explorer 8 introduced data URIs to Internet Explorer. With Internet Explorer 9, developers can now use a data URI in the src attribute of a script element. Plus, the size limit for data URIs has been lifted from 32 kilobytes (KB) in Internet Explorer 8 to 4 gigabytes (GB) in Internet Explorer 9.