<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reinventing Fire &#187; Accessibility</title>
	<atom:link href="http://schepers.cc/category/accessibility/feed" rel="self" type="application/rss+xml" />
	<link>http://schepers.cc</link>
	<description>Technology upside down and backwards</description>
	<lastBuildDate>Sun, 09 Oct 2011 19:47:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Retain Accessibility Immediately</title>
		<link>http://schepers.cc/retain-a11y-immediately</link>
		<comments>http://schepers.cc/retain-a11y-immediately#comments</comments>
		<pubDate>Thu, 30 Jun 2011 04:43:09 +0000</pubDate>
		<dc:creator>Schepers</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://schepers.cc/?p=488</guid>
		<description><![CDATA[<br/>There has been a heated argument recently on the W3C Canvas API mailing list between accessibility advocates and browser vendors over a pretty tricky topic: should the Canvas API have graphical &#8220;objects&#8221; to make it more accessible, or should authors use SVG for that? I think it&#8217;s a false dichotomy, and I offer a proposal [...]]]></description>
			<content:encoded><![CDATA[<br/><p>There has been a <a href="http://lists.w3.org/Archives/Public/public-canvas-api/2011AprJun/0040.html" title="hit testing and retained graphics from Richard Schwerdtfeger on 2011-06-17 (public-canvas-api@w3.org from April to June 2011)">heated argument recently on the W3C Canvas API mailing list</a> between accessibility advocates and browser vendors over a pretty tricky topic: should the Canvas API have graphical &#8220;objects&#8221; to make it more accessible, or should authors use SVG for that?  I think it&#8217;s a false dichotomy, and I offer a proposal to suggests a way to improve the accessibility potential of the Canvas 2D API by defining how SVG and the Canvas 2D API can be used together.</p>
<p>This brings together some ideas I&#8217;ve had for a while, but with some new aspects.  This is still a rough overview, but the technical details don&#8217;t seem too daunting to me.</p>
<p><span id="more-488"></span></p>
<h4 id="Retained-Mode_vs_Immediate-Mode_Graphics">Retained-Mode vs Immediate-Mode Graphics</h4>
<p>First, some background…</p>
<p><b>SVG</b> is a <b>retained-mode</b> graphics format, meaning that each shape persists as a separate object, with distinct characteristics such as location, size (bounding box), and precise outline (stroke).  These characteristics can be acted upon within the object structure (DOM) as discrete entities (or groups of entities) for manipulation by script or by user-interface actions (e.g. mouse clicks or keyboard tabbing); one of these interactions may be <a href="http://en.wikipedia.org/wiki/Hit-testing" class="external text" title="http://en.wikipedia.org/wiki/Hit-testing">hit-testing</a>.</p>
<p>The <b>Canvas 2D API</b> is an <b>immediate-mode</b> API, meaning that it allows the programmer to create visual shapes as individual pixels that are unstructured; in other words, if a red circle and a red square are drawn which overlap one another, there is no way to distinguish these from one another, or from the background canvas element (though a programmer could maintain a separate structure in script).</p>
<p>With <b>retained-mode</b> graphics, each object which is added to the DOM increases the memory &#8220;weight&#8221; of the page or application, potentially slowing down the browser or otherwise decreasing performance; by contrast, <b>immediate-mode</b> graphics, which are not represented as objects in the DOM, do not decrease performance, which is an advantage over <b>retained-mode</b> graphics.</p>
<p>Some accessibility advocates have noted that hit-testing and zooming are critical accessibility features of graphics; this requires the ability to access the location, size, and other characteristics of individual graphics.  Unfortunately, adding this retained-mode feature to an immediate-mode API effectively removes the primary advantage of using an immediate-mode graphics system.</p>
<p>However, by defining how SVG and the Canvas 2D API can be used together, a model may be created which allows authors to easily use both together, each for their appropriate strengths.  This approach involves two aspects: defining the behavior, and a potential shared API syntax.</p>
<h4 id="Defining_Behavior">Defining Behavior</h4>
<p>Currently, the Canvas 2D API is only defined to work with the &lt;canvas&gt; element defined in HTML5, and it does not allow SVG to be drawn or imported into the Canvas.  However, it could be extended to work inside SVG or to allow SVG to be used inside Canvas.</p>
<h5 id="Canvas_in_SVG">Canvas in SVG</h5>
<p>At its simplest, the Canvas 2D API could simply be defined to allow authors to draw on the SVG raster &lt;image&gt; element, just as it does in the HTML &lt;canvas&gt; element, but there does not seem to be a reason to limit it to this element.  The Canvas API could be defined to draw to any SVG element, rendering or structural, as an overlay.  It would be merely a visual effect, and would participate in the rendering structure, including &#8220;z-index&#8221;, only as its &#8220;target element&#8221; does.</p>
<h5 id="SVG_in_Canvas">SVG in Canvas</h5>
<p>SVG shapes could be allowed to be imported into the &lt;canvas&gt; drawing context, such that they render there but are also inserted into the DOM or shadow DOM.  Currently, as I understand it, this is not allowed for security restrictions involving content from potentially different sources, but for content that does not have external references (for example, a &lt;use&gt; element to another site, this should not be a security risk.</p>
<p></p>
<h6 id="SVG_in_the_Shadow_Tree">SVG in the Shadow Tree</h6>
<p>The accessibility features of the Canvas 2D API include a &#8220;shadow tree&#8221; and focus ring for those elements, such as text, which are not otherwise accessible to users with limited vision.  Each such &#8220;graphic piece&#8221; which is created and painted to the screen is also represented in this underlying shadow DOM (IIRC).</p>
<p>SVG elements used in conjunction with Canvas could also be placed in this shadow tree, so that navigability is preserved.  In order to save memory usage, a concept like the &lt;use&gt; element in SVG could alternative be used to &#8220;point to&#8221; an SVG in the main DOM from its appropriate place in the shadow tree.</p>
<p>SVG elements could either be used as visual shapes themselves, or could be invisible &#8220;hot-spots&#8221; for specific areas of the screen.</p>
<h4 id="Common_API">Common API</h4>
<p>I have <a href="http://www.w3.org/Graphics/SVG/WG/wiki/Simple_SVG_API">suggested before</a> that we create a simple graphics API that will allow either 2D Canvas (immediate-mode) or SVG (retained-mode) images with the same set of methods and parameters, with the only difference being which &#8220;mode&#8221; the author selects to have as the instantiated form.  If the author draws a circle to the canvas context, it would simply be drawn to the screen with no structure; if the author draws that same circle to the SVG context, it creates a &lt;circle&gt; element with the appropriate attribute values and style and inserts it into the DOM.</p>
<p>There would be certain differences in some of the renderings, because of the different rendering and compositing models of SVG and Canvas, and there would be certain specialized functionality and features each would have, but the majority of the visual appearance would be the same. </p>
<p>This would allow authors to learn only one API for 2D graphics for the Open Web Platform.  With this ease of learning and use, the author could decide on a case-by-case basis, even within the same application, which mode works best.  It would provide incentive to authors to use each to its best effect.</p>
<p>I call this approach <a href="http://schepers.cc/w3c/svg/api/cog.svg">COG: Common Open Graphics</a>.</p>
<h4 id="Example">Example</h4>
<p>An example of the effective use of SVG and Canvas together is a hypothetical game in which the user pilots a spaceship amidst an asteroid field.  </p>
<p>The background of the game includes animated nebulae, passing comets, rotating planets and moons, and other visual effects which are not interactive, and which do not affect the play of the game, but which add visual appeal.  The foreground of the  game (the &#8220;playable area&#8221;) includes asteroids, enemy ships, and energy beams that the player must dodge or shoot at, which increase in size the closer they get, and which benefit from hit-testing and keyboard focusability. The middle-ground of the game contains many smaller asteroids and ships that are not yet interactive, and so don&#8217;t need hit-testing or focusability.</p>
<p>Adding all of these graphics shapes as retained-mode objects in the DOM would unnecessarily increase the memory footprint of the game, degrading performance and playability.  However, since only a small number of these elements (those in the playable area)  need the retained-mode interactivity, the majority of them could be drawn with immediate-mode characteristics, then when a certain &#8220;distance threshold&#8221; is reached, changed to interactive SVG elements, perhaps using the same shared API.  This preserves the accessibility of the game, while also causing minimal performance degradation, and possibly even helping performance, since the hit-testing doesn&#8217;t need to be calculated in script.  From an authoring point of view, using the same shared API means that both types of shape, retained-mode and immediate-mode, are equally easy to generate and maintain.</p>
<p>To enhance the visual appearance of the SVG asteroids, the finer control of the Canvas API could even draw an overlay on the SVG stroke and fill areas, much as filters do, to show craters and other surface details in a more fine-grained manner then can be done efficiently in SVG.  Since this would be drawn specifically on the SVG element, the element itself would still provide the geometry and position characteristics.</p>
<h4 id="Caveats">Caveats</h4>
<p>This proposal has two caveats:</p>
<ol>
<li> Canvas can only be extended to be as accessible as SVG is, in this model.  Even with object retention, there are still many enhancements needed to make SVG truly widely accessible.  However, as plans for SVG accessibility improvements are made, these would be largely importable directly into the Canvas API, rather than working in parallel on two unrelated but overlapping graphics models.</li>
<li> Simply because the Canvas 2D API may be made more accessible, does not mean that all Canvas API applications or content will be automatically accessible, any more than all HTML or SVG content is accessible.  Authors will still need to use best practices and take specific steps to make their applications accessible.  This proposal only provides the means and the incentive to do so.</li>
</ol>
<h4 id="Feedback">Feedback</h4>
<p>I&#8217;m interested in feedback on this, either in the comments section of this blog, or on the W3C Canvas mailing list, <a href="mailto:&#x70;&#x75;&#x62;&#x6C;&#x69;&#x63;&#x2D;&#x63;&#x61;&#x6E;&#x76;&#x61;&#x73;&#x2D;&#x61;&#x70;&#x69;&#x40;&#x77;&#x33;&#x2E;&#x6F;&#x72;&#x67;">public-canvas-api@w3.org</a>.</p>
<hr />
<h4 id="Update">Update</h4>
<p>Someone pointed out offlist that this post emphasizes the accessibility aspect of this proposal, because that was the context of the most recent discussion, but this is a win for anyone who wants to do graphics in the browser, for any reason, not just accessibility.  Like any good accessibility feature, my proposal has general benefits, so it is more likely to be used in more content.  In the example scenario above, the developer gets the hit testing for free, regardless of whether or not Accessibility Technology is involved.  Other general advantages include ease of learning and use of graphics by developers (as mentioned above), sharing of features between modes (like using <em>Canvas.toDataURL()</em> to save an SVG as a PNG), pixel operations (like painting or detecting a color at a point) in SVG, metadata (like microdata, RDFa, or microformats) in select parts of a Canvas app, and so on.  I&#8217;m sure that clever people will come up with a whole boatload of cool things to do with a combined retained-mode/immediate mode API that I couldn&#8217;t imagine here.</p>
]]></content:encoded>
			<wfw:commentRss>http://schepers.cc/retain-a11y-immediately/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Translation Services at a Loss for Words</title>
		<link>http://schepers.cc/translatesvg</link>
		<comments>http://schepers.cc/translatesvg#comments</comments>
		<pubDate>Tue, 16 Nov 2010 03:27:15 +0000</pubDate>
		<dc:creator>Schepers</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Search Engines]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://schepers.cc/?p=399</guid>
		<description><![CDATA[<br/>Text in SVG is text. Visually, you can use webfonts like WOFF or SVG Fonts (where they are supported, like in Opera or the iPhone) to make it look cool, and you can style both the stroke and fill to make it all fancy, or apply filters to pop it out or make it glow [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Text in SVG is text.  Visually, you can use webfonts like <a href="http://www.w3.org/TR/WOFF/">WOFF</a> or SVG Fonts (where they are supported, like in Opera or the iPhone) to make it look cool, and you can style both the stroke and fill to make it all fancy, or <a href="http://svg-wow.org/filterEffects/chiseled.svg">apply filters</a> to pop it out or make it glow or give it a dropshadow, but it&#8217;s not just a raster image like many text headers&#8230; it&#8217;s human- and machine-readable text, as nature intended.</p>
<p>So, SVG is translatable, right?<br />
<span id="more-399"></span><br />
I wanted to make that point in my talk yesterday at <a href="http://east.webdirections.org/2010/en/program/">Web Directions East</a>, here in Tokyo, so I thought I&#8217;d translate <a href="http://www.w3.org/2010/Talks/11-schepers-webdirectionseast/text.svg">my slide on text in SVG</a><br />
 in real time (<em>note: click the down arrow to step through the bullet points</em>).  But testing it beforehand (I&#8217;m glad I did some prep), neither <a href="http://translate.google.com/translate?js=n&#038;prev=_t&#038;hl=en&#038;ie=UTF-8&#038;layout=2&#038;eotf=1&#038;sl=auto&#038;tl=ja&#038;u=http%3A%2F%2Fwww.w3.org%2F2010%2FTalks%2F11-schepers-webdirectionseast%2Ftext.svg">Google</a> nor <a href="http://www.microsofttranslator.com/bv.aspx?from=&#038;to=en&#038;a=http%3a%2f%2fwww.w3.org%2f2010%2fTalks%2f11-schepers-webdirectionseast%2ftext.svg">Bing</a> even try to translate it.  <a href="http://babelfish.yahoo.com/translate_url?doit=done&#038;tt=url&#038;intl=1&#038;fr=bf-home&#038;trurl=http%3A%2F%2Fwww.w3.org%2F2010%2FTalks%2F11-schepers-webdirectionseast%2Ftext.svg&#038;lp=en_ja&#038;btnTrUrl=Translate">Yahoo&#8217;s Babel Fish</a> at least returns the original page, though it doesn&#8217;t take the extra little step of doing any actual translation.</p>
<p>Lame.</p>
<p>Why don&#8217;t they translate it?  Bing offers this helpful explanation:</p>
<blockquote><p><a href="http://www.microsofttranslator.com/help/#q2q">What text formats are supported?</a><br />
Html and Text. The viewer will not translate text on images, in PDFs, or in Flash graphics and animation. It may also not translate some dynamically generated text, such as in cascading menus.</p></blockquote>
<p>I expected this to work, since <a href="http://googlewebmastercentral.blogspot.com/2010/08/google-now-indexes-svg.html">Google now indexes SVG</a>; as I mentioned in a <a href="http://schepers.cc/formata-non-grata">previous blog post</a>, I made a <a href="http://schepers.cc/svgaccessibility.html">test page back in 2002</a> that sorta conflated the two services, indexing and translating.  But obviously, these are two different tools, and need to be fixed separately.</p>
<p>It would be easy to fix, I&#8217;d expect&#8230; simply add SVG to the list of allowed file types, and translate the text content of each element, just as they do with HTML.  If they actually special-case different element types, that would add slightly more work, but not a lot&#8230; just as with the task of indexing, you would pay attention to the content of the <code>&lt;text&gt;</code>, <code>&lt;tspan&gt;</code>, <code>&lt;textPath&gt;</code>, <code>&lt;title&gt;</code>, and <code>&lt;desc&gt;</code> elements.</p>
<p>It&#8217;s ironic that this doesn&#8217;t work, because on my way back from Lyon last week, I happened to meet <a href="http://www.linkedin.com/profile/view?id=2611357">Bert Esselink</a>, the author of a <a href="http://books.google.com/books?id=QxFg5AC_JZIC&#038;lpg=PP1&#038;ots=lXLrkbuy8-&#038;dq=bert%20Esselink&#038;pg=PP1#v=onepage&#038;q&#038;f=false">book on localization</a> who works for the translation company Lionbridge, and he and I chatted about how they use SVG extensively for their translation work.</p>
<p>In the end, I just had a native speaker translate a couple of text passages (the automatic translations were apparently not very good) and included them in my slide, just to serve as a placeholder. But I&#8217;m hopeful that soon I can demo the automatic translation live.  It would be especially useful to people looking at SVG infographics, to be able to see charts and graphs in their native tongue.</p>
<p><object type="image/svg+xml" width="485" height="485" data="http://schepers.cc/svg/search-engine-infographic.svg">Please use a modern browser.</object></p>
]]></content:encoded>
			<wfw:commentRss>http://schepers.cc/translatesvg/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Underscoring Accessibility</title>
		<link>http://schepers.cc/underscoring-accessibility</link>
		<comments>http://schepers.cc/underscoring-accessibility#comments</comments>
		<pubDate>Wed, 17 Oct 2007 21:57:54 +0000</pubDate>
		<dc:creator>Schepers</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CDF]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.schepers.cc/?p=46</guid>
		<description><![CDATA[<br/>Dramatis Personae Doug Schepers (a Montague) Anne van Kestern (a Capulet) Simon Pieters (a Capulet) Henri Sivonen (a Capulet) Rich Schwerdtfeger (a Franciscan) Aaron Leventhal (an Apothecary) The Prologue Over the past few weeks, there has been a long, drawn-out discussion about how to integrate ARIA (an accessibility specification) into both SVG and HTML in [...]]]></description>
			<content:encoded><![CDATA[<br/><h3>Dramatis Personae</h3>
<ul>
<li>Doug Schepers (a Montague)</li>
<li>Anne van Kestern (a Capulet)</li>
<li>Simon Pieters (a Capulet)</li>
<li>Henri Sivonen (a Capulet)</li>
<li>Rich Schwerdtfeger (a Franciscan)</li>
<li>Aaron Leventhal (an Apothecary)</li>
</ul>
<h3>The Prologue</h3>
<p>Over the past few weeks, there has been a long, drawn-out discussion about how to integrate <a target="_blank" title="Roles for Accessible Rich Internet Applications" href="http://www.w3.org/TR/aria-role/">ARIA</a> (an accessibility specification) into both SVG and HTML in a uniform way.  There have been two main camps, as there usually are in these matters: the XML advocates, and the HTML5 (WHATWG) advocates.  Both sides want to make sure that all content works the same across all browsers, authoring tools, etc. (collectively called User Agents), but they differed in how they thought it should be done.</p>
<p>The XML True Believers have held that the way forward for the Web is to enforce a strict, well-defined syntax for Web languages, and that to extend or combine languages, a differentiating mechanism called &#8220;namespaces&#8221; would be used.  Namespaces in XML are specified to take the form &#8220;schepers:doug&#8221;.  They declared a do-over on HTML, recasting it in the new XML mold (XHTML), and planned for browsers to be stricter on new content, and for authors to have learned their lessons.</p>
<p>The HTML Young Turks came forward with the observation that no matter how well you define a syntax, people will make mistakes (or not know the right way to do things), and that the way to recover from those mistakes is to define error-handling behavior for each kind of mistake; they also believed that since they could now reconcile older &#8220;broken&#8221; content with new browser behavior, that they were constrained to define behavior that would work in all past browsers, as much as possible, and to degrade gracefully in those that didn&#8217;t.  But this required a more rigid parsing mechanism that doesn&#8217;t work well with extensibility, a problem exacerbated by Internet Explorer&#8217;s idiosyncratic and variable (one might even say spasmotic) behavior regarding the colon (&#8220;:&#8221;), meaning XML Namespaces didn&#8217;t work right.  Also, the colon has a special meaning in CSS, yet another wrinkle.</p>
<p>So, XHTML and SVG are based on the XML model, and the new HTML5 is based on the new-old model.  This difference wasn&#8217;t really much of a problem for SVG, though, because SVG and HTML are two different languages&#8230;</p>
<p>But of course people want to use them together.  (More on that in some other post.)</p>
<p>The obvious way around that is to have two different parsers (a parser is a program that reads a formal syntax and makes a model of it for the browser to act on), and when you encountered SVG inside HTML, you would switch to the stricter parser.  HTML would have its model for naming attributes (with no colon), and SVG would have its attributes (with a colon).</p>
<p>But there&#8217;s a hitch.  ARIA is an accessibility technology meant to work in HTML and XHTML and SVG (and other presentation languages).  The functionality for ARIA is defined in its own specification, but it&#8217;s not intended to be used on its own&#8230; it has to be integrated into a host language.  It would be confusing for authors to have to use two different syntaces for the same functionality in different languages.</p>
<p>For example, in SVG you might have:</p>
<pre>&lt;svg version="1.1"
xmlns="<a class="linkification-ext" title="Linkification: http://www.w3.org/2000/svg" href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>"
xmlns:xlink="<a class="linkification-ext" title="Linkification: http://www.w3.org/1999/xlink" href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</a>"
xmlns:xhtml="<a class="linkification-ext" title="Linkification: http://www.w3.org/1999/xhtml" href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"
xmlns:aaa="<a class="linkification-ext" title="Linkification: http://www.w3.org/2005/07/aaa" href="http://www.w3.org/2005/07/aaa">http://www.w3.org/2005/07/aaa</a>"&gt;

&lt;g xhtml:role="checkbox" aaa:checked="true"&gt;
&lt;rect x="5" y="5" width="20" height="20" rx="5" ry="5"
fill="none" stroke="crimson" stroke-width="2"/&gt;

&lt;text x="30" y="22" font-size="18" fill="crimson"&gt;
Enable Accessibility&lt;/text&gt;
&lt;/g&gt;

&lt;/svg&gt;</pre>
<p>While in HTML, you would have something like:</p>
<pre>&lt;html&gt;
&lt;ul role="checkbox" aria-checked="true"&gt;
&lt;li&gt;Enable Accessibility
&lt;/ul&gt;
&lt;/html&gt;</pre>
<p>Let the drama unfold&#8230;</p>
<p><span id="more-46"></span></p>
<h3>Act I</h3>
<h4>Scene I</h4>
<p>XHTML defined a new point of extensibility, the <a title="XHTML Role Attribute Module" target="_blank" href="http://www.w3.org/TR/xhtml-role/">&#8216;role&#8217; attribute</a>, which was intended to be use to add semantics to an element.</p>
<h4>Scene II</h4>
<p>The WAI Working Group  decided to use that as the point of entry for adding accessibility behaviors to custom controls.  Custom controls are things like an interactive tree selector, or a slider knob; they extend the limited set of form-based controls that browsers settled on, and they are increasingly used in script libraries like dojo or Scriptaculous.  SVG developers have been making custom controls using script and/or declarative animation for many years, since SVG doesn&#8217;t have any native controls at all, but can be used to build visually glitzy ones; they just aren&#8217;t treated as controls by AT (Assistive Technology) apps.  ARIA can be used to tell the AT that a collection of elements is meant to represent a particular type of control, and report what its current state is (on, off, hidden, selected, etc.).  So the SVG WG has been eyeing the progress of the Role and ARIA specs.</p>
<h3>Act II</h3>
<h4>Scene I</h4>
<p>The HTML5 movement, under the banner of the WHATWG, gained critical mass and was brought into the W3C for standardization with all major browser vendors.  The ARIA proponents worked hard to get ARIA&#8217;s accessibility functionality integrated into the standard.  Simon Pieters of Opera and Aaron Leventhal of Mozilla made a <a target="_blank" title="ARIA Proposal for HTML5" href="http://simon.html5.org/specs/aria-proposal">proposal for integration of ARIA</a> using a limited &#8216;role&#8217; attribute.  Because XML Namespaces don&#8217;t work right in IE (and not very intuitively in CSS), it was proposed that the different states of ARIA would be referenced and set in HTML5 using the prefix &#8216;arai-*&#8217; instead of &#8216;aaa:*&#8217; or &#8216;aria:*&#8217;.  I was only vaguely aware of early discussions of &#8216;role&#8217; in HTML5, and despaired of its ever being adopted, knowing the resistance to generic extensibility.  But Simon and Aaron were actively working on getting ARIA integrated into the next releases of Opera and Firefox, to enable accessible Web apps.</p>
<h4>Scene II</h4>
<p>Dave Raggett (who originated forms in HTML) made an independent public request for the &#8216;role&#8217; attribute to be added to SVG; I jumped on this, expecting that it would be done using the built-in extensibility mechanism provided by XML Namespaces.  Much to my dismay, immediately was made aware of Simon and Aaron&#8217;s proposal, which uses different syntax to how it would be done in SVG.  <a target="_blank" title="Role/ARIA email thread 1" href="http://lists.w3.org/Archives/Public/www-svg/2007Oct/0012.html">Much</a> <a target="_blank" title="Role/ARIA email thread 2" href="http://lists.w3.org/Archives/Public/www-svg/2007Oct/0025.html">email</a> <a target="_blank" title="Role/ARIA email thread 3" href="http://lists.w3.org/Archives/Public/www-svg/2007Oct/0046.html">discussion</a> ensued, and a little biting of thumbs.</p>
<h4>Scene III</h4>
<p>I talked with the SVG Working Group about the &#8216;role&#8217; attribute (step one in integrating ARIA), and while there were some reservations, we agreed that it would be great if we could do it.  (Note: really boring issues of process elided here&#8230; assume I explained why it&#8217;s kinda bad timing for SVG right now.)  But we decided to first gather opinions about how best to do so from the SVG community and other interested parties.  But the issue of &#8216;role&#8217; was buried under the talk of whether or not to use the controversial and dreaded Namespaces (e.g. &#8216;aria:checked&#8217; versus &#8216;aria-checked&#8217;).  It&#8217;s undesirable to add arbitrary attributes to SVG, because the content wouldn&#8217;t validate and couldn&#8217;t take advantage of all the XML tools that already exist.  And there are like 70 attributes, so we couldn&#8217;t just adopt them all&#8230; and if we did, what would happen when ARIA v2.0 came out?  Ugh&#8230; messy.  But the HTML5 guys insisted they couldn&#8217;t use namespaces.</p>
<h3>Act III</h3>
<h4>Scene I</h4>
<p>Rich Schwerdtfeger of IBM, who&#8217;s heavily invested in getting ARIA implemented, set up an informal call involving the Dramatis Personae (and a few others who couldn&#8217;t show up).  I talked it over with people on &#8220;my&#8221; side, and reviewed the XML Namespaces specification.  A little reflection revealed to me that, in fact, both approaches were using namespaces&#8230; just the syntax is different (&#8216;aria:*&#8217; versus &#8216;aria-*&#8217;).  And while the Namespaces spec doesn&#8217;t describe any other mechanism than the namespace declaration and prefix, neither does it procribe it.  I saw a possible way out.</p>
<p>The uninformed reader will assume this is some persnickety, trivial detail; such a reader would be right, but it&#8217;s still a pain to coordinate on crap like this.  Everyone assumes they are right, the other guy is wrong, and everyone should just do it their way.</p>
<h4>Scene II</h4>
<p>The <a target="_blank" title="Scribed minutes of informal talk on ARIA in HTML and SVG" href="http://www.w3.org/2007/10/17-aria-minutes.html">teleconference happened today</a>, and arguments were presented, and assumptions were challenged, and a verbal duel took place.  Issues with delimiters in IE and CSS were explained and explored.  The colon was a real problem, but so was the dash.  Making the &#8220;aria-*&#8221; string is a klutzy, short-term, one-off solution, and couldn&#8217;t really cut it as a true namespace prefix.  SVG has many attributes that contain the dash (&#8216;stroke-width&#8217;, &#8216;fill-rule&#8217;, &#8216;font-size&#8217;, &#8216;stroke-dasharray&#8217;, &#8216;fill-opacity&#8217;, &#8216;pointer-events&#8217;, &#8216;font-family&#8217;, &#8216;shape-rendering&#8217;, and many more); it&#8217;s a common convention to separate words in attributes with a dash.  No future (or present) language could safely use &#8216;font-&#8217; or &#8216;shape-&#8217; or any other prefix to integrate with SVG.</p>
<p>But Aaron Leventhal, a very pragmatic guy, pulled out just the medicine I think was needed.  The underscore (&#8220;_&#8221;).  It works in IE, has no special meaning in CSS, is a legal (if underused) character for attributes in XML, doesn&#8217;t cause problems for the HTML parser, and doesn&#8217;t conflict with any conventions in SVG.  It&#8217;s probably underutilized because it&#8217;s just slightly harder to type than a dash (on my keyboard, it&#8217;s the same key, but requires the shift key be depressed).</p>
<p>_!!</p>
<h4>Scene III</h4>
<p>The final scene has been lost in the mists of the future.  But here&#8217;s my plan, if nothing gets in its way:  to create a new namespacing specification that uses the underscore as its prefix delimiter.  It would differ from <a target="_blank" title="Namespaces in XML 1.0 (Second Edition)" href="http://www.w3.org/TR/xml-names/">Namespaces in XML 1.0</a> in three ways:</p>
<ol>
<li>It would make the namespace prefix string fixed.  In XML Namespaces 1.0, any string is allowed to be used for any namespace prefix.  For example, if you were feeling particularly contrary, you could delare that the string &#8220;svg&#8221; is the prefix for XForms content, &#8220;xforms&#8221; is the prefix for MathML content, and &#8220;math&#8221; is the prefix for SVG content; in reality, nobody does this, for obvious reasons.  In my proposal, there would be a central &#8220;registry&#8221; of sorts for the most common prefixes; my suggestion is that such a registry should be defined in the CDF WICD profiles (though I haven&#8217;t consulted that group), and that a User Agent that supports multi-namespace documents (aka Compound Documents) would know what those prefixes stand for.  The most obvious ones are &#8220;svg&#8221;, &#8220;html&#8221;, &#8220;xhtml&#8221;, &#8220;xforms&#8221;, &#8220;mathml&#8221;&#8230; oh, yeah, and &#8220;aria&#8221;.  That this is less inherently extensible than the colon-delimited unfixed prefix might even be a bonus, ensuring that the combination of technologies has been combined systematically and specified, promoting interoperability betweem UAs.  Prefix names would consist only of letters and digits, forgoing the dot and the dash, and of course the colon and underscore; a possible exception that occurs to me is the use of the dot to serve as a versioning convention, so you would have &#8220;aria.2_checked&#8221; to represent an ARIA v2.0 &#8216;checked&#8217; attribute.</li>
<li>As a consequence of #1, there would be no declaration needed or specified.  The supporting UA would simply know the &#8221; name + _&#8221; prefix, and treat it as it should be treated.  This makes copy-paste authoring easier, since authors wouldn&#8217;t have to know or care about the namespace declaration earlier in the scope of the copied content.</li>
<li>This specification would not reserve the underscore, but merely allow supporting implementations to assign special meaning to the combination of &#8221; name + _&#8221;.  This would prevent some problems in existing XML processors.  Languages that register their prefix name would be encouraged to pick something that is unlikely to conflict with other partial attribute or element names.  (I toyed with the idea of making this an extension mechanism for attributes only&#8230; not element names.  I haven&#8217;t thought that through yet, though.)</li>
</ol>
<p>This would be more intuitive for creatinging documents, since authors (and authoring tool) could depend upon a convention.  Supporting XML processors would have a much easier time resolving namespaces.  Languages and UAs could support both namespacing schmemes, if they so chose, to allow for custom or unconventional namespaces that aren&#8217;t registered; the two schemes are orthogonal and (I believe) compatible.</p>
<p>Let the rotten tomatoes fly.</p>
]]></content:encoded>
			<wfw:commentRss>http://schepers.cc/underscoring-accessibility/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SVG Text, Semantics, and Accessibility</title>
		<link>http://schepers.cc/svg-text-semantics-and-accessibility</link>
		<comments>http://schepers.cc/svg-text-semantics-and-accessibility#comments</comments>
		<pubDate>Tue, 07 Nov 2006 09:24:29 +0000</pubDate>
		<dc:creator>Schepers</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[Microformats]]></category>
		<category><![CDATA[Semantics]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[W3C]]></category>

		<guid isPermaLink="false">http://www.schepers.cc/?p=11</guid>
		<description><![CDATA[<br/>In addition to geometric shapes, SVG has advanced graphical text capabilities. In SVG 1.1, there are several elements specifically designed for the presentation of text. At the most basic level, there is the &#60;text&#62; element, which can have child &#60;tspan&#62; elements that can be positioned and styled independently of the other text content, like this: [...]]]></description>
			<content:encoded><![CDATA[<br/><p>In addition to geometric shapes, SVG has advanced graphical text capabilities.   In SVG 1.1, there are several elements specifically designed for the presentation of text.  At the most basic level, there is the &lt;text&gt; element, which can have child &lt;tspan&gt; elements that can be positioned and styled independently of the other text content, like this:</p>
<p><iframe width="155" scrolling="no" height="51" frameborder="0" src="http://www.schepers.cc/svg/mindTheGap.svg">Please use FF1.5+, Opera 9+, or IE with an SVG plugin!</iframe></p>
<p>Then there are more advanced options, like rotated text<br />
<iframe width="20" scrolling="no" height="131" frameborder="0" src="http://www.schepers.cc/svg/rotatedText.svg">Please use FF1.5+, Opera 9+, or IE with an SVG plugin!</iframe>   or the &lt;textPath&gt; element</p>
<p><iframe width="487" scrolling="no" height="262" frameborder="0" src="http://www.schepers.cc/svg/textPath-simple.svg">Please use FF1.5+, Opera 9+, or IE with an SVG plugin!</iframe></p>
<p>The future of SVG text support holds still more.  In the next version of the SVG specification, <a target="_blank" title="Scalable Vector Graphics Tiny 1.2" href="http://www.w3.org/TR/SVGMobile12/">SVG Tiny 1.2</a>, there are even more useful text features, like the &lt;textArea&gt; element that automatically wraps text to a shape (rectangles on for mobile devices, but any shape at all in future versions of the specification).  There is also the new ability to make any text editable by simply including an attribute to the text element.  And there are great features from <a title="Scalable Vector Graphics 1.1" href="http://www.w3.org/TR/SVG11/">SVG 1.1</a> (the current version) that are not yet widely implemented, such as SVG Fonts, which let you embed a font into an SVG file so the reader sees the page the way the author intended it, and the &lt;tref&gt; element that lets you directly quote text without duplicating it.  All these features will give more control to authors and give a better experience to users.</p>
<p>But is that enough?</p>
<p><span id="more-11"></span></p>
<h2>The Study of Meaning</h2>
<p>Semantics is the study of meaning; a cluster of dots in the shape of a word doesn&#8217;t mean anything to a machine, but real words and sentences can be connected to concepts, and that is why this is important in a graphical format like SVG.  All of these text features really are text, not just images of text.  They can be searched for, copied, indexed by search engines, and understood by <a title="Wikipedia article on screen readers" target="_blank" href="http://en.wikipedia.org/wiki/Screen_reader">screen readers</a>.  Screen readers are a kind of <a title="Wikipedia article on AT" target="_blank" href="http://en.wikipedia.org/wiki/Assistive_technology">assistive technology</a> that reads pages out loud for people with vision problems.  It&#8217;s not just for people; machines like it, too.  It has semantic value, and this moves us toward the <a title="Semantic Web homepage" target="_blank" href="http://www.semanticweb.org/">Semantic Web</a>.  There is also the &lt;switch&gt; element, which is an excellent way to provide different text content, such as your own translations, depending on the user&#8217;s computer <em>systemLanguage</em>.   Obviously, this adds meaning by disambiguating different possible translations that a computer-based translation might not catch (because people are smart, and computers are merely fast).  And it&#8217;s not just the visible text that provides meaning, but also the metadata (or &#8220;data about data&#8221;).   SVG&#8217;s &lt;title&gt;, &lt;desc&gt;, &lt;metadata&gt; elements are not rendered onto the screen (although the <a target="_blank" title="Opera Web Browser" href="http://www.opera.com/">Opera browser</a> does provide a tooltip for the title text), but can be indexed by search engines, and the use of script or special browser capabilites (such as native browser support for <a target="_blank" title="Resource Description Framework" href="http://en.wikipedia.org/wiki/Resource_Description_Framework">RDF</a>, a special kind of markup that describes the relationship between terms used in the metadata) can provide extended functionality.  As you might expect, the &lt;title&gt; and &lt;desc&gt; elements are meant to be human-readable, while &lt;metadata&gt; elements more frequently contain computer code.</p>
<h2>A Semantic Argument</h2>
<p>But in a recent post to <a target="_blank" title="SVG-Developers Mailing List at Yahoo Groups" href="http://groups.yahoo.com/group/svg-developers">SVG-Dev</a>, a representative from Adobe <a title="Leonard Rosenthol's post to SVG-Dev" href="http://tech.groups.yahoo.com/group/svg-developers/message/57280">pointed out</a> some possible shortcomings of SVG&#8217;s text capabilities compared to HTML or PDF.  Adobe is using SVG in its new <a title="Adobe Mars homepage" target="_blank" href="http://labs.adobe.com/wiki/index.php/Mars">Mars project</a>, which is an XML version of their popular printable document format.  Now, I don&#8217;t find HTML to have very much semantic content either (see this <a title="Post about semantics to the SVG mailing list" target="_blank" href="http://lists.w3.org/Archives/Public/www-svg/2004Nov/0296">very long post on semantics from a couple of years ago</a>), but Adobe&#8217;s Leonard Rosenthol points out that computers (specifically screen readers) can&#8217;t distinguish between paragraphs and columns of text, and particularly not tabular content (where each cell in a table has a context in both a row and a column).  I don&#8217;t think that paragraphs or columns are particularly semantic (and certainly aren&#8217;t universal even among written languages).  They are largely cosmetic print conventions, and although of course that matters for printed formats, it&#8217;s not as important for accessibility or spoken-word understanding, nor for machine understanding; although admittedly paragraphs do represent some structure (I&#8217;m having flashbacks to composition class in high school here), most often columns are simply a convenience of text flow within a constrained area and carry no distinction from one another, and where they do, it is typically simple tabular data. Tables are another matter, though, because of the specific associations involved in cell position.  There are other semantic orthographic properties of documents that matter more than print conventions, and which have sometimes been passed off as merely stylistic, such as emphatic text (represented by boldface, italics, or relative font sizes) that is indicated by tone in spoken language.Acronyms, abbreviations, definitions, and quotations all have HTML representations (although they are too rarely used), and there is no equivalent of those tags in SVG (by design); but that meaning is limited to a specific knowledge domain, that of generic textual reference.  There are other specific domains that have highly structured tagsets just dripping with meaning, like <a title="Chemical Markup Language" target="_blank" href="http://www.xml-cml.org/">Chemical Markup Language (CML)</a>, <a title="Linguistics Markup Language" target="_blank" href="http://www.sanesense.org/lgml/">Linguistics Markup Language (LGML)</a>,  <a title="Music Notation Markup" target="_blank" href="http://www.musicmarkup.info/">Music Markup Language (MML)</a>, <a title="Genetics Markup" target="_blank" href="http://www.mged.org/Workgroups/MAGE/mage.html">MicroArray and Gene Expression (MAGE</a> &#8212; contrasted with the almost inevitable <a title="SourceForge Zefania Bible ML" target="_blank" href="http://sourceforge.net/projects/zefania-sharp/">Bible Markup Language</a>)&#8230; mapping, geography, mathematics, psychology, literature, sociology, physics, architecture&#8230; every area of human endeavor has a systematic structure that is (or will soon be) encoded in some kind of tagging scheme, whether that be in the form of XML, RDF, or some other format.  But these semantics are largely lost on the Web.</p>
<p>SVG has taken pains to avoid including specific semantics in the specification, in order to remain a neutral presenatation format.  The only semantics are derived from the graphical geometry, which nevertheless can be extended to related domains like mapping and geography (and possibly feng shui).  But it would be ideal if the underlying structure carried all the rich semantics of the graphical data being presented, if a circle were identified as an atom, or a rectangle were a flowchart box, if your computer knew what we know when we look at something, or even explaining it to us when we don&#8217;t know what we&#8217;re looking at.  These are true problems that need a solution.  How can we add semantic properties to SVG, to the Web in general?</p>
<h2>Technical Solutions</h2>
<h3>RDF</h3>
<p>I&#8217;ve already mentioned RDF.  This is one way to add extra information to the geometric presentation.  Let&#8217;s use molecules as an example (see <a title="Molecule SVG source" target="_blank" href="http://www.schepers.cc/svg/metadata/rdf/carbon_dioxide.txt">source</a>):</p>
<p><iframe width="500" scrolling="no" height="201" frameborder="0" src="http://www.schepers.cc/svg/metadata/rdf/carbon_dioxide.svg">Please use FF1.5+, Opera 9+, or IE with an SVG plugin!</iframe></p>
<p>The code would look something like this&#8230; I say <em>something like this</em> because A) this is only a snippet and B) I&#8217;m no RDF guru and I&#8217;m sure I got something wrong:</p>
<pre>&lt;svg&gt;
&lt;line x1='840' y1='170' x2='600' y2='170'&gt;
&lt;metadata&gt;
&lt;rdf:RDF&gt;
&lt;rdf:Description rdf:about="http://www.example.org/bond"&gt;
&lt;m:atom_link rdf:resource="http://www.example.org/carbon-oxygen" /&gt;
&lt;/rdf:Description&gt;
&lt;/rdf:RDF&gt;
&lt;/metadata&gt;
&lt;/line&gt;

&lt;g fill='gray'&gt;
&lt;metadata&gt;
&lt;rdf:RDF&gt;
&lt;rdf:Description rdf:about="http://www.example.org/carbon"&gt;
&lt;m:bonds_to&gt;
&lt;m:oxgen rdf:about="http://www.example.org/oxgen" /&gt;
&lt;/m:bonds_to&gt;
&lt;/rdf:Description&gt;
&lt;/rdf:RDF&gt;
&lt;/metadata&gt;
&lt;circle cx='400' cy='170' r='20'/&gt;
&lt;circle cx='400' cy='230' r='20'/&gt;
&lt;circle cx='600' cy='170' r='20'/&gt;
&lt;circle cx='600' cy='230' r='20'/&gt;
&lt;circle cx='500' cy='200' r='100' fill='url(#carbon_fill)'/&gt;
&lt;/g&gt;
&lt;/svg&gt;</pre>
<p>The &lt;metadata&gt; element as a child element is obviously associated with its parent, thus &#8220;tagging&#8221; it.  There is no established method for placing the &lt;metadata&gt; element to best associate collections of elements, but setting it as a child of a &lt;g&gt; (group) element containing all the relevant children seems a likely choice.  This allows us to say that circle is a carbon atom, and that line is a molecular bond.  On the downside, RDF is a bit verbose, and it isn&#8217;t ideal to tag text.</p>
<p>Text content in RDF (or any given XML format) is not visible.  This is because SVG dictates that content inside unknown elements (that is, elements not defined in the SVG specification) is not rendered, even if it is also the child of a &lt;text&gt; element.</p>
<h3>Microformats</h3>
<p><a title="Microformats homepage" target="_blank" href="http://microformats.org/">Microformats</a> may be a good option here.  While most people associate the <em>class </em>attribute with CSS styling, both the <a title="HTML class attribute" target="_blank" href="http://www.w3.org/TR/html4/struct/global.html#h-7.5.2">HTML</a> and <a target="_blank" title="SVG class attribute" href="http://www.w3.org/TR/SVG/styling.html#ClassAttribute">SVG</a> specifications list one of its roles as &#8220;general purpose processing by user agents.&#8221;  I haven&#8217;t seen any microformats user agents (browsers or other programs) that specifically support SVG, but it shouldn&#8217;t be hard.  The basic syntax and functionality would be the same.  Basically, you might say something like <em>&lt;text class=&#8221;acronym&#8221;&gt;SVG&lt;title&gt;St. Vincent and the Grenadines&lt;/title&gt;&lt;/text&gt;</em>.</p>
<p>A minor problem with this is that SVG Tiny 1.1 doesn&#8217;t have the class attribute, but this should work fine with SVG Full, and SVG Tiny 1.2 does include the class attribute specifically for uses other than styling (e.g. micoformats).   A potential negative with microformats itself is that since it is such a loose ontology, I&#8217;m not sure it will scale up to complex contexts, and I think that it will be subject to the same semantic drift that natural languages suffer (where one word takes on a new meaning, like &#8220;decimate&#8221;); in fact, since there will be no immediate feedback, as is present in spoken language, I think the drift will be accellerated.  This makes for stale semantics down the line, but it will probably suffice for the short term (and who knows how long the content will last anyway?).</p>
<h3>XBL2</h3>
<p>Finally, there is a new technology being published by the W3C, one originating with Mozilla, called the <a title="eXtensible Binding Language Spec at W3C" target="_blank" href="http://www.w3.org/TR/xbl/">eXtensible Binding Language (XBL2)</a>.  Among other things, it allows an author to create templates that attach a presentation format, like HTML or SVG, to any arbitrary XML.  So you could take your Chemical Markup, or Genealogy Markup, or whatever, and create XBL SVG  templates for it.  Whenever there is a element that matches one of your templates, the appropriate SVG (or whatever) markup is created and tied to the target element, preserving the original semantics while providing an appropriate visualization.  Since this is a new technology, the obvious drawback to this approach is that there aren&#8217;t yet browsers that support it.  Also, it may not be appropriate for mobile devices.  But I think this will be the rich option available within the next couple of years.</p>
<h3 />
<h2>Conclusions</h2>
<p>SVG has inherent accessibility features, and specific built-in geometric semantics.  With a little work, semantically rich documents and applications can be built using SVG in combination with the appropriate ontology and a semantic tagging mechanism.</p>
]]></content:encoded>
			<wfw:commentRss>http://schepers.cc/svg-text-semantics-and-accessibility/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

