FLUID-123: Reorderer call to getAttribute("aaa:activedescendent") sometimes fails in IE6 with "Invalid argument" error.

Metadata

Source
FLUID-123
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Michelle D'Souza
Reporter
Colin Clark
Created
2007-11-23T09:00:42.000-0500
Updated
2011-01-28T12:12:28.803-0500
Versions
N/A
Fixed Versions
  1. 0.1
Component
  1. Reorderer

Description

At least with the Scheduler markup and use of the Reorderer, there is an error in IE6 that renders it unusable. Upon instantiation of a Reorderer, IE6 complains that there is an "invalid argument:" on line 76 of the Reorderer:

if (this.domNode.getAttribute("aaa:activedescendent")) {
this.domNode.removeAttribute("aaa:activedescendent");
}

The problem seems to be with the call to getAttribute("aaa:activedescendent"). The SchedulerTests show the problem. It may be worth checking with Simon on the best way to be getting and setting these namespaced ARIA attributes.

My concern was that this may happen with any markup that initially lacks these attributes, but I can't get the todo list markup to reproduce. Perhaps it's a bug in the scheduler.

Environments

Windows XP, IE 6 (non-hacked)

Comments

  • Colin Clark commented 2007-11-23T09:04:49.000-0500

    I've attached a patch to Reorderer.js that appears to resolve the problem, but I haven't done extensive enough tests to ensure it's safe. Can someone look at this for me?

    Basically, the patch removes the call to getAttribute to determine if the "aaa:activedescendent" attribute is present. Instead, it immediately calls removeAttribute("aaa:activedescent") under the assumption that it's safe and faster to just attempt to remove the element, regardless of if it is present.

  • Simon Bates commented 2007-11-23T09:23:55.000-0500

    I think you should be using getAttributeNS and removeAttributeNS here. As in:

    if (this.domNode.getAttributeNS("http://www.w3.org/2005/07/aaa", "activedescendent")) {
    this.domNode.removeAttributeNS("http://www.w3.org/2005/07/aaa", "activedescendent");
    }

    Having said that, you only need to namespace ARIA states/properties on FF2 – the spec is being changed (FF3 implements the new behaviour.) Here's what I did in Dojo:

    getWaiState: function(/Element/ elem, /String/ state){
    // Summary: Return the value of the requested state on elem
    // or an empty string if elem has no value for state.
    // On Firefox 2 and below, we check for an attribute in namespace
    // "http://www.w3.org/2005/07/aaa" with a name of the given state.
    // On all other browsers, we check for an attribute called
    // "aria-"+state.
    if(dojo.isFF && dojo.isFF < 3){
    return elem.getAttributeNS("http://www.w3.org/2005/07/aaa", state);
    }else{
    var value = elem.getAttribute("aria-"+state);
    return value ? value : "";
    }
    },

    removeWaiState: function(/Element/ elem, /String/ state){
    // Summary: Removes the given state from elem.
    // On Firefox 2 and below, we remove the attribute in namespace
    // "http://www.w3.org/2005/07/aaa" with a name of the given state.
    // On all other browsers, we remove the attribute called
    // "aria-"+state.
    if(dojo.isFF && dojo.isFF < 3){
    elem.removeAttributeNS("http://www.w3.org/2005/07/aaa", state);
    }else{
    elem.removeAttribute("aria-"+state);
    }
    }

    from http://trac.dojotoolkit.org/browser/dijit/trunk/_base/wai.js

  • Joseph Scheuhammer commented 2007-11-26T10:55:45.000-0500

    One difference between 'Lightbox.html', and 'scheduler.html' is that the former declares namespaces for the aria 'wairole' and 'aaa'. These are declared in the <html> element. That might explain why a plain getAttribute() works in the context of the lightbox, but not in the case of the scheduler.

  • Joseph Scheuhammer commented 2007-11-26T16:12:24.000-0500

    Michelle committed Colin's patch, and Anastasia checked it for her (paraphrase from and icq from MD).

  • Colin Clark commented 2007-11-26T16:19:15.000-0500

    The patch fixed the immediate problem. We still need to address the issue of proper namespacing: we're adding attributes with the aaa: namespace without ever knowing if that namespace has actually been declared in the document. I'll file a separate JIRA.

  • Michelle D'Souza commented 2011-01-28T12:09:44.277-0500

    Reopening these issues to add the reorderercomponent to them.