The default bug view has changed. See this FAQ.

get rid HyperTextAccessible CID

RESOLVED FIXED in mozilla16

Status

()

Core
Disability Access APIs
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: surkov, Assigned: drexler)

Tracking

unspecified
mozilla16
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

5 years ago
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++]
(Assignee)

Comment 1

5 years ago
Created attachment 633848 [details] [diff] [review]
patch

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)
(Reporter)

Comment 2

5 years ago
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+
(Assignee)

Comment 4

5 years ago
Created attachment 634302 [details] [diff] [review]
updated_patch

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+
(Assignee)

Comment 6

5 years ago
Created attachment 634444 [details] [diff] [review]
patch_for_checkin

(In reply to Trevor Saunders (:tbsaunde) from comment #5)
 
Fixed nits and set mGeckoTextAccessible = nsnull in expire().
(Assignee)

Updated

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.