Closed
Bug 377294
Opened 18 years ago
Closed 18 years ago
implement IA2::attributes
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
People
(Reporter: surkov, Assigned: surkov)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
No description provided.
Attachment #261386 -
Flags: review?(aaronleventhal)
Comment 1•18 years ago
|
||
Comment on attachment 261386 [details] [diff] [review]
patch
+ // The format is name:value;name:value with \ for escaping these
+ // characters ":;=,\".
Please add the code to add the \ before those characters that need it.
Please add a check on the first line of nsAccessible::GetAttributes(), if !mDOMNode fail.
Nit, space before =
*aAttributes=
Attachment #261386 -
Flags: review?(aaronleventhal) → review-
Assignee | ||
Comment 2•18 years ago
|
||
Huh?
Attachment #261386 -
Attachment is obsolete: true
Attachment #261400 -
Flags: review?(aaronleventhal)
Comment 3•18 years ago
|
||
Comment on attachment 261400 [details] [diff] [review]
patch2
Okay, but call charSet something like kCharsToEscape;
Assignee | ||
Comment 4•18 years ago
|
||
Comment on attachment 261400 [details] [diff] [review]
patch2
Neil, can you check especially the work with string?
(In reply to comment #3)
> (From update of attachment 261400 [details] [diff] [review])
> Okay, but call charSet something like kCharsToEscape;
>
Ok
Attachment #261400 -
Flags: superreview?(neil)
Comment 5•18 years ago
|
||
Comment on attachment 261400 [details] [diff] [review]
patch2
>+ NS_ENSURE_TRUE(mDOMNode, NS_ERROR_FAILURE);
NS_ENSURE_ARG(mDOMNode); perhaps?
>+ // The format is name:value;name:value with \ for escaping these
>+ // characters ":;=,\".
So, trailing semicolon or no trailing semicolon?
>+ PRUint32 offset = 0;
Either move this to where you use it or don't uselessly define it here.
>+ const char* charSet = ":;=,\\";
Should be char[]
>+ nsCOMPtr<nsIPropertyElement> propElem;
>+ propEnum->GetNext(getter_AddRefs(propElem));
Wrong, you should use nsCOMPtr<nsISupports> propSupports and then nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(propSupports));
>+ strAttrs.Append(NS_ConvertUTF8toUTF16(name));
Please use AppendUTF8toUTF16
>+ strAttrs.AppendLiteral(":");
I prefer strAttrs.Append(':'); (and similarly for ';')
Attachment #261400 -
Flags: superreview?(neil) → superreview-
Comment 6•18 years ago
|
||
>+ NS_ENSURE_TRUE(mDOMNode, NS_ERROR_FAILURE);
NS_ENSURE_ARG(mDOMNode); perhaps?
I think both of these spew to the console.
It's common for mDOMNode to be nsnull, for an accessible that's still held onto by the AT but has been shut down. To avoid too many messages to the console, I generally do it like this:
if (!mDOMNode) {
return NS_ERROR_FAILURE; // Node has been shut down
}
Assignee | ||
Comment 7•18 years ago
|
||
(In reply to comment #5)
> (From update of attachment 261400 [details] [diff] [review])
> >+ NS_ENSURE_TRUE(mDOMNode, NS_ERROR_FAILURE);
> NS_ENSURE_ARG(mDOMNode); perhaps?
I did like Aaron suggested.
>
> >+ // The format is name:value;name:value with \ for escaping these
> >+ // characters ":;=,\".
> So, trailing semicolon or no trailing semicolon?
yes, for name and value. I changed comment.
> >+ PRUint32 offset = 0;
> Either move this to where you use it or don't uselessly define it here.
Moved.
> >+ const char* charSet = ":;=,\\";
> Should be char[]
Fixed.
> >+ nsCOMPtr<nsIPropertyElement> propElem;
> >+ propEnum->GetNext(getter_AddRefs(propElem));
> Wrong, you should use nsCOMPtr<nsISupports> propSupports and then
> nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(propSupports));
Fixed. But why?
> >+ strAttrs.Append(NS_ConvertUTF8toUTF16(name));
> Please use AppendUTF8toUTF16
>
> >+ strAttrs.AppendLiteral(":");
> I prefer strAttrs.Append(':'); (and similarly for ';')
>
Fixed
Attachment #261400 -
Attachment is obsolete: true
Attachment #261646 -
Flags: superreview?(neil)
Attachment #261646 -
Flags: review?(aaronleventhal)
Attachment #261400 -
Flags: review?(aaronleventhal)
Updated•18 years ago
|
Attachment #261646 -
Flags: review?(aaronleventhal) → review+
Assignee | ||
Comment 8•18 years ago
|
||
Neil, any chance to review this?
Comment 9•18 years ago
|
||
Sorry for the delay, I was a bit busy this week.
(In reply to comment #7)
>>>+ nsCOMPtr<nsIPropertyElement> propElem;
>>>+ propEnum->GetNext(getter_AddRefs(propElem));
>>Wrong, you should use nsCOMPtr<nsISupports> propSupports and then
>>nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(propSupports));
>Fixed. But why?
Your code effectively does propElem = reinterpret_cast<nsIPropertyElement*> propSupports when it should do the equivalent of a dynamic_cast.
Comment 10•18 years ago
|
||
(In reply to comment #7)
>>>+ // The format is name:value;name:value with \ for escaping these
>>>+ // characters ":;=,\".
>>So, trailing semicolon or no trailing semicolon?
>yes, for name and value. I changed comment.
No, that's not what I meant.
The code generates name:value;name:value; with a final semicolon
But the comment says name:value;name:value without it...
Assignee | ||
Comment 11•18 years ago
|
||
(In reply to comment #10)
> (In reply to comment #7)
> >>>+ // The format is name:value;name:value with \ for escaping these
> >>>+ // characters ":;=,\".
> >>So, trailing semicolon or no trailing semicolon?
> >yes, for name and value. I changed comment.
> No, that's not what I meant.
> The code generates name:value;name:value; with a final semicolon
> But the comment says name:value;name:value without it...
>
Ah, clear. I guess it's not big deal. If AT or IA2 teams will say it makes a difference then I change it.
Assignee | ||
Comment 12•18 years ago
|
||
(In reply to comment #9)
> Sorry for the delay, I was a bit busy this week.
No problem.
> (In reply to comment #7)
> >>>+ nsCOMPtr<nsIPropertyElement> propElem;
> >>>+ propEnum->GetNext(getter_AddRefs(propElem));
> >>Wrong, you should use nsCOMPtr<nsISupports> propSupports and then
> >>nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(propSupports));
> >Fixed. But why?
> Your code effectively does propElem = reinterpret_cast<nsIPropertyElement*>
> propSupports when it should do the equivalent of a dynamic_cast.
>
Thank you for the clarification.
Comment 13•18 years ago
|
||
Comment on attachment 261646 [details] [diff] [review]
patch3
>+ // The format is name:value;name:value with \ for escaping these
Fix the comment to name:value;name:value; for check in.
Attachment #261646 -
Flags: superreview?(neil) → superreview+
Assignee | ||
Comment 15•18 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•