Closed
Bug 380524
Opened 17 years ago
Closed 17 years ago
implement IAccessibleComponent
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: surkov, Assigned: surkov)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
20.61 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Attachment #264618 -
Flags: superreview?(neil)
Attachment #264618 -
Flags: review?(aaronleventhal)
Comment 1•17 years ago
|
||
Comment on attachment 264618 [details] [diff] [review] patch >+ // The coordinates of the returned position are relative to this object's >+ // parent or relative to the screen on which this object is rendered if it >+ // has no parent. >+ if (!parentAcc) >+ return NS_OK; Except you didn't set *aX and *aY in this case. >+STDMETHODIMP >+CAccessibleComponent::get_foreground(IA2Color *aForeground) >+{ >+ IA2ARGB color = 0; >+ HRESULT hr = GetARGBValueFromCSSProperty(NS_LITERAL_STRING("color"), &color); >+ *aForeground = color; >+ >+ return hr; >+} Why not make GetARGBValueFromCSSProperty take an IA2Color* parameter? >+ *aColorValue = (((IA2ARGB) (blue) << IA2BlueShift) | >+ ((IA2ARGB) (green) << IA2GreenShift) | >+ ((IA2ARGB) (red) << IA2RedShift) | >+ ((IA2ARGB) (alpha) << IA2AlphaShift)); Unfortunately alpha is from 0.0 to 1.0 while you probably want 0 to 255. Also it's not clear what ((IA2ARGB) (blue) << IA2BlueShift) does, perhaps writing it as (((IAARGB) blue) << IA2BlueShift) might make more sense.
Attachment #264618 -
Flags: superreview?(neil) → superreview-
Assignee | ||
Comment 2•17 years ago
|
||
> Also it's not clear what ((IA2ARGB) (blue) << IA2BlueShift) does, perhaps
> writing it as (((IAARGB) blue) << IA2BlueShift) might make more sense.
>
Ok, though I took this from GDI+ Color class implementation (GdiPlusColor.h)
Assignee | ||
Comment 3•17 years ago
|
||
with neil's comments
Attachment #264618 -
Attachment is obsolete: true
Attachment #264635 -
Flags: superreview?(neil)
Attachment #264635 -
Flags: review?(aaronleventhal)
Attachment #264618 -
Flags: review?(aaronleventhal)
Comment 4•17 years ago
|
||
Comment on attachment 264635 [details] [diff] [review] patch2 >+ // compose ARGB value >+ IA2ARGB colorValue = 0; >+ colorValue = ((((IA2ARGB) blue) << IA2BlueShift) | >+ (((IA2ARGB) green) << IA2GreenShift) | >+ (((IA2ARGB) red) << IA2RedShift) | >+ (((IA2ARGB) (alpha * 0xff)) << IA2AlphaShift)); >+ >+ *aColorValue = colorValue; OK, so apparently an IA2Color is just a long, so there's no point defining a private IA2ARGB type for your intermediate calculation, just change these all to IA2Color and write *aColorValue directly. sr=me with this fixed. Also you don't need the outermost set of parentheses and you have too much indentation. It's a pity that we use ABGR internally otherwise you could have used NS_RGBA()
Attachment #264635 -
Flags: superreview?(neil) → superreview+
Comment 5•17 years ago
|
||
Comment on attachment 264635 [details] [diff] [review] patch2 r+ although I think locationInParent should still work if something is offscreen (we still expose coordinates) -- it's just outside of the currently visible bounds. if (states & nsIAccessibleStates::STATE_INVISIBLE || states & nsIAccessibleStates::STATE_OFFSCREEN) return S_OK;
Attachment #264635 -
Flags: review?(aaronleventhal) → review+
Assignee | ||
Comment 6•17 years ago
|
||
with Neil's and Aaron's comments
Attachment #264635 -
Attachment is obsolete: true
Assignee | ||
Comment 7•17 years ago
|
||
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.
Description
•