User Context IDL Issues

Hi,
   In the User Context module, the IDL is being defined incorrectly.

The Accessibility interface is defined as:

interface Accessibility {
   readonly attribute InterfaceObject accessibility;
};

The accompanying editorial note questions whether this is correct or 
not, and if I understand the intention, it's not correct.

There is no defined interface called "InterfaceObject", and so no 
attribute can return an object of that type.  The intention, however, 
seems to be as a way of defining the accessibility attribute that is to 
appear on window.navigator.accessibility.

This should be defined by defining a partial interface for Navigator, 
with a property defined to return an instance of the Accessibility 
interface.

partial interface Navigator {
   readonly attribute Accessibility accessibility;
}

Similarly, for the ScreenReader and Magnifier, these should be defined 
with properties on the Accessibility Object.  Additionally, these 
ScreenReader and Magnifier interfaces do not need to be split up further 
into interfaces for ScreenReaderID, ScreenReaderStatus, etc.  Instead, 
the propeties and methods defined within these should simply be defined 
as part of their respective parent interfaces.

This is the complete IDL that is needed for the spec, as it stands now, 
based on the intended structure from the examples provided:

partial interface Navigator {
   readonly attribute Accessibility accessibility;
}

interface Accessibility {
   readonly attribute ScreenReader screenreader
   readonly attribute Magnifier magnifier

   // Notifications
   const unsigned short    screenChanged   = 1;
   const unsigned short    elementChanged  = 2;
   void postNotification(required String notification, optional 
HTMLElement element);
};

interface ScreenReader {
   // ID
   readonly attribute DOMString name;
   readonly attribute DOMString version;

   // Status
   readonly attribute boolean active;
};

interface Magnifier {
   // ID
   readonly attribute DOMString name;
   readonly attribute DOMString version;

   // Status
   readonly attribute boolean active;

  // Notifications {
   void focusPosition(
          in DOMElement element,
          in optional array cursorRect,
          in optional array selectionPolygon
        );
};

Note: The Speech interface is not yet defined in the spec, but was 
referred to with this statement:

   Accessibility implements Speech;

The intention of this API is not clear from the current draft, and so 
has not been included in the IDL above.  But presumably, it will be 
defined similarly to the ScreenReader and Magnifier interfaces.


As I have defined the IDL above, that will correctly expose the 
properties for the interfaces as follows, which is how the examples 
illustrate their use in the spec.

window.navigator.accessibility.screenreader
window.navigator.accessibility.magnifier

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Monday, 22 October 2012 11:26:03 UTC