HTML and CSS Reference
In-Depth Information
However, this embedding type has become supported in browsers with native SVG support only recently. In
browsers and browser versions that do not support SVG embedding via the img element, the object element can be
used (it cannot be ensured that users have an SVG plug-in installed). Listing 3-56 shows an example.
Listing 3-56. Embedding SVG Using object
<object type="image/svg+xml" data="images/cover.svg" width="400" height="300">
<img src="images/cover.png" alt="Book cover" />
</object>
The disadvantage of the technique is that an image is provided as a general object rather than an image, which is
not optimal from the semantic point of view: the meaning of an element representing an image is logically provided
by the img element with more specific information about the content. The major advantage is that it displays the
alternate (in this case PNG) version of the image in browsers that cannot display SVG. Moreover, object elements are
included in the DOM, which allows the SVG image to be scripted.
The third option for providing SVG content is to write it directly into the XHTML or HTML5 markup. The major
risk associated with the direct SVG embedding in XHTML is that XHTML documents containing inline SVG files
should be valid, served as application/xml or application/xml+xhtml , and have an XHTML DOCTYPE . Otherwise, the
SVG images are not displayed in the browser. Moreover, if XHTML documents are served correctly for browsers with
a real XML parsing, Internet Explorer does not render the document at all (not only the SVG images). 20 This problem
does not exist in HTML5, where direct SVG embedding is a native feature.
Because of these issues, providing external SVG files is generally a better solution especially if the same file (such
as a logo) is used throughout the site.
There are nonstandardized approaches called SVG Support Libraries such as the JavaScript API “Raphaël” [58].
It supports SVG and VML in a manner that all graphical objects are also DOM objects, with the potential to attach
JavaScript event handlers. Raphaël provides a cross-browser solution; however, it requires JavaScript to be enabled
and applies a programmer interface via JavaScript rather than SVG markup. The advantage of Raphaël is that it
provides VML for IE8 or earlier and provides SVG for all browsers with SVG support.
MathML
The Mathematical Markup Language (MathML) is an XML application for describing mathematical annotations on
the Web. It provides content and structure, making it possible to index and process equations.
The first version of the Mathematical Markup Language, MathML 1.0, has become a W3C Recommendation in
1998 [59] and slightly modified in 1999 as MathML 1.01 [60]. After three years of development, MathML2 has obtained
the Recommendation status in 2001, which has been further improved as the second edition until 2003 [61]. After
recognizing the limitations of the second version, several new features have been introduced in MathML3, such as
advanced line breaking and indentation, elementary math notation, alignment of Content MathML with OpenMath,
support for bi-directional languages, new attributes for the math tag, semantic annotations, interaction with the host
environment, linking, and new elements such as mglyph and mpadded [62].
MathML is supported by a variety of applications including web pages, e-books, screen readers, Braille displays,
equation editors, ink input devices, and e-learning and computational software tools. However, the rendering engine
implementation for MathML varies, and no browser provides full MathML support.
Internet Explorer has no native MathML support, and the MathPlayer plug-in has been used for versions up to
IE8. Unfortunately, MathPlayer does not work under IE9. Native rendering support for MathML is available in
Gecko-based browsers such as Firefox and Camino from the first versions and in Safari from version 5.1. Opera
supports MathML since version 9.5. Google added MathML support to Chrome 24 which was removed from later
versions.
20 This problem can be eliminated by specifying the MIME type text/html for Internet Explorer and application/xml for other
browsers on the server.
 
Search WWH ::




Custom Search