expose ARIA description on document

RESOLVED FIXED

Status

()

RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: surkov, Assigned: vasiliy.potapenko)

Tracking

({access})

Trunk
access
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

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

Updated

11 years ago
Blocks: 374212
(Reporter)

Updated

11 years ago
Assignee: aaronleventhal → vasiliy.potapenko
(Assignee)

Updated

11 years ago
Status: NEW → ASSIGNED

Updated

11 years ago
Blocks: 391535
No longer blocks: 343213, 374212
Keywords: access
(Reporter)

Comment 1

11 years ago
Probably the easiest way is to fix GetTextFromRelationID() to use GetRoleContent() and call GetTextFromRelationID on nsDocAccessible.
(Assignee)

Comment 2

11 years ago
Surkov, what difference between aria-describedby and aaa:describedby in HTML?
(Reporter)

Comment 3

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

Comment 4

11 years ago
Created attachment 284394 [details] [diff] [review]
patch1
Attachment #284394 - Flags: review?(aaronleventhal)

Updated

11 years ago
Attachment #284394 - Flags: review?(aaronleventhal) → review+
(Assignee)

Updated

11 years ago
Attachment #284394 - Flags: superreview?(neil)
(Reporter)

Comment 5

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

Updated

11 years ago
Attachment #284394 - Flags: superreview?(neil)
(Assignee)

Comment 6

11 years ago
Created attachment 284414 [details] [diff] [review]
patch2

I have changed GetDocument() to GetOwnerDoc().
Attachment #284394 - Attachment is obsolete: true
(Assignee)

Updated

11 years ago
Attachment #284414 - Flags: approval1.9?

Comment 7

11 years ago
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);

Updated

11 years ago
Attachment #284414 - Flags: approval1.9? → approval1.9+
(Reporter)

Comment 8

11 years ago
Vasiliy, before your patch will be checked in, please address Neil's comments.
(Assignee)

Comment 9

11 years ago
Created attachment 284582 [details] [diff] [review]
patch2 with Neil's comments.
Attachment #284414 - Attachment is obsolete: true
(Reporter)

Comment 10

11 years ago
checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.