Hyperlink start/end index implemented?

RESOLVED FIXED

Status

()

RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: parente, Assigned: nian.liu)

Tracking

({access})

Trunk
x86
Linux
access
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments, 1 obsolete attachment)

(Reporter)

Description

12 years ago
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a2pre) Gecko/20070102 Minefield/3.0a2pre

There was some discussion a while back about implementing the hyperlink interface on embedded objects to find their start/end offset within a hypertext parent. With atk-1.12.2, I can query to the IDL:Accessibility/HyperlinkImpl:1.0 interface, but startIndex and endIndex both return -1 in all cases I've tried. Furthermore, getObject(n) returns None and getURI(n) returns an empty string.

Is this interface not implemented or is it now in existence but not working properly? My test page was http://www.mozilla.org/projects/minefield/

Updated

12 years ago
Assignee: aaronleventhal → nian.liu
Blocks: 333492
Keywords: access
(Assignee)

Comment 1

12 years ago
Created attachment 250422 [details] [diff] [review]
patch for getURI

1.test with my local build is that getIndex, getObject works fine while getURI doesn't work. my local build is a little messed up with patches of at-poke, at-spi and atk.  parente, what's your build of these?

2.rewrite getUriCB
Attachment #250422 - Flags: review?(aaronleventhal)
(Assignee)

Updated

12 years ago
Attachment #250422 - Attachment is obsolete: true
Attachment #250422 - Flags: review?(aaronleventhal)
(Assignee)

Comment 2

12 years ago
Created attachment 250442 [details] [diff] [review]
patch for getURI v2

1)thanks ginn for pointing out the g_strdup issue
2)there is memory leak for the use of new MaiHyperlink. and will be fixed in another patch. thanks ginn again here.
3)is there any cache mechanism which i can refer to?
Attachment #250442 - Flags: review?(ginn.chen)
(Reporter)

Comment 3

12 years ago
Nian:

atk-1.12.2-1.fc6
atk-devel-1.12.2-1.fc6
at-spi-1.7.11-2.fc6
at-spi-devel-1.7.11-2.fc6
at-poke-0.2.3-40

What versions do you have? What interface should I be querying for in at-spi?
(Assignee)

Comment 4

12 years ago
memory leak bug is traced with bug 366000
(Assignee)

Comment 5

12 years ago
(In reply to comment #3)
> Nian:
> 
> atk-1.12.2-1.fc6
> atk-devel-1.12.2-1.fc6
> at-spi-1.7.11-2.fc6
> at-spi-devel-1.7.11-2.fc6
> at-poke-0.2.3-40
> 
> What versions do you have? What interface should I be querying for in at-spi?
> 
seems same with atk and at-spi. my at-poke is 0.2.2 with local patch. 

the interface i query is IDL:Accessibility/Hyperlink:1.0, i add below code in update_if_hyperlink in poke.c
        long start_index, end_index;
        AccessibleHyperlink_getIndexRange(hyperlink, &start_index, &end_index);
        printf("start index is %ld, end index is %ld\n", start_index, end_index); 
        char* uri;
        uri = AccessibleHyperlink_getURI(hyperlink, 0);
        printf("uri is %s\n", uri);
        Accessible* object;
        object = AccessibleHyperlink_getObject(hyperlink, 0);
        if (object)
          printf("object is not null\n");

all the index is correct, uri is correct with the patch,  ojbect is not null.

Updated

12 years ago
Attachment #250442 - Flags: review?(ginn.chen) → review+

Comment 6

12 years ago
Fix committed.

Feel free to reopen it, if it still not work.
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
(Reporter)

Comment 7

12 years ago
I'm still seeing startIndex == -1, endIndex == -1, and getURI() == '' in Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a3pre) Gecko/20070223 Minefield/3.0a3pre.

I'm testing using accerciser 0.1.0 with at-spi-1.7.11-2.fc6 and atk-1.12.2-1.fc6.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Reporter)

Comment 8

12 years ago
I should note that accerciser is using AT-SPI through ORBit instead of using the cspi wrapper. Really, this should be a more direct route to the information so I'm not sure how you're seeing valid information and I'm not. 

I'm attaching the test page I'm using too. Try the get startIndex, endIndex, and URI for the first link in the list.
(Reporter)

Comment 9

12 years ago
Created attachment 256487 [details]
test page
(Assignee)

Comment 10

12 years ago
pls. try my test case and tell me the result. 
(Assignee)

Comment 11

12 years ago
Created attachment 256557 [details]
simpler test case
(Reporter)

Comment 12

12 years ago
I get the same result on your page as on mine.

I'm not sure what else could possibly be different between our setups. Does Orca make use of the startIndex and endIndex hyperlink information? If so, does the bug manifest in Orca?
(Assignee)

Comment 13

12 years ago
any chance to test it on your machine with at-poke? i guess it may a bug of accerciser

Comment 14

12 years ago
We worked around it by creating a getCharacterOffsetInParent method in Orca that finds the character offset of the link in its parent's text.  Here's a comment:

        # [[[TODO: WDW - HACK to handle the fact that
        # hyperlink.startIndex and hyperlink.endIndex is broken in the
        # Gecko a11y implementation.  This will hopefully be fixed.
        # If it is, one should be able to use hyperlink.startIndex.]]]

I guess I forgot to file a bug on this one (I usually include the bug numbers in our HACK comments).  I'm guessing maybe it was yet another crunch time for us.
(Reporter)

Comment 15

12 years ago
Yep. We've got the exact same hack in LSR. That's why I'm looking to get it fixed. But I can't figure out why Nian says it works for him with the same version of AT-SPI, atk, and FF3 that I have.

Will, can you verify that it's still broken with your Orca atspi.py?

Comment 16

12 years ago
Sometimes think Neo has magic pixie dust that makes problems disappear for her and not me.  :-)  But, this is not one of those cases: I have the magic pixie dust, too.  I just did a check and it seems to be working for me.
(Reporter)

Comment 17

12 years ago
Ha! OK. So some library I've got is backlevel because it even fails for me in a plain old Python script using AT-SPI directly through pyORBit.

Thanks for the help. Go ahead and close. I promise not to reopen again. :)

Updated

12 years ago
Status: REOPENED → RESOLVED
Last Resolved: 12 years ago12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.