Closed
Bug 160792
Opened 22 years ago
Closed 22 years ago
Accessibility APIs: use title attribute in more places
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: aaronlev, Assigned: aaronlev)
Details
Attachments
(1 file, 1 obsolete file)
2.86 KB,
patch
|
yuanyi21
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
If the title attribute is different from accessible name, use accessible description field to expose it. However, if there is no accessible name for something, always use the title attribute there.
Assignee | ||
Comment 1•22 years ago
|
||
Seeking r=
Comment on attachment 93986 [details] [diff] [review] Implements rules described in bug, which were developed in coordination with screen reader vendor r=kyle
Attachment #93986 -
Flags: review+
Comment 3•22 years ago
|
||
Comment on attachment 93986 [details] [diff] [review] Implements rules described in bug, which were developed in coordination with screen reader vendor + nsCOMPtr<nsITextContent> textContent(do_QueryInterface(mDOMNode)); + if (!textContent) + GetAccName(name); + if (textContent || !name.IsEmpty()) { + // If text or if there's already a name, we might expose a description. + // If there is no name, then we know the title should really be exposed there + nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode)); + elt->GetAttribute(NS_LITERAL_STRING("title"), aDescription); Is this not guaranteed to crash if mDOMNode is ever a text node? If mDOMNode is a text node textContent will be non-null, and we'll end up QI'ing that text node to an nsIDOMElement, which it's not, and calling a method on that null pointer. Seems wrong, or at least fragile to me.
Attachment #93986 -
Flags: needs-work+
Assignee | ||
Comment 4•22 years ago
|
||
You're so right - how did I miss that? I guess that's why you're an sr=
Attachment #93986 -
Attachment is obsolete: true
Comment on attachment 94101 [details] [diff] [review] Don't even try to expose description for text nodes, since they aren't elements and can't have titles anyway There are 3 conditions that makes a domNode have no accDescription: 1. it's a text node; or 2. it hasn't accName; or 3. its title attribute equals to its accName. Is that right and clear? r=kyle
Attachment #94101 -
Flags: review+
Assignee | ||
Comment 6•22 years ago
|
||
Thanks Kyle, I'll add that to the comment when I check in.
Summary: Accessibility APIs: use title attribute in more places → Accessibility APIs: use title attribute in more places
Comment 7•22 years ago
|
||
Comment on attachment 94101 [details] [diff] [review] Don't even try to expose description for text nodes, since they aren't elements and can't have titles anyway sr=jst
Attachment #94101 -
Flags: superreview+
Assignee | ||
Comment 8•22 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•