The default bug view has changed. See this FAQ.

New ATK: Implement AtkDocument support

RESOLVED FIXED

Status

()

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

People

(Reporter: Aaron Leventhal, Assigned: Evan Yan)

Tracking

({access})

Trunk
x86
Linux
access
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 3 obsolete attachments)

(Reporter)

Description

11 years ago
For any nsDocAccessible we can implement AtkDocument:
// Expose mime type here, available via nsIAccessibleDocument::GetMimeType()
const gchar* atk_document_get_document_type (AtkDocument *document);

// Not sure what to use this for, if anything
gpointer    atk_document_get_document       (AtkDocument *document);

// Use these to expose doc URL and doctype, also available via nsIAccessibleDocument
const gchar* atk_document_get_attribute_value
AtkAttributeSet* atk_document_get_attributes
(Reporter)

Updated

11 years ago
Assignee: aaronleventhal → gaomingcn
(Assignee)

Updated

11 years ago
Assignee: gaomingcn → Evan.Yan
(Assignee)

Comment 1

11 years ago
Created attachment 230699 [details] [diff] [review]
patch without new added file
Attachment #230699 - Flags: review?(ginn.chen)
(Assignee)

Comment 2

11 years ago
Created attachment 230700 [details] [diff] [review]
accessible/src/atk/nsMaiInterfaceDocument.h
Attachment #230700 - Flags: review?(ginn.chen)
(Assignee)

Comment 3

11 years ago
Created attachment 230701 [details] [diff] [review]
new added cpp file

accessible/src/atk/nsMaiInterfaceDocument.cpp
Attachment #230701 - Flags: review?(ginn.chen)

Comment 4

11 years ago
Comment on attachment 230699 [details] [diff] [review]
patch without new added file

+     (GInterfaceFinalizeFunc) NULL, NULL},
+#ifdef USE_ATK_TYPE_DOCUMENT
+    {(GInterfaceInitFunc)documentInterfaceInitCB,
      (GInterfaceFinalizeFunc) NULL, NULL}
+#endif

should be

+#ifdef 
+     (GInterfaceFinalizeFunc) NULL, NULL},
USE_ATK_TYPE_DOCUMENT
+    {(GInterfaceInitFunc)documentInterfaceInitCB,
+#endif
      (GInterfaceFinalizeFunc) NULL, NULL}
(Reporter)

Comment 5

11 years ago
Comment on attachment 230701 [details] [diff] [review]
new added cpp file

Nit: I suppose the normal way to name consts in Mozilla is something like kDocTypeName instead of DOC_TYPE_NAME.

Also, I don't think they need "Attribute." as a prefix since we already know they are attributes.

Question, are the attribute names supposed to be case sensitive or insensitive?
(Assignee)

Comment 6

11 years ago
Created attachment 230835 [details] [diff] [review]
patch_v2 without new added file (Addressing Ginn's commment)
Attachment #230699 - Attachment is obsolete: true
Attachment #230835 - Flags: review?(ginn.chen)
Attachment #230699 - Flags: review?(ginn.chen)
(Assignee)

Comment 7

11 years ago
Created attachment 230836 [details] [diff] [review]
cpp file (addressing Aaron's comment)

Aaron, I use g_ascii_strcasecmp() to compare the attribute names, so they're case insensitive, is that right?
Attachment #230701 - Attachment is obsolete: true
Attachment #230836 - Flags: review?(ginn.chen)
Attachment #230701 - Flags: review?(ginn.chen)
(Reporter)

Comment 8

11 years ago
(In reply to comment #7)
> Created an attachment (id=230836) [edit]
> cpp file (addressing Aaron's comment)
> 
> Aaron, I use g_ascii_strcasecmp() to compare the attribute names, so they're
> case insensitive, is that right?

I think case insensitive is good, but it would be useful if that's specified in ATK/AT-SPI.
(Assignee)

Comment 9

11 years ago
according to Ginn's suggesting, I'm writing a python testcase for this bug.

The testcase is originate from the testcase of bug 345825
its idea is to register a keystroke listener, and get the active window in the listener. Then traversal all the children and descendant to get the document object.
but now I have some problem of getting document object through queryInterface("IDL:Accessibility/Document:1.0"). it always return null even the role is "document frame".

I'm still working on that.

Updated

11 years ago
Whiteboard: testcase-needed

Comment 10

11 years ago
Aaron, I think to use "DocType" as attribute name is confusing.

We've atk_document_get_document_type, and we return mime type for it.
How could user tell the difference of document_type and "DocType" ?

BTW: I'm working on at-spi side and at-poke to get the api work, nearly finish.
(Reporter)

Comment 11

11 years ago
Okay, instead of DocType call it xml-doctype.
(Reporter)

Comment 12

11 years ago
Or w3c-doctype :)

Comment 13

11 years ago
Comment on attachment 230836 [details] [diff] [review]
cpp file (addressing Aaron's comment)

Change to "W3C-doctype", I found sometimes, accDocument->GetDocType doesn't succeed, I want to change to code sequence in getDocumentAttributesCB, so that we can still return DocURL in this case.
Attachment #230836 - Flags: review?(ginn.chen) → review-

Comment 14

11 years ago
call nsAccessibleWrap::ReturnString twice in getDocumentAttributesCB is confusing, should use NS_ConvertUTF16toUTF8 directly instead.
(Assignee)

Comment 15

11 years ago
Created attachment 233757 [details] [diff] [review]
cpp file, addression ginn's comments.
Attachment #230836 - Attachment is obsolete: true
Attachment #233757 - Flags: review?(ginn.chen)

Updated

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

Updated

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

Comment 16

11 years ago
Comment on attachment 233757 [details] [diff] [review]
cpp file, addression ginn's comments.

Aaron, I've verified this patch with patched at-spi and at-poke.

Patches in
http://bugzilla.gnome.org/show_bug.cgi?id=351409
http://bugzilla.gnome.org/show_bug.cgi?id=351427
Attachment #233757 - Flags: review?(ginn.chen)
Attachment #233757 - Flags: review?(aaronleventhal)
Attachment #233757 - Flags: review+
(Reporter)

Comment 17

11 years ago
Comment on attachment 233757 [details] [diff] [review]
cpp file, addression ginn's comments.

Okay. At some point we may want to move some of this code to core via new nsIAccessibleDocument methods which return an array. That would make it possible to easily add new document attributes as well as have them be accessible via scripting. However, since they are already available via scripting through the other calls, I think this is okay.
Attachment #233757 - Flags: review?(aaronleventhal) → review+

Comment 18

11 years ago
Committed.

Moved #if code from Makefile.in to nsMaiInterfaceDocument.cpp.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED

Updated

11 years ago
Whiteboard: testcase-needed
You need to log in before you can comment on or make changes to this bug.