Map SVG graphic elements to accessibility API

RESOLVED FIXED in mozilla20

Status

()

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

People

(Reporter: surkov, Assigned: surkov)

Tracking

(Blocks: 1 bug)

unspecified
mozilla20
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

8.83 KB, patch
tbsaunde
: review+
Robert Longson
: review+
Details | Diff | Splinter Review
(Assignee)

Description

5 years ago
http://www.w3.org/TR/SVG/intro.html#TermGraphicsElement:

graphics element
    One of the element types that can cause graphics to be drawn onto the target canvas. Specifically: ‘circle’, ‘ellipse’, ‘image’, ‘line’, ‘path’, ‘polygon’, ‘polyline’, ‘rect’, ‘text’ and ‘use’.
(Assignee)

Comment 1

5 years ago
Created attachment 693805 [details] [diff] [review]
patch
Attachment #693805 - Flags: review?(trev.saunders)
(Assignee)

Comment 2

5 years ago
Btw, probably these elements should implement IA2 IAccessibleImage interface. I can do that as follow up if it's needed. Mick, let me know if NVDA relies on it.

And svg:image element should expose @src object attribute at least to be consistent with HTML/XUL images. I can do that if that's needed as well.

Comment 3

5 years ago
Comment on attachment 693805 [details] [diff] [review]
patch

>+      } else if (content->Tag() == nsGkAtoms::rect ||
>+                 content->Tag() == nsGkAtoms::circle ||
>+                 content->Tag() == nsGkAtoms::ellipse ||
>+                 content->Tag() == nsGkAtoms::line ||
>+                 content->Tag() == nsGkAtoms::path ||
>+                 content->Tag() == nsGkAtoms::polygon ||
>+                 content->Tag() == nsGkAtoms::polyline ||
>+                 content->Tag() == nsGkAtoms::image) {

Perhaps you should check that the frame is a nsGkAtoms::svgPathGeometryFrame instead?
(Assignee)

Comment 4

5 years ago
(In reply to Robert Longson from comment #3)
> Comment on attachment 693805 [details] [diff] [review]
> patch
> 
> >+      } else if (content->Tag() == nsGkAtoms::rect ||
> >+                 content->Tag() == nsGkAtoms::circle ||
> >+                 content->Tag() == nsGkAtoms::ellipse ||
> >+                 content->Tag() == nsGkAtoms::line ||
> >+                 content->Tag() == nsGkAtoms::path ||
> >+                 content->Tag() == nsGkAtoms::polygon ||
> >+                 content->Tag() == nsGkAtoms::polyline ||
> >+                 content->Tag() == nsGkAtoms::image) {
> 
> Perhaps you should check that the frame is a nsGkAtoms::svgPathGeometryFrame
> instead?

is it equivalent to all these checks? (including imgage?)

Comment 5

5 years ago
image frames are nsGkAtoms::svgImageFrame but their implementation is basically

class nsSVGImageFrame : public nsSVGPathGeometryFrame 

So something like this should work

nsSVGPathGeometryFrame* pathGeometryFrame = do_QueryFrame(frame);
if (pathGeometryFrame) {
}
(Assignee)

Comment 6

5 years ago
Ok, nice, I will update the patch. Thanks!
(Assignee)

Comment 7

5 years ago
(In reply to Robert Longson from comment #5)
> image frames are nsGkAtoms::svgImageFrame but their implementation is
> basically
> 
> class nsSVGImageFrame : public nsSVGPathGeometryFrame 
> 
> So something like this should work
> 
> nsSVGPathGeometryFrame* pathGeometryFrame = do_QueryFrame(frame);
> if (pathGeometryFrame) {
> }

do_QueryFrame gives an error:

c:\mozilla\1912\obj-ff-dbg\dist\include\nsQueryFrame.h(69) : error C2385: ambiguous access of 'kFrameIID'
        could be the 'kFrameIID' in base 'nsIFrame'
        or could be the 'kFrameIID' in base 'nsISVGChildFrame'
        c:/mozilla/1912/accessible/src/base/nsAccessibilityService.cpp(920) : see reference to function template instantiation 'do_QueryFrame::operator Dest(void)<nsSVGPathGeometryFrame>' being compiled
        with
        [
            Dest=nsSVGPathGeometryFrame
        ] 

cause by missed NS_DECL_QUERYFRAME_TARGET(nsSVGPathGeometryFrame) I think.

Alternatively we could use nsIFrame::AccessibleType() approach.
(Assignee)

Comment 8

5 years ago
Created attachment 694231 [details] [diff] [review]
patch2
Attachment #693805 - Attachment is obsolete: true
Attachment #694231 - Flags: review?(trev.saunders)
Attachment #694231 - Flags: review?(longsonr)
Attachment #693805 - Flags: review?(trev.saunders)

Updated

5 years ago
Attachment #694231 - Flags: review?(longsonr) → review+
Comment on attachment 694231 [details] [diff] [review]
patch2

It might be nice to use tree test to make sure kids are correct to
Attachment #694231 - Flags: review?(trev.saunders) → review+
(Assignee)

Comment 10

5 years ago
(In reply to Trevor Saunders (:tbsaunde) from comment #9)

> It might be nice to use tree test to make sure kids are correct to

they don't really have kids and don't expose hierarchies. that's why I pushed them as plain roles check.

Comment 11

5 years ago
(In reply to alexander :surkov from comment #2)
> Btw, probably these elements should implement IA2 IAccessibleImage
> interface. I can do that as follow up if it's needed. Mick, let me know if
> NVDA relies on it.
> And svg:image element should expose @src object attribute at least to be
> consistent with HTML/XUL images. I can do that if that's needed as well.
We do not make use of IAccessibleImage in NVDA. However, src attribute might be nice.
(Assignee)

Comment 12

5 years ago
bug 824320 filed for scr object attribute
(Assignee)

Comment 13

4 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/cf9f18d9c698
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/cf9f18d9c698
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.