[g-a-devel]Re: questions on nsIAccessibleHyperLink



On Mon, 2002-06-17 at 10:22, Gilbert Fang wrote:
> Hi, Peter
> Thank you very much for your suggestons.
> 
> But for details, eg. in this case:
> 
> I'm assuming now that the full HTML looks more like:
> 
>   <a href="newPage.html" alt="A new page"> first part <img src=second.img
> alt="second image"> third part</a>
> 
> Link: "A new page" at "first part [image: second part] third part"
>         going to "newPage.html"
>   ...
> 
> (image above that each line is successively spoken or sent to Braille, and the
> "[image: ...]" is either spoken in a different voice or indicated in Braille
> with a special dot-pattern.
> 
> We consider it as a HyperLink with one anchor, (mozilla did not see it 
> as three link but three accChildren, my suggestion is to
> see it as three but now I will change my points according to your 
> explanation). But in ATK, we only can get ONE OBJECT
> for one anchor. How do we expose there are really three part contents .

There is no fundamental reason why the object returned by
atk_hyperlink_get_object (hyperlink, 0) cannot be a container and thus
have children.

However if you choose to indicate the relationship between the text and
images in an HTML pane by making them siblings, you have a problem since
you then split the anchor across three different AtkHypertext objects; I
think this is the main issue.

If on the other hand, you consider the entire paragraph or even HTML
page to be a single AtkHypertext object, the problem becomes "where do I
put the image" ? 

If the image is a separate child of the AtkHypertext object, in this
case it can also implement AtkHypertext, and its anchor can point to the
same URI as the text's anchor.  This would mean that multiple anchors
point to the same URI, but that is perhaps a reasonable interpretation
of the user's experience.  In other words, as a user, I can 'click' on
either the text *or* the image to follow the link, so it is not
inconsistent with the user's experience to say that there is more than
one anchor or hyperlink in this case.  You could have all of these
hyperlinks return either a container that contained both AtkText and
AtkImage, so that no matter which link is activated the user gets
consistent information about the hyperlink itself, or you could have the
links return an AtkObject that implemented both AtkImage *and* AtkText.

If you already have three children of the HTML pane, one for the first
part of the text up to the image, one for the image, and one for the
second part of the text, this is my suggestion:

	make all three objects implement AtkHypertext
	make them return the same AtkHyperlink object in all three cases
	make atk_hyperlink_get_object (link) return a container with 		three
children, AtkText, AtkImage, and AtkText.

It requires that ATs like screenreaders query the children of objects
returned by atk_hyperlink_get_object, if they exist, but this probably
would need to happen anyway for some complex cases.

comments are welcome, I hope this was helpful.


-Bill

> AtkObject <http://developer.gnome.org/doc/API/2.0/atk/atk-atkobject.html#ATKOBJECT>*  atk_hyperlink_get_object <http://developer.gnome.org/doc/API/2.0/atk/atk-atkhyperlink.html#ATK-HYPERLINK-GET-OBJECT>        (AtkHyperlink <http://developer.gnome.org/doc/API/2.0/atk/atk-atkhyperlink.html#ATKHYPERLINK> *link,gint i);
> Are there any AtkObject can represent three other kind of objects, one for text, one for image and last one 
> for text. I wonder how ATK implement this ,or just leave this problem  to ATK 2.1 or later?
> 
> Thanks and Best Regards.
> Gilbert 
> 
> 
> 
> 
> Peter Korn wrote:
> 
> >Hi Gilbert,
> >
> >I've cc-ed Lynn Monsanto, who implemented AccessibleHypertext on Swing (and/or
> >worked with the folks on the Swing team who did so).
> >
> >The main design center for this API was client side image maps, where one
> >visible "object" really had multiple links on it.
> >
> >In your case below:
> >
> >  <a> first part <img src=second.img> third part</a>
> >
> >we would have thought of this as one Hyperlink with a single start & end
> >index.  That the Netscape accessibility infrastructure already sees it as three
> >is disappointing, and I'm not sure what we can/should do about that.
> >
> >Making it three links - I'm assuming now that the full HTML looks more like:
> >
> >  <a href="newPage.html" alt="A new page"> first part <img src=second.img
> >alt="second image"> third part</a>
> >
> >means that an AT that wants to give the user a quick list of all links and
> >their descriptions would then present the user with:
> >
> >  ...
> >  Link: "A new page" at "first part" going to "newPage.html"
> >  Link: "A new page" at "[image: second image]" going to "newPage.html"
> >  Link: "A new page" at "third part" going to "newPage.html"
> >  ...
> >
> >which is wasteful and duplication, as opposed to:
> >
> >  ...
> >  Link: "A new page" at "first part [image: second part] third part"
> >        going to "newPage.html"
> >  ...
> >
> >(image above that each line is successively spoken or sent to Braille, and the
> >"[image: ...]" is either spoken in a different voice or indicated in Braille
> >with a special dot-pattern.
> >
> >
> >Let me suggest another example to consider:
> >
> >  <map name="bannerMap"><area coords="538,0,681,4" href="index.html" alt="Go to
> >start"><!--home--><area coords="616,30,639,53" href="end.html" alt="previous
> >page"><!--back--><area coords="645,30,669,53" href="overview-all.html"
> >alt="next page"><!--forward--></map>
> >
> >Here (above) we have a client-side image map with three objects, three interior
> >bounding rectangles, three ALT tags, and three links.  This could be treated as
> >three logical Hyperlinks very naturally.  Unfortunately, the present Hyperlink
> >object doesn't have a way to indicate the bounding rectangle of each link
> >region (which one might want to do with AccessibleComponent and have them be
> >children of the entire map object).
> >
> >
> >Bill - I'm curious to hear your thoughts...
> >
> >
> >Peter
> >
> >
> >  
> >
> >>    I am Gilbert from Sun browser accessible group(ATF). Now I am
> >>implementing the nsIAccessibleHyperlink. There are some questions on
> >>that interface:
> >>
> >>So unfortunately, in jdk 1.3's document, the only class which implements
> >>AccessibleHyperlink is
> >>JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink
> >>(http://java.sun.com/j2se/1.3/docs/api/javax/swing/JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink.html)
> >>And this class actually does not support any multi-anchor hyperlink.
> >>See its codes:
> >>            public int getAccessibleActionCount() {
> >>                return 1;
> >>            }
> >>and
> >>            public Object getAccessibleActionObject(int i) {
> >>                if (i == 0 && isValid() == true) {
> >>                    AttributeSet as = element.getAttributes();
> >>                    AttributeSet anchor =
> >>                        (AttributeSet) as.getAttribute(HTML.Tag.A);
> >>                    String href = (anchor != null) ?
> >>                        (String) anchor.getAttribute(HTML.Attribute.HREF) : null;
> >>                    if (href != null) {
> >>                        URL u;
> >>                        try {
> >>                            u = new URL(JEditorPane.this.getPage(), href);
> >>                        } catch (MalformedURLException m) {
> >>                            u = null;
> >>                        }
> >>                        return u;
> >>                    }
> >>                }
> >>                return null;  // link invalid or i != 0
> >>            }
> >>It always return 1 for count and only support the index 0.
> >>So, if we have such kind of hypertext, how  do we construct anchors for it?
> >><a> first part <img src=second.img> third part</a>
> >>Now, in mozilla, it will be exposed as a link accNode(ROLE_LINK) with three
> >>accChildren, accNodeA (ROLE_TEXT) for " first part",
> >>accNodeB(ROLE_GRAPHIC) for
> >>the "second.img" , accNodeC(ROLE_TEXT) for "third part".
> >>In my opinion, it should be a hyperlink with *3* anchors with the same
> >>action(url). Although it actually has just one tag <a href=>, it will be
> >>showed as three part in user interface in *3* area.
> >>Hi, Bill and Aron and John, could u tell what your suggestions are ?
> >>
> >>  You can alse find thees questions at
> >><http://bugzilla.mozilla.org/show_bug.cgi?id=150603#c4>
> >>and  <http://bugzilla.mozilla.org/show_bug.cgi?id=150603#c5>
> >>
> >>Thanks & Best regards
> >>Gilbert
> >>    
> >>
> 
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]