I'm a beginner in Firefox extension development and I want to check if
a table on a website is used for layout. I do this with the
"isProbablyForLayout()" function within a little Firefox extension but
it don't work. I use the function "getAccessibleFor(domNode)" in my
JavaScript code, I get the right role of the accessible table-node, but
the "parentNode" and "numChildren" are undefined.
Did I get for each table on a website an nsIAccessible?
Can anyone help me?
Horst
You can see some code that uses those interfaces in JS here:
http://www.mozilla.org/access/qa/jstest.html
The problem with parentNode and numChildren is that those
are not defined attributes in nsIAccessible or
nsIAccessibleTable. Those sound more like DOM attributes --
nothing to do with the accessible table. You need to get
those from the original node, not the "accessible" node
which you received from getAccessibleFor.
- Aaron
Thanks for your help.
But I still have a question: can I get for each table on a website an
nsIAccessible?
Horst
- Aaron
> Yes, for each table on a website you can get an
> nsIAccessible. In Firefox 3 you can also get an
> nsIAccessibleTable for it.
>
> - Aaron
>
Thanks again.
Did anybody know when Firefox 3.0 release will come out next year?
Horst
I notice that the last 3 releases have been 1 year
apart each time. On the other end of the spectrum
are optimistic planners saying this Spring.
- Aaron
1. What is exactly checked with the following:
"content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary)" -
(from: // Check for legitimate data table elements or attributes)
2. Is " RETURN_LAYOUT_ANSWER(PR_TRUE, ...." right in the following:
// Check for many rows
const PRInt32 kMaxLayoutRows = 20;
if (rows > kMaxLayoutRows) { // A ton of rows, this is probably for
data ....
- or is it "PR_FALSE"?
Horst
For item #2, that's clearly a mistake in our code.
You're correct, it should return false there.
File a bug for these issues and attached a patch
https://bugzilla.mozilla.org/show_bug.cgi?id=360106
- Aaron