Expose datatype object attribute

RESOLVED FIXED

Status

()

Core
Disability Access APIs
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Aaron Leventhal, Assigned: surkov)

Tracking

({access, fixed1.8.0.12, fixed1.8.1.4})

Trunk
access, fixed1.8.0.12, fixed1.8.1.4
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 3 obsolete attachments)

(Reporter)

Description

10 years ago
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.
(Assignee)

Comment 1

10 years ago
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?
(Reporter)

Comment 2

10 years ago
Can you provide some interesting examples of how that's done?
(Assignee)

Comment 3

10 years ago
Created attachment 251905 [details]
new datatype testcase

here new datatype 'birthDate' is inherited from xsd:date
(Assignee)

Comment 4

10 years ago
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.
(Assignee)

Updated

10 years ago
Status: NEW → ASSIGNED
(Reporter)

Comment 5

10 years ago
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.
(Assignee)

Comment 6

10 years ago
Created attachment 251939 [details] [diff] [review]
patch
Attachment #251939 - Flags: review?(aaronr)
(Assignee)

Updated

10 years ago
Blocks: 337249
(Assignee)

Comment 7

10 years ago
(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 :)

(Reporter)

Comment 8

10 years ago
Comment on attachment 251939 [details] [diff] [review]
patch

r=aaronlev on mozilla/accessible changes.
Attachment #251939 - Flags: review+

Comment 9

10 years ago
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

10 years ago
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
Attachment #251939 - Flags: review?(aaronr) → review+
(Assignee)

Comment 11

10 years ago
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?
Attachment #251939 - Attachment is obsolete: true
Attachment #252315 - Flags: review?(Olli.Pettay)

Comment 12

10 years ago
(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

10 years ago
Comment on attachment 252315 [details] [diff] [review]
patch2

If you fix Aaron's comments, r=me
Attachment #252315 - Flags: review?(Olli.Pettay) → review+
(Assignee)

Comment 14

10 years ago
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.
Attachment #252315 - Attachment is obsolete: true
(Assignee)

Comment 15

10 years ago
checked in by smaug
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch

Comment 16

10 years ago
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

10 years ago
(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.
(Assignee)

Comment 18

10 years ago
(In reply to comment #17)

> Fixed.
> 

Thank you, Olli.

Comment 19

10 years ago
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.
Keywords: fixed1.8.0.12, fixed1.8.1.4
Whiteboard: xf-to-branch

Comment 20

10 years ago
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.
(Assignee)

Comment 21

10 years ago
(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?
(Assignee)

Comment 22

10 years ago
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.
Attachment #251905 - Attachment is obsolete: true

Comment 23

10 years ago
(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.
You need to log in before you can comment on or make changes to this bug.