Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

nsIAccessibleTable

1 view
Skip to first unread message

Horst

unread,
Nov 2, 2006, 6:23:24 AM11/2/06
to
Hello,

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

Aaron Leventhal

unread,
Nov 2, 2006, 9:35:41 AM11/2/06
to Horst
The interface isn't frozen and you can try to use it in JS,
but you'll get an exception if you're not running a nightly
trunk build of what will become Firefox 3. It's just not
implemented in Firefox 2.

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

Horst

unread,
Nov 6, 2006, 4:05:54 AM11/6/06
to

Aaron Leventhal wrote:
> The interface isn't frozen and you can try to use it in JS,
> but you'll get an exception if you're not running a nightly
> trunk build of what will become Firefox 3. It's just not
> implemented in Firefox 2.
>
> 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 Leventhal

unread,
Nov 6, 2006, 9:01:46 PM11/6/06
to Horst
Yes, for each table on a website you can get an
nsIAccessible. In Firefox 3 you can also get an
nsIAccessibleTable for it.

- Aaron

Horst

unread,
Nov 7, 2006, 7:13:24 AM11/7/06
to

Aaron Leventhal schrieb:

> 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

Aaron Leventhal

unread,
Nov 7, 2006, 12:40:06 PM11/7/06
to
Anyone that gives you a date is just guessing.

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

Horst

unread,
Nov 9, 2006, 7:21:00 AM11/9/06
to

I checked out the sourcecode of "nsHTMLTableAccessible" from cvs and I
have two questions about the function "IsProbablyForLayout":

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

Aaron Leventhal

unread,
Nov 9, 2006, 9:46:14 AM11/9/06
to
For item #1, we're checking to see if the table
has a summary attribute. If we do, we assume it's
probably a data table. We're supposed to also
check for a <caption> descendent, but I see a
mistake in that line.

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

0 new messages