[Laszlo-checkins] r14274 - in openlaszlo/branches/4.4: . WEB-INF/lps/lfc/kernel/dhtml WEB-INF/lps/lfc/services WEB-INF/lps/templates lps/components/lz test/accessibility

ptw@openlaszlo.org ptw at openlaszlo.org
Thu Jul 2 13:38:49 PDT 2009


Author: ptw
Date: 2009-07-02 13:38:41 -0700 (Thu, 02 Jul 2009)
New Revision: 14274

Added:
   openlaszlo/branches/4.4/test/accessibility/simple.lzx
   openlaszlo/branches/4.4/test/accessibility/test-components.lzx
   openlaszlo/branches/4.4/test/accessibility/test-labels.lzx
Modified:
   openlaszlo/branches/4.4/
   openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs
   openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
   openlaszlo/branches/4.4/WEB-INF/lps/lfc/services/LzFocus.lzs
   openlaszlo/branches/4.4/WEB-INF/lps/templates/html-response.xslt
   openlaszlo/branches/4.4/lps/components/lz/radio.lzx
Log:
Merged revisions 14167-14171,14173-14176,14178-14182,14185-14188,14190-14191,14195-14199,14201-14206,14210-14215,14218,14220-14225,14227-14228,14230-14234,14236,14238-14265,14267-14268,14270-14273 via svnmerge from 
http://svn.openlaszlo.org/openlaszlo/trunk

.......
  r14167 | hqm | 2009-06-17 00:45:19 -0400 (Wed, 17 Jun 2009) | 28 lines
  
  Change 20090615-hqm-y by hqm at badtzmaru.home on 2009-06-15 15:21:30 EDT
      in /Users/hqm/openlaszlo/trunk6
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: add preliminary <label> implementation to support DHTML accessibility 
  
  New Features:
  
  Bugs Fixed: LPP-8248
  
  Technical Reviewer: max
  QA Reviewer: (pending)
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Details:
  
  + Implements LzSprite.setAADescription on DHTML sprite, by
  adding a <LABEL> child element to the __LZdiv. 
  
  Tests:
  
  test-labels.lzx manually check the DOM to verify that the innerHTML content of the <label> elements is correct
.......
  r14178 | hqm | 2009-06-17 16:24:46 -0400 (Wed, 17 Jun 2009) | 37 lines
  
  Change 20090617-hqm-j by hqm at badtzmaru.home on 2009-06-17 15:12:14 EDT
      in /Users/hqm/openlaszlo/trunk6
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: CSS improvement for DHTML accesibility implementation
  
  New Features:
  
  Bugs Fixed: LPP-8248
  
  Technical Reviewer: ptw
  QA Reviewer: max
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Details:
  
  + for accessibility API, add a CSS style, lzaccessibilitydiv,  for <label> tags to use
  
  + add stubs for 
    LzSprite.prototype.setAAActive 
    LzSprite.prototype.setAASilent 
    LzSprite.prototype.setAAName 
    LzSprite.prototype.setAATabIndex 
  
  
  
  Tests:
  
  + For accessibility CSS change, verify that in test case in LPP-8248 , <label> element content is still
  hidden    
.......
  r14262 | hqm | 2009-06-29 22:23:38 -0400 (Mon, 29 Jun 2009) | 41 lines
  
  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.
.......
  r14263 | hqm | 2009-06-29 23:12:45 -0400 (Mon, 29 Jun 2009) | 30 lines
  
  Change 20090629-hqm-g by hqm at badtzmaru.home on 2009-06-29 23:10:42 EDT
      in /Users/hqm/openlaszlo/trunk6
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: fix for DHTML accessibility
  
  New Features:
  
  Bugs Fixed: LPP-8248
  
  Technical Reviewer: max
  QA Reviewer: antun
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Details:
  
  + LzBrowserKernel isAAActive cannot refer to canvas too early, or else
  it will not have been bound as a global yet. We need to figure out how
  the canvas accessibility flag should be referenced during the
  initialization of the LFC, before the canvas has been created.
  
  Tests:
  
  smokecheck
.......
  r14273 | hqm | 2009-07-02 16:18:05 -0400 (Thu, 02 Jul 2009) | 29 lines
  
  Change 20090702-hqm-7 by hqm at badtzmaru.home on 2009-07-02 14:44:11 EDT
      in /Users/hqm/openlaszlo/trunk-diamond/WEB-INF/lps/lfc
      for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc
  
  Summary: fix null pointer reference error in accessibility feature
  
  New Features:
  
  Bugs Fixed: LPP-8248
  
  Technical Reviewer: ptw
  QA Reviewer: abraham
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Details:
  
  + check that sprite is not null before dereferencing it
      
  
  Tests:
  
  test/accessibility/test-components.lzx?lzr=dhtml&lzt=html
  should not get any null pointer errors when tabbing through items
.......



Property changes on: openlaszlo/branches/4.4
___________________________________________________________________
Name: svnmerge-integrated
   - /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/4.2:1-12154,12181,13205,13778 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554,13476,13629 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-13938,13940-13945,13947-13952,13954-13968,13970,13972-13980,13982-13985,13987-14015,14017-14032,14034,14036-14069,14071-14109,14116,14124,14127,14129,14146-14156,14159,14165,14177,14184,14189,14192-14194,14200-14206,14210-14215,14217-14219,14226,14229,14235,14237,14266,14269
   + /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/4.2:1-12154,12181,13205,13778 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554,13476,13629 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-13938,13940-13945,13947-13952,13954-13968,13970,13972-13980,13982-13985,13987-14015,14017-14032,14034,14036-14069,14071-14109,14116,14124,14127,14129,14146-14156,14159,14165,14167-14171,14173-14182,14184-14206,14210-14215,14217-14273

Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs	2009-07-02 20:18:05 UTC (rev 14273)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs	2009-07-02 20:38:41 UTC (rev 14274)
@@ -172,4 +172,19 @@
     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 (){
+    // Not yet implemented;
+    Debug.warn("LzBrowserKernel.isAAActive not yet fully implemented");
+    return false;
+}
+
+
 } // End of LzBrowserKernel

Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js	2009-07-02 20:18:05 UTC (rev 14273)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js	2009-07-02 20:38:41 UTC (rev 14274)
@@ -17,6 +17,7 @@
     this.constructor = arguments.callee;
     this.owner = owner;
     this.uid = LzSprite.prototype.uid++;
+    this.aadescriptionDiv = null;
 
     if (isroot) {
         this.isroot = true;
@@ -179,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;
@@ -401,6 +402,9 @@
     lztextlink: {
         cursor: 'pointer'
     },
+    lzaccessibilitydiv: {
+       display: 'none'
+    },
     writeCSS: function() {
         var rules = [];
         var css = '';
@@ -536,7 +540,7 @@
     ,opacity: true
     ,colortransform: false
     ,audio: false
-    ,accessibility: false
+    ,accessibility: true
     ,htmlinputtext: false
     ,advancedfonts: false
     ,bitmapcaching: false
@@ -2397,3 +2401,100 @@
         return null;
     }
 }
+
+/**
+  * Set accessibility description
+  * @param string s: Sets the accessibility name for this view
+  */
+LzSprite.prototype.setAADescription = function( s ) {
+    var aadiv = this.aadescriptionDiv;
+    if (aadiv == null) {
+        // If not already created, create a <label> element, nested in
+        // a <div style='display:none'> to make it invisible
+        this.aadescriptionDiv = aadiv = document.createElement('LABEL');
+        aadiv.className = 'lzaccessibilitydiv';
+        // Safari reader only speaks labels which have a 'for' attribute
+        aadiv.setAttribute('for', this.__LZdiv.id);
+        this.__LZdiv.appendChild(aadiv);
+    }
+    aadiv.innerHTML = s;
+}
+
+
+/** Turns accessibility on/off if accessible == true and a screen reader is active 
+  * @param Boolean accessible
+  */
+LzSprite.prototype.setAccessible = function(accessible) {
+    // TODO [hqm 2009-06] also need to check LzBrowserKernel.isAAActive() when it is working
+    var a = accessible;
+    LzSprite.__rootSprite.accessible = accessible;
+}
+
+    
+/**
+ * @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 ){
+    this.__LzAccessibilityActive = s;
+}
+
+
+/**
+  * Set accessibility silencing/unsilencing
+  * @param string s: If true, this view is made silent to the screen reader.  
+  * If false, it is active to the screen reader.
+  */
+LzSprite.prototype.setAASilent = function( s ){
+    // Not yet implemented
+}
+
+
+/**
+  * Set accessibility name
+  * @param string s: Sets the accessibility name for this view
+  */
+LzSprite.prototype.setAAName = function( s ){
+    // Not yet implemented
+}
+
+
+/**
+  * 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/branches/4.4/WEB-INF/lps/lfc/services/LzFocus.lzs
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/services/LzFocus.lzs	2009-07-02 20:18:05 UTC (rev 14273)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/services/LzFocus.lzs	2009-07-02 20:38:41 UTC (rev 14274)
@@ -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,14 @@
             prevsel.blurring = false;
         }
 
+
+        // canvas.accessible && dhtml
+        if ($dhtml && canvas.accessible) {
+            if (newsel && newsel.sprite != null) {
+                newsel.sprite.aafocus();
+            }
+        }
+
         if (newsel && newsel.onfocus.ready) {
             newsel.onfocus.sendEvent( newsel );
             var next:* = this.__LZsfnextfocus;

Modified: openlaszlo/branches/4.4/WEB-INF/lps/templates/html-response.xslt
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/templates/html-response.xslt	2009-07-02 20:18:05 UTC (rev 14273)
+++ openlaszlo/branches/4.4/WEB-INF/lps/templates/html-response.xslt	2009-07-02 20:38:41 UTC (rev 14274)
@@ -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/branches/4.4/lps/components/lz/radio.lzx
===================================================================
--- openlaszlo/branches/4.4/lps/components/lz/radio.lzx	2009-07-02 20:18:05 UTC (rev 14273)
+++ openlaszlo/branches/4.4/lps/components/lz/radio.lzx	2009-07-02 20:38:41 UTC (rev 14274)
@@ -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>
 

Copied: openlaszlo/branches/4.4/test/accessibility/simple.lzx (from rev 14263, openlaszlo/trunk/test/accessibility/simple.lzx)

Copied: openlaszlo/branches/4.4/test/accessibility/test-components.lzx (from rev 14263, openlaszlo/trunk/test/accessibility/test-components.lzx)

Copied: openlaszlo/branches/4.4/test/accessibility/test-labels.lzx (from rev 14167, openlaszlo/trunk/test/accessibility/test-labels.lzx)



More information about the Laszlo-checkins mailing list