Closed Bug 386551 Opened 17 years ago Closed 17 years ago

expose ARIA description on document

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: vasiliy.potapenko)

References

Details

(Keywords: access)

Attachments

(1 file, 2 obsolete files)

(In reply to comment #6 bug 386282)
> If the <html> or <body> had aaa:describedby there could be a description for
> the element. See GetRoleContent().
> 
> IMO the correct fix would change GetAccessibleRelated to check <html> or <body>
> for accessible relations. If it makes the code a lot more complicated to check
> both, then we could just check <body> in HTML and I will tell the ARIA
> standardization group what we did. In other markup languages we should check
> the top element.
> 

<surkov> aaronlev, how are description on html and body related with document accessible?
<aaronlev> That's where ARIA attributes can apply to the document
<aaronlev> for example if you put
<aaronlev> <body role="wairole:application">
<aaronlev> it changes the role for the nsDocAccessible
<aaronlev> if you put <body role="wairole:application" aaa:describedby="myAppDescription"><div id="myAppDescription">Fill in the available dates and times for travel</div> blah blah blah </body>
<surkov> ah, ok
<aaronlev> Then the nsDocAccessible would have a description and describedby
<surkov> I'll file bug for this
Blocks: orca
Assignee: aaronleventhal → vasiliy.potapenko
Status: NEW → ASSIGNED
Blocks: 191a11y
No longer blocks: aria, orca
Keywords: access
Probably the easiest way is to fix GetTextFromRelationID() to use GetRoleContent() and call GetTextFromRelationID on nsDocAccessible.
Surkov, what difference between aria-describedby and aaa:describedby in HTML?
(In reply to comment #2)
> Surkov, what difference between aria-describedby and aaa:describedby in HTML?
> 

aria-describedby can be used in html where namespace can't be used, aaa:describedby in any XML language. Use GetAriaProperty().
Attached patch patch1 (obsolete) — Splinter Review
Attachment #284394 - Flags: review?(aaronleventhal)
Attachment #284394 - Flags: review?(aaronleventhal) → review+
Attachment #284394 - Flags: superreview?(neil)
nsIContent::GetDocument is deprecated, use GetCurrentDoc or GetOwnerDoc instead.

Also, here superreview is not required I think but if you like then it's up to you. When you'll get all reviws you want request approval for 1.9
Attachment #284394 - Flags: superreview?(neil)
Attached patch patch2 (obsolete) — Splinter Review
I have changed GetDocument() to GetOwnerDoc().
Attachment #284394 - Attachment is obsolete: true
Attachment #284414 - Flags: approval1.9?
Comment on attachment 284414 [details] [diff] [review]
patch2

> NS_IMETHODIMP 
> nsDocAccessible::GetDescription(nsAString& aDescription)
> {
>   aDescription.Truncate();
>+
>+  nsAutoString description;
>+  nsresult rv = GetTextFromRelationID(eAria_describedby, description);
>+
>+  if (NS_SUCCEEDED(rv) && !description.IsEmpty()) {
>+    aDescription = description;
>+  }
>+
>   return NS_OK;
> }
I don't know how essential it is that you ignore the rv, especially since GetTextFromRelationID seems to be unsure when it ignores its rv, but you might consider an unconditional assignment i.e.
nsAutoString description;
GetTextFromRelationID(eAria_describedby, description);
aDescription = description;
return NS_OK;

Sucks to our string API; if only it didn't need to call CompressWhitespace then GetTextFromRelationID could take an nsAString& and you could simply
return GetTextFromRelationID(eAria_describedby, aDescription);
Attachment #284414 - Flags: approval1.9? → approval1.9+
Vasiliy, before your patch will be checked in, please address Neil's comments.
Attachment #284414 - Attachment is obsolete: true
checked in
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: