Last Comment Bug 367256 - Expose datatype object attribute
: Expose datatype object attribute
Status: RESOLVED FIXED
: access, fixed1.8.0.12, fixed1.8.1.4
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: alexander :surkov
:
: alexander :surkov
Mentors:
Depends on:
Blocks: xformsa11y
  Show dependency treegraph
 
Reported: 2007-01-17 10:03 PST by Aaron Leventhal
Modified: 2007-05-09 19:43 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
new datatype testcase (1.55 KB, application/xhtml+xml)
2007-01-18 02:59 PST, alexander :surkov
no flags Details
patch (33.43 KB, patch)
2007-01-18 08:36 PST, alexander :surkov
aaronr: review+
aaronlev: review+
Details | Diff | Splinter Review
patch2 (33.48 KB, patch)
2007-01-22 05:37 PST, alexander :surkov
bugs: review+
Details | Diff | Splinter Review
for checkin (33.58 KB, patch)
2007-01-22 18:36 PST, alexander :surkov
no flags Details | Diff | Splinter Review
testcase (2.74 KB, application/xhtml+xml)
2007-05-09 19:25 PDT, alexander :surkov
no flags Details

Description Aaron Leventhal 2007-01-17 10:03:59 PST
This is something we currently expose in HTML only if the author has used the aaa:datatype attribute from ARIA. It's exposed via nsAccessible::GetAttributes(), which can be overridden for XForms elements. XForms has better support for data typing.

The datatype attribute is a qname which refers to an XSD (schema) defined type. For example, a datatype may be xsd:integer. When this is not specified, the default is string, unless the Value interface is exposed, which indicates the type is numeric.
Comment 1 alexander :surkov 2007-01-17 19:08:52 PST
What should the value of datatype attribute be when the type of instance node is not builin i.e. it is derived from some type?
Comment 2 Aaron Leventhal 2007-01-17 21:03:48 PST
Can you provide some interesting examples of how that's done?
Comment 3 alexander :surkov 2007-01-18 02:59:19 PST
Created attachment 251905 [details]
new datatype testcase

here new datatype 'birthDate' is inherited from xsd:date
Comment 4 alexander :surkov 2007-01-18 03:05:05 PST
Oh, clear, WAI-ARIA States and Properties says:

Datatype defines the format type of an element. Datatypes should be a qname that refer to an [XSD] defined type. For example, a datatype may be xsd:integer.

The author can also define custom datatypes, but clearly [XSD] base types are simpler for the user agent to understand.
Comment 5 Aaron Leventhal 2007-01-18 06:25:46 PST
If we can provide  the datatype it inherits from then we can file an RFE to later deal with exposing the actual datatype. I'll have to check with some folks like Rich Schwerdtfeger or T.V. Raman on how we might best deal with that.

In this case, just knowing it's a date is still very useful for an alternative input program like an on screen keyboard.
Comment 6 alexander :surkov 2007-01-18 08:36:45 PST
Created attachment 251939 [details] [diff] [review]
patch
Comment 7 alexander :surkov 2007-01-18 08:48:14 PST
(In reply to comment #5)
> If we can provide  the datatype it inherits from then we can file an RFE to
> later deal with exposing the actual datatype. I'll have to check with some
> folks like Rich Schwerdtfeger or T.V. Raman on how we might best deal with
> that.

That will probably involve to provide whole schema interfaces for AT :)

Comment 8 Aaron Leventhal 2007-01-18 09:17:59 PST
Comment on attachment 251939 [details] [diff] [review]
patch

r=aaronlev on mozilla/accessible changes.
Comment 9 aaronr 2007-01-19 15:47:15 PST
Comment on attachment 251939 [details] [diff] [review]
patch


>Index: content/base/public/nsIXFormsUtilityService.h
>===================================================================
>RCS file: /cvsroot/mozilla/content/base/public/nsIXFormsUtilityService.h,v
>retrieving revision 1.9
>diff -u -8 -p -r1.9 nsIXFormsUtilityService.h
>--- content/base/public/nsIXFormsUtilityService.h	10 Jan 2007 14:39:44 -0000	1.9
>+++ content/base/public/nsIXFormsUtilityService.h	18 Jan 2007 16:35:45 -0000
>@@ -49,18 +49,18 @@ class nsIEditor;
> /* For IDL files that don't want to include root IDL files. */
> #ifndef NS_NO_VTABLE
> #define NS_NO_VTABLE
> #endif
> 
> /* nsIXFormsUtilityService */
> #define NS_IXFORMSUTILITYSERVICE_IID_STR "88d9eaa9-1498-4ffb-85a6-44267595cb20"
> #define NS_IXFORMSUTILITYSERVICE_IID \
>-{ 0x88d9eaa9, 0x1498, 0x4ffb, \
>-  { 0x85, 0xa6, 0x44, 0x26, 0x75, 0x95, 0xcb, 0x20 } }
>+{ 0x5201c306, 0x8c1c, 0x4f99, \
>+  { 0xa7, 0xbf, 0xa, 0x5c, 0x8e, 0x3c, 0x8c, 0x74 } }
> 

You need to update the IID_STR when you are updating the IID.

> /**
>  * Private interface implemented by the nsXFormsUtilityService in XForms
>  * extension.
>  */
> class NS_NO_VTABLE nsIXFormsUtilityService : public nsISupports {
> public:
> 
>@@ -68,16 +68,22 @@ public:
> 
>   enum {
>     STATE_OUT_OF_RANGE,
>     STATE_IN_RANGE,
>     STATE_NOT_A_RANGE
>   };
> 
>   /**
>+   * Returns builtin type name for the instance node that node is bound to.
>+   * Failture if node isn't bound.
>+   */
>+  NS_IMETHOD GetBuiltinTypeName(nsIDOMNode *aElement, nsAString& aName);
>+

nit: too many mentions of 'node'.  And 'Failure' spelled wrong.  I suggest, "Returns the name of the builtin type of the instance node that aElement is bound to.  Fails if aElement doesn't have a bound node."

>Index: extensions/xforms/nsIModelElementPrivate.idl
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/xforms/nsIModelElementPrivate.idl,v
>retrieving revision 1.24
>diff -u -8 -p -r1.24 nsIModelElementPrivate.idl
>--- extensions/xforms/nsIModelElementPrivate.idl	1 Nov 2006 23:02:13 -0000	1.24
>+++ extensions/xforms/nsIModelElementPrivate.idl	18 Jan 2007 16:35:45 -0000

>@@ -213,29 +198,50 @@ interface nsIModelElementPrivate : nsIXF
>    * Force rebinding (and refreshing) of a control. Also handles rebinding and
>    * refreshing of child controls, if necessary.
>    *
>    * @param control           The control to rebind.
>    */
>   void forceRebind(in nsIXFormsControl control);
> 
>   /**
>+   * Determine the type for a form control based on the schema included by
>+   * this model.
>+   */
>+  nsISchemaType getTypeForControl(in nsIXFormsControl control);
>+
>+  /**
>+   * Return builtin type name for a form control based on the schema included by
>+   * this model.
>+   */
>+  AString getBuiltinTypeNameForControl(in nsIXFormsControl control);
>+
>+  /** 
>+   * This function takes an instance data node, finds the type bound to it, and
>+   * returns the separated out type and namespace URI.  If no type is set for
>+   * the node, then it returns the defaults: "http://www.w3.org/2001/XMLSchema"
>+   * and "string"
>+   */
>+  void getTypeAndNSFromNode(in nsIDOMNode instancenode, out AString type, 
>+                            out AString namespaceURI);
>+

nit: extra whitespace at the end of the line (after 'type').

more comments coming...
Comment 10 aaronr 2007-01-21 18:26:48 PST
Comment on attachment 251939 [details] [diff] [review]
patch

>Index: extensions/xforms/nsXFormsModelElement.h
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/xforms/nsXFormsModelElement.h,v
>retrieving revision 1.55
>diff -u -8 -p -r1.55 nsXFormsModelElement.h
>--- extensions/xforms/nsXFormsModelElement.h	8 Oct 2006 14:15:01 -0000	1.55
>+++ extensions/xforms/nsXFormsModelElement.h	18 Jan 2007 16:35:46 -0000
>@@ -393,36 +393,51 @@ private:
>   PRBool IsDuplicateSchema(nsIDOMElement *aSchemaElement);
> 
>   /**
>    * Validate all the instance documents.
>    */
>   void ValidateInstanceDocuments();
> 
>   /**
>+   * Return the name of builitn type.
>+   *
>+   * @param aType        The builtin type
>+   * @param aName The name of the given type
>+   */

nit: please align the parameter information so that they start in the same column

>   /**
>    * Starting from aType, walks the chain of datatype extension/derivation to
>    * gather information.
>    *
>-   * @param aType        The type we are trying to find datatype information
>-   *                     for
>-   * @param aBuiltinType If non-null, we'll return the root primative type
>-   *                     of aType in this buffer
>-   * @param aTypeArray   If aBuiltinType is nsnull, we'll build a string
>-   *                     array of datatype URIs and put them in aTypeArray.
>+   * @param aType            The type we are trying to find datatype information
>+   *                         for
>+   * @param aFindRootBuiltin If true then root builtin type will be returned
>+                             only
>+   * @param aBuiltinType     If non-null, we'll return the builtin or root
>+   *                         builtin type of the given type that depends on
>+   *                         aFindRootBuiltin value

nit: I don't understand the comment for aBuiltinType.  Which (builtin or root builtin) are returned for which values of aFindRootBuiltin?  Please make it clear.


with those, r=me
Comment 11 alexander :surkov 2007-01-22 05:37:25 PST
Created attachment 252315 [details] [diff] [review]
patch2

(In reply to comment #10)

> nit: I don't understand the comment for aBuiltinType.  Which (builtin or root
> builtin) are returned for which values of aFindRootBuiltin?  Please make it
> clear.

Aaron, please look at new comment. Is it more clean?
Comment 12 aaronr 2007-01-22 13:40:11 PST
(In reply to comment #11)
> Created an attachment (id=252315) [details]
> patch2
> 
> (In reply to comment #10)
> 
> > nit: I don't understand the comment for aBuiltinType.  Which (builtin or root
> > builtin) are returned for which values of aFindRootBuiltin?  Please make it
> > clear.
> 
> Aaron, please look at new comment. Is it more clean?
> 


I like that comment better.  You still didn't update NS_IXFORMSUTILITYSERVICE_IID_STR, though.
Comment 13 Olli Pettay [:smaug] 2007-01-22 13:59:27 PST
Comment on attachment 252315 [details] [diff] [review]
patch2

If you fix Aaron's comments, r=me
Comment 14 alexander :surkov 2007-01-22 18:36:50 PST
Created attachment 252412 [details] [diff] [review]
for checkin

(In reply to comment #12)

> You still didn't update
> NS_IXFORMSUTILITYSERVICE_IID_STR, though.
> 

Sorry, I misread your comment.
Comment 15 alexander :surkov 2007-01-22 23:48:48 PST
checked in by smaug
Comment 16 neil@parkwaycc.co.uk 2007-01-24 02:54:55 PST
Comment on attachment 252412 [details] [diff] [review]
for checkin

> class NS_NO_VTABLE nsIXFormsUtilityService : public nsISupports {

>+  NS_IMETHOD GetBuiltinTypeName(nsIDOMNode *aElement, nsAString& aName);
This is an interface so you need = 0 on all your declarations.
Comment 17 Olli Pettay [:smaug] 2007-01-24 03:04:53 PST
(In reply to comment #16)
> (From update of attachment 252412 [details] [diff] [review])
> > class NS_NO_VTABLE nsIXFormsUtilityService : public nsISupports {
> 
> >+  NS_IMETHOD GetBuiltinTypeName(nsIDOMNode *aElement, nsAString& aName);
> This is an interface so you need = 0 on all your declarations.
> 

Fixed.
Comment 18 alexander :surkov 2007-01-24 05:43:43 PST
(In reply to comment #17)

> Fixed.
> 

Thank you, Olli.
Comment 19 aaronr 2007-04-23 15:58:37 PDT
checked into 1.8 branch on 2007-04-12 and checked into 1.8.0 branch on 2007-04-16 the xforms pieces, not the accessibility changes.
Comment 20 Jay Patel [:jay] 2007-05-09 16:48:43 PDT
aaron/alexander:  If you can verify this and update the keywords with "verified1.8.1.4" and "verified1.8.0.12", that will be great!  If no, please let me know what I need to test to verify this...  I am not sure what to look for with the test case.
Comment 21 alexander :surkov 2007-05-09 19:23:29 PDT
(In reply to comment #20)
> aaron/alexander:  If you can verify this and update the keywords with
> "verified1.8.1.4" and "verified1.8.0.12", that will be great!  If no, please
> let me know what I need to test to verify this...  I am not sure what to look
> for with the test case.
> 

If I get right it work ever neither 1.8 nor 1.8.0 because there is no accessible for xforms on branch. AaronR, correct?
Comment 22 alexander :surkov 2007-05-09 19:25:35 PDT
Created attachment 264312 [details]
testcase

Accessible for XForms input should have datatype="date" ARIA attribute. On branch I assume there is not accessible at all for XForms input.
Comment 23 aaronr 2007-05-09 19:43:04 PDT
(In reply to comment #21)
> (In reply to comment #20)
> > aaron/alexander:  If you can verify this and update the keywords with
> > "verified1.8.1.4" and "verified1.8.0.12", that will be great!  If no, please
> > let me know what I need to test to verify this...  I am not sure what to look
> > for with the test case.
> > 
> 
> If I get right it work ever neither 1.8 nor 1.8.0 because there is no
> accessible for xforms on branch. AaronR, correct?
> 

right, the accessibility pieces weren't checked in since the core interfaces are frozen on the branches.  I would say that you really can't test whether this is in since there should be no visible difference even to the XForms user.  The XForms changes from this patch were made on branch just to keep things in sync with the trunk as much as possible.

Note You need to log in before you can comment on or make changes to this bug.