[Laszlo-checkins] r14262 - in openlaszlo/trunk: WEB-INF/lps/lfc/kernel/dhtml WEB-INF/lps/lfc/services WEB-INF/lps/templates lps/components/lz test/accessibility
hqm@openlaszlo.org
hqm at openlaszlo.org
Mon Jun 29 19:23:43 PDT 2009
Author: hqm
Date: 2009-06-29 19:23:38 -0700 (Mon, 29 Jun 2009)
New Revision: 14262
Added:
openlaszlo/trunk/test/accessibility/simple.lzx
openlaszlo/trunk/test/accessibility/test-components.lzx
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
openlaszlo/trunk/WEB-INF/lps/lfc/services/LzFocus.lzs
openlaszlo/trunk/WEB-INF/lps/templates/html-response.xslt
openlaszlo/trunk/lps/components/lz/radio.lzx
Log:
Change 20090629-hqm-n by hqm at badtzmaru.home on 2009-06-29 19:10:04 EDT
in /Users/hqm/openlaszlo/trunk6
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: add basic accessibility feature to DHTML kernel
New Features:
Bugs Fixed: LPP-8248
Technical Reviewer: max
QA Reviewer: antun
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
+ Pass 'accessibility' to DHTML wrapper in the html-response XSLT template
+ If accessiblity is enabled, assign unique id to sprite's __LZdiv div, and
create a <label> ( aadescriptionDiv ) which points to that __LZdiv.
+ LzView takes an aadescription attribute, and uses that for the <label> content
+ LzFocus calls the browser's native __LZdiv.focus() method, which triggers the
JAWS screen reader to read it's <label> (and anything in the view's sprite's child divs also, it turns out)
Tests:
test/accessibility/simple.lzx
run this with lzr=dhtml&lzt=html, tabbing through the views should read each one in IE7 with JAWS
test/accessibility/test-components.lzx ?lzr=dhtml&lzt=html
more complex test case, basically it is examples/components/component_sampler.lzx with accessibility
enabled. Tabbing through with JAWS in IE7 should read each component, more or less sensibly.
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs 2009-06-29 23:22:36 UTC (rev 14261)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs 2009-06-30 02:23:38 UTC (rev 14262)
@@ -172,4 +172,17 @@
return LzSprite.__rootSprite._id;
}
+
+
+/**
+ * Determines if the a screen reader is active and the Flash player is focused
+ * @keywords flashspecific
+ *
+ * @return: True if a screen reader is active and the Flash player is focused
+ */
+static function isAAActive (){
+ return (canvas.sprite.capabilities.accessibility);
+}
+
+
} // End of LzBrowserKernel
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2009-06-29 23:22:36 UTC (rev 14261)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2009-06-30 02:23:38 UTC (rev 14262)
@@ -180,7 +180,7 @@
}
}
- if ($debug) {
+ if ($debug || this.capabilities.accessibility) {
// annotate divs with sprite IDs, but don't override existing IDs!
if (!this.__LZdiv.id) this.__LZdiv.id = 'sprite_' + this.uid;
if (!this.__LZclickcontainerdiv.id) this.__LZclickcontainerdiv.id = 'click_' + this.__LZdiv.id;
@@ -2414,18 +2414,27 @@
* @param Boolean accessible
*/
LzSprite.prototype.setAccessible = function(accessible) {
- // Not yet implemented
+ var a = LzBrowserKernel.isAAActive() && accessible;
+ LzSprite.__rootSprite.accessible = accessible;
}
-
+
/**
- * Activate/inactivate children for accessibility
- * @param Boolean s: If true, activate the current view and all of its children
+ * @access private
+ * A cache of accessibility properties
*/
+LzSprite.prototype._accProps = null;
+
+
+/**
+* Activate/inactivate children for accessibility
+* @param Boolean s: If true, activate the current view and all of its children
+*/
LzSprite.prototype.setAAActive = function( s ){
- // Not yet implemented
+ this.__LzAccessibilityActive = s;
}
+
/**
* Set accessibility silencing/unsilencing
* @param string s: If true, this view is made silent to the screen reader.
@@ -2446,9 +2455,34 @@
/**
+ * Set the main sprite's div focus() so a screen reader will read it.
+ */
+LzSprite.prototype.aafocus = function( ){
+ try {
+ if (this.__LZdiv != null) {
+ this.__LZdiv.focus();
+ }
+ } catch (e) {
+ }
+}
+
+/**
* Set accessibility tab order
* @param number s: The tab order index for this view. Must be a unique number.
*/
LzSprite.prototype.setAATabIndex = function( s ){
// Not yet implemented
}
+
+/**
+ * See view.sendAAEvent()
+ */
+LzSprite.prototype.sendAAEvent = function(childID, eventType, nonHTML){
+ try {
+ if (this.__LZdiv != null) {
+ this.__LZdiv.focus();
+ }
+ } catch (e) {
+ }
+}
+
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzFocus.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/LzFocus.lzs 2009-06-29 23:22:36 UTC (rev 14261)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/LzFocus.lzs 2009-06-30 02:23:38 UTC (rev 14262)
@@ -1,6 +1,6 @@
/**
*
- * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2009 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @affects lzbrowser
@@ -223,6 +223,12 @@
prevsel.blurring = false;
}
+
+ // canvas.accessible && dhtml
+ if ($dhtml && canvas.accessible) {
+ newsel.sprite.aafocus();
+ }
+
if (newsel && newsel.onfocus.ready) {
newsel.onfocus.sendEvent( newsel );
var next:* = this.__LZsfnextfocus;
Modified: openlaszlo/trunk/WEB-INF/lps/templates/html-response.xslt
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/templates/html-response.xslt 2009-06-29 23:22:36 UTC (rev 14261)
+++ openlaszlo/trunk/WEB-INF/lps/templates/html-response.xslt 2009-06-30 02:23:38 UTC (rev 14262)
@@ -134,7 +134,7 @@
<xsl:when test="/canvas/@runtime = 'dhtml'">
<div id="lzsplash" style="z-index: 10000000; top: 0; left: 0; width: {$canvaswidth}; height: {$canvasheight}; position: fixed; display: table"><p style="display: table-cell; vertical-align: middle;"><img src="{/canvas/request/@lps}/lps/includes/spinner.gif" style="display: block; margin: 20% auto"/></p></div>
<script type="text/javascript">
- lz.embed.dhtml({url: '<xsl:value-of select="/canvas/request/@url"/>?lzt=object<xsl:value-of select="/canvas/request/@query_args"/>', bgcolor: '<xsl:value-of select="/canvas/@bgcolor"/>', width: '<xsl:value-of select="/canvas/@width"/>', height: '<xsl:value-of select="/canvas/@height"/>', id: '<xsl:value-of select="/canvas/@id"/>'});
+ lz.embed.dhtml({url: '<xsl:value-of select="/canvas/request/@url"/>?lzt=object<xsl:value-of select="/canvas/request/@query_args"/>', bgcolor: '<xsl:value-of select="/canvas/@bgcolor"/>', width: '<xsl:value-of select="/canvas/@width"/>', height: '<xsl:value-of select="/canvas/@height"/>', id: '<xsl:value-of select="/canvas/@id"/>', accessible: '<xsl:value-of select="/canvas/@accessible"/>'});
lz.embed.<xsl:value-of select="/canvas/@id"/>.onload = function loaded() {
var s = document.getElementById('lzsplash');
if (s) LzSprite.prototype.__discardElement(s);
Modified: openlaszlo/trunk/lps/components/lz/radio.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/radio.lzx 2009-06-29 23:22:36 UTC (rev 14261)
+++ openlaszlo/trunk/lps/components/lz/radio.lzx 2009-06-30 02:23:38 UTC (rev 14262)
@@ -194,7 +194,9 @@
<method name="updateFocus">
this.sendAAEvent(0, EVENT_OBJECT_SELECTION);
this.sendAAEvent(0, EVENT_OBJECT_FOCUS);
- Selection.setFocus(parent.getMCRef());
+ if ($as2) {
+ Selection.setFocus(parent.getMCRef());
+ }
</method>
</state>
Added: openlaszlo/trunk/test/accessibility/simple.lzx
Property changes on: openlaszlo/trunk/test/accessibility/simple.lzx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: openlaszlo/trunk/test/accessibility/test-components.lzx
Property changes on: openlaszlo/trunk/test/accessibility/test-components.lzx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
More information about the Laszlo-checkins
mailing list