Last Comment Bug 340802 - New ATK: Implement AtkDocument support
: New ATK: Implement AtkDocument support
Status: RESOLVED FIXED
: access
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: ---
Assigned To: Evan Yan
:
: alexander :surkov
Mentors:
Depends on:
Blocks: newatk
  Show dependency treegraph
 
Reported: 2006-06-08 03:27 PDT by Aaron Leventhal
Modified: 2006-08-21 00:00 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch without new added file (5.24 KB, patch)
2006-07-25 22:40 PDT, Evan Yan
no flags Details | Diff | Splinter Review
accessible/src/atk/nsMaiInterfaceDocument.h (2.33 KB, patch)
2006-07-25 22:41 PDT, Evan Yan
ginn.chen: review+
Details | Diff | Splinter Review
new added cpp file (5.01 KB, patch)
2006-07-25 22:42 PDT, Evan Yan
no flags Details | Diff | Splinter Review
patch_v2 without new added file (Addressing Ginn's commment) (5.21 KB, patch)
2006-07-26 20:03 PDT, Evan Yan
ginn.chen: review+
Details | Diff | Splinter Review
cpp file (addressing Aaron's comment) (4.99 KB, patch)
2006-07-26 20:08 PDT, Evan Yan
ginn.chen: review-
Details | Diff | Splinter Review
cpp file, addression ginn's comments. (5.06 KB, patch)
2006-08-15 03:23 PDT, Evan Yan
ginn.chen: review+
aaronlev: review+
Details | Diff | Splinter Review

Description Aaron Leventhal 2006-06-08 03:27:48 PDT
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
Comment 1 Evan Yan 2006-07-25 22:40:03 PDT
Created attachment 230699 [details] [diff] [review]
patch without new added file
Comment 2 Evan Yan 2006-07-25 22:41:23 PDT
Created attachment 230700 [details] [diff] [review]
accessible/src/atk/nsMaiInterfaceDocument.h
Comment 3 Evan Yan 2006-07-25 22:42:29 PDT
Created attachment 230701 [details] [diff] [review]
new added cpp file

accessible/src/atk/nsMaiInterfaceDocument.cpp
Comment 4 Ginn Chen 2006-07-25 23:28:09 PDT
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}
Comment 5 Aaron Leventhal 2006-07-26 06:36:45 PDT
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?
Comment 6 Evan Yan 2006-07-26 20:03:16 PDT
Created attachment 230835 [details] [diff] [review]
patch_v2 without new added file (Addressing Ginn's commment)
Comment 7 Evan Yan 2006-07-26 20:08:51 PDT
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?
Comment 8 Aaron Leventhal 2006-07-26 20:25:06 PDT
(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.
Comment 9 Evan Yan 2006-07-26 20:28:35 PDT
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.
Comment 10 Ginn Chen 2006-08-14 02:08:31 PDT
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.
Comment 11 Aaron Leventhal 2006-08-14 06:49:49 PDT
Okay, instead of DocType call it xml-doctype.
Comment 12 Aaron Leventhal 2006-08-14 06:50:06 PDT
Or w3c-doctype :)
Comment 13 Ginn Chen 2006-08-14 23:36:14 PDT
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.
Comment 14 Ginn Chen 2006-08-14 23:53:41 PDT
call nsAccessibleWrap::ReturnString twice in getDocumentAttributesCB is confusing, should use NS_ConvertUTF16toUTF8 directly instead.
Comment 15 Evan Yan 2006-08-15 03:23:29 PDT
Created attachment 233757 [details] [diff] [review]
cpp file, addression ginn's comments.
Comment 16 Ginn Chen 2006-08-15 04:15:26 PDT
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
Comment 17 Aaron Leventhal 2006-08-15 06:26:02 PDT
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.
Comment 18 Ginn Chen 2006-08-15 20:08:14 PDT
Committed.

Moved #if code from Makefile.in to nsMaiInterfaceDocument.cpp.

Note You need to log in before you can comment on or make changes to this bug.