Closed Bug 762038 Opened 12 years ago Closed 12 years ago

get rid HyperTextAccessible CID

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: surkov, Assigned: drexler)

References

Details

Attachments

(3 files)

All instances like
nsRefPtr<HyperTextAccessible> text(do_QueryObject(obj));
replace on
nsRefPtr<Accessible> acc(do_QueryObject(obj));
HyperTextAccessible* text = acc->AsHyperText();

remove NS_HYPERTEXTACCESSIBLE_IMPL_CID and fix HyperTextAccessible::QueryInterface
Depends on: 762394
Depends on: 762396
Whiteboard: [good first bug][mentor=trev.saunders@gmail.com][lang=c++]
Attached patch patchSplinter Review
Locally tested and sent to try: https://tbpl.mozilla.org/?tree=Try&rev=1c1fbb2ad915
Assignee: nobody → andrew.quartey
Status: NEW → ASSIGNED
Attachment #633848 - Flags: review?(surkov.alexander)
Comment on attachment 633848 [details] [diff] [review]
patch

Review of attachment 633848 [details] [diff] [review]:
-----------------------------------------------------------------

looks ok

::: accessible/src/base/nsAccessiblePivot.cpp
@@ +154,5 @@
>    NS_ENSURE_TRUE(aStartOffset <= aEndOffset &&
>                   (aStartOffset >= 0 || (aStartOffset != -1 && aEndOffset != -1)),
>                   NS_ERROR_INVALID_ARG);
> +  
> +  nsRefPtr<Accessible> acc(do_QueryObject(aTextAccessible));

technically it may be null so add a check please, if null return invalid arg

@@ +170,5 @@
>    mStartOffset = aStartOffset;
>    mEndOffset = aEndOffset;
>  
>    nsRefPtr<Accessible> oldPosition = mPosition.forget();
> +  mPosition = do_QueryObject(newPosition);

mPosition = newPosition should be enough
Attachment #633848 - Flags: review?(trev.saunders)
Attachment #633848 - Flags: review?(surkov.alexander)
Attachment #633848 - Flags: feedback+
Comment on attachment 633848 [details] [diff] [review]
patch

>-
>-  nsRefPtr<HyperTextAccessible> newPosition = do_QueryObject(aTextAccessible);
>+  

you introduce trailing whitespace here too.
Attachment #633848 - Flags: review?(trev.saunders) → review+
Attached patch updated_patchSplinter Review
fixed the nits and the Mac OS QI call failure for a HyperTextAccessible initialization i talked about in IRC. File in question is mozTextAccessible.mm
Attachment #634302 - Flags: review?(trev.saunders)
Comment on attachment 634302 [details] [diff] [review]
updated_patch

>+  nsRefPtr<Accessible> acc(do_QueryObject(aTextAccessible));
>+  if (!acc)
>+    return NS_ERROR_INVALID_ARG;
>+  HyperTextAccessible* newPosition = acc->AsHyperText();

nit, blank line after return

>   if ((self = [super initWithAccessible:accessible])) {
>-    CallQueryInterface(accessible, &mGeckoTextAccessible);
>+    mGeckoTextAccessible = accessible->AsHyperText();

so, this code is crazy, but I hope there is now an unmatched Release() somewhere.  The easiest fix is probably to just NS_IF_ADDREF() on mGeckoTextAccessible, but that's really broken and would add to the pile ofthings that need to be fixed here.  I suspect the correct fix is to change NS_IF_RELEASE() in expire() in this file to mGeckoTextAccessible = nsnull, but I'm not sure that's correct though it seems more sane than what we have now, and is atleast a step in the right direction.
Attachment #634302 - Flags: review?(trev.saunders) → review+
(In reply to Trevor Saunders (:tbsaunde) from comment #5)
 
Fixed nits and set mGeckoTextAccessible = nsnull in expire().
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/b17e673803b4
Flags: in-testsuite-
Keywords: checkin-needed
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/b17e673803b4
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: