Closed
Bug 379585
Opened 17 years ago
Closed 17 years ago
implement IAccessibleTable
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: surkov, Assigned: surkov)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
39.75 KB,
patch
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•17 years ago
|
||
Attachment #263578 -
Flags: review?(aaronleventhal)
Comment 2•17 years ago
|
||
Would it be easy later if we wanted to be able to implement nsIAccessibleTable for an nsAccessible where a web author used ARIA markup to define a table or spreadsheet?
Assignee | ||
Comment 3•17 years ago
|
||
(In reply to comment #2) > Would it be easy later if we wanted to be able to implement nsIAccessibleTable > for an nsAccessible where a web author used ARIA markup to define a table or > spreadsheet? > It shoudn't be a problem while we keep IAccessibleTable implementation separetely. I guess nsAccessibleWrap should be inherited from CAccessibleTable.
Comment 4•17 years ago
|
||
Okay, we can deal with that later then. I'm not sure if I even want to tackle that in Firefox 3. As long as it's fairly easy to change later.
Comment 5•17 years ago
|
||
+ #define GET_NSIACCESSIBLETABLE I've read that in C++ it's preferred to use static inline instead of #define. It's more readable. You can define a static already_AddRefs() inline method and it won't take up any more size, but it's easier to understand -- right now it's not clear that a variable called tableAcc comes out of it, without going back and checking the definitom. Out params should be initialized at the top of each method, before any early returns. For example, set *aAccessible = nsnull so that even on an error return the pointer will be set to something reasonable. I see return rv a few times, even though we're expecting COM error returns. I suppose nsresults actually use the same values as HRESULTS, so it's probably okay. Did you intend that?
Assignee | ||
Comment 6•17 years ago
|
||
Attachment #263578 -
Attachment is obsolete: true
Attachment #263715 -
Flags: review?(aaronleventhal)
Attachment #263578 -
Flags: review?(aaronleventhal)
Assignee | ||
Comment 7•17 years ago
|
||
(In reply to comment #5) > + #define GET_NSIACCESSIBLETABLE > I've read that in C++ it's preferred to use static inline instead of #define. > It's more readable. You can define a static already_AddRefs() inline method and > it won't take up any more size, but it's easier to understand -- right now it's > not clear that a variable called tableAcc comes out of it, without going back > and checking the definitom. I'm agree. But it would be something like: inline already_AddRefs<nsIAccessibleTable> getBlaBla(const CAccessibleTable& aObj) { nsIAccessibleTable* table; NS_ASSERTION(table, "Oops"); NS_IF_ADDREF(table, do_QueryInterface(aObj)); } nsCOMPtr<nsIAccessibleTable> table(getBlaBla(this)); if (!table) return E_FAIL; It doesn't save code. Though probably I missed something. > Out params should be initialized at the top of each method, before any early > returns. For example, set *aAccessible = nsnull so that even on an error return > the pointer will be set to something reasonable. Fixed. > I see return rv a few times, even though we're expecting COM error returns. I > suppose nsresults actually use the same values as HRESULTS, so it's probably > okay. Did you intend that? > It's error because nsresult values can't be converted to HRESULT automatically of course. Thank you for the catch.
Comment 8•17 years ago
|
||
Actually if you use inline and not static inline then you don't have to pass |this|. It's not so much about saving code, but about readability. It's the same amount of compiled code either way, with an inline vs. a #define.
Assignee | ||
Comment 9•17 years ago
|
||
(In reply to comment #8) > Actually if you use inline and not static inline then you don't have to pass > |this|. It's not so much about saving code, but about readability. It's the > same amount of compiled code either way, with an inline vs. a #define. > Actually, it looks we'll save NS_ASSERTION only with inline method :). Do we need inline function then? Possibly I can use neither macros nor inline method.
Comment 10•17 years ago
|
||
> Actually, it looks we'll save NS_ASSERTION only with inline method :)
What do you mean?
Assignee | ||
Comment 11•17 years ago
|
||
(In reply to comment #10) > > Actually, it looks we'll save NS_ASSERTION only with inline method :) > What do you mean? > Code with macros: MACROS__ Code with inline method: nsCOMPtr<nsIAccessibleTable> table(getBlaBla()); if (!table) return E_FAIL; Code without inline method: nsCOMPtr<nsIAccessibleTable> table(do_QueryInterface(this)); NS_ASSERTION(table, "blabla"); if (!table) return E_FAIL; The difference is NS_ASSERTION
Comment 12•17 years ago
|
||
You can't have an assertion in an inline method?
Assignee | ||
Comment 13•17 years ago
|
||
(In reply to comment #12) > You can't have an assertion in an inline method? > I think I can. I wonder is it a worth to do because we do not save much code size by assertion moving into inline method?
Comment 14•17 years ago
|
||
The assertion only affects code size in debug builds, so it's fine.
Assignee | ||
Comment 15•17 years ago
|
||
(In reply to comment #14) > The assertion only affects code size in debug builds, so it's fine. > Sorry, I didn't have in view that. I mean inline method doesn't win in code lines.
Comment 16•17 years ago
|
||
Right, it's not fewer lines of code, but easier to understand and the same amount of compiled machine code.
Assignee | ||
Comment 17•17 years ago
|
||
Attachment #263715 -
Attachment is obsolete: true
Attachment #263730 -
Flags: review?(aaronleventhal)
Attachment #263715 -
Flags: review?(aaronleventhal)
Updated•17 years ago
|
Attachment #263730 -
Flags: review?(aaronleventhal) → review+
Assignee | ||
Comment 19•17 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•