Closed
Bug 85560
Opened 23 years ago
Closed 23 years ago
rows attribute of table object inaccessible
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
People
(Reporter: davisre, Assigned: jst)
References
Details
(Keywords: dom2, Whiteboard: DIGBug, r=peterv, sr=jst, a=dbaron)
Attachments
(3 files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.1+)
Gecko/20010607 Netscape6/6.1b1
BuildID: Gecko/20010607 Netscape6/6.1b1
Trying to access the "rows" attribute of an HTMLTableElement object causes the
following error to appear on the JavaScript console:
Error: uncaught exception: Permission denied to create wrapper for object
Reproducible: Always
Steps to Reproduce:
1. Get a table object using getElementById()
2. Try to access its rows (e.g. table.rows)
3. See the HTML sample below.
Sample HTML:
<html>
<script>
function test() {
var table = window.document.getElementById("foo");
alert(table);
alert(table.rows);
}
</script>
<body onload="test()">
<table id="foo">
<tr><td>one</td><td>two</td></tr>
</table>
</body>
</html>
Comment 1•23 years ago
|
||
Happens on Linux build 2001-06-11-08 as well.
Looks like nsGenericHTMLCollection needs classinfo. Patch coming up.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
Comment 2•23 years ago
|
||
Comment 3•23 years ago
|
||
Assignee | ||
Comment 5•23 years ago
|
||
This is a good start, but nsContentList already defines classinfo for
HTMLCollection, you'll need to name the classinfo something else and use the
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO_WITH_NAME macro to use your new
classinfo with the name HTMLCollection, i.e.
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO_WITH_NAME(HTMLTableChildCollection,
HTMLCollection)
Assignee | ||
Comment 6•23 years ago
|
||
Oh, and I think this is a dupe, btw, but I don't have the number of the other
bug handy...
Comment 7•23 years ago
|
||
I tried doing something like:
NS_CLASSINFO_MAP_BEGIN(HTMLGenericCollection)
NS_CLASSINFO_MAP_ENTRY(nsIDOMHTMLCollection)
NS_CLASSINFO_MAP_END
NS_INTERFACE_MAP_BEGIN(nsGenericDOMHTMLCollection)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLCollection)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO_WITH_NAME(HTMLGenericCollection,
HTMLCollection)
NS_INTERFACE_MAP_END
And adding:
NS_DEFINE_CLASSINFO_DATA(HTMLGenericCollection, nsHTMLCollectionSH,
ARRAY_SCRIPTABLE_FLAGS)
to nsDOMClassInfo.cpp, but I get the following assertion:
###!!! ASSERTION: Multiple GetIIDs function for the same nsDOMClassInfoID:
'sClassInfoData[aID].mGetIIDsFptr == aGetIIDsFptr', file nsDOMClassInfo.cpp,
line 996
###!!! Break: at file nsDOMClassInfo.cpp, line 996
Is this because I'm using nsHTMLCollectionSH? Or am I doing something else
wrong? Is there a good doc on the classinfo stuff somewhere? :)
Comment 8•23 years ago
|
||
jst: I thought it was a dup too, but I think we were both thinking of bug 83107
"Javascript table sort broken". jband said in that bug that
nsTableCellCollection needs to expose classInfo. Boris? ;)
Comment 9•23 years ago
|
||
Hmm. Actually, jst is sort of right. In bug 83107, nsTableCellCollection
inherits from GenericElementCollection, which inherits from
nsGenericDOMHTMLCollection.
In this bug, TableRowsCollection inherits directly from nsGenericDOMHTMLCollection.
So adding classinfo to nsGenericDOMHTMLCollection (which is what the patch tries
to do) fixes both bugs. It _seems_ to me that nsGenericDOMHTMLCollection should
have classinfo... but I could be wrong. Perhaps there are things that inherit
from it that should not be scriptable. jst? mstoltz?
Oh, the assertion disappeared when I did a full build (instead of just building
in dom/ and content/). So looks like that was just an artifact of something not
getting rebuilt that should have been in a different module. So attaching new
patch. :)
Comment 10•23 years ago
|
||
Comment 11•23 years ago
|
||
OK. I've searched through the source, and nsTableCellCollection and
TableRowsCollection are the only leaf classes inheriting from
nsGenericHTMLCollection. So this patch does the right thing. I've been running
with it for a few days and things work fine. Reviews please?
Whiteboard: DIGBug → DIGBug, r=?, sr=?, a=?
Comment 12•23 years ago
|
||
Peter, could you review this?
Comment 13•23 years ago
|
||
r=peterv if jst buys it :).
Assignee | ||
Comment 14•23 years ago
|
||
sr=jst
Updated•23 years ago
|
Whiteboard: DIGBug, r=?, sr=?, a=? → DIGBug, r=peterv, sr=jst, a=?
Comment 15•23 years ago
|
||
a=dbaron for trunk checkin (on behalf of drivers)
Keywords: review
Whiteboard: DIGBug, r=peterv, sr=jst, a=? → DIGBug, r=peterv, sr=jst, a=dbaron
Comment 16•23 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 17•23 years ago
|
||
tested on build 2001-06-21-11-0.9.1 windows 2000 for the testcase given
below...still got this error message in console resulting in not showing
alert...
error message in console---
Error: uncaught exception: Permission denied to create wrapper for object
reopening bug
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 18•23 years ago
|
||
sivarikan, this isn't a build off the 0.9.1 branch is it? It's a trunk build?
Could you possibly retest with a current nightly? This works fine for me with a
2001-06-27-22 nightly and with my CVS builds from June 27 and June 28
Assignee | ||
Comment 19•23 years ago
|
||
WORKSFORME with yesterdays nightly build, marking FIXED again.
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Comment 20•23 years ago
|
||
works ...shows the tableelement and the htmlcollection objects...
marking as verified...
Status: RESOLVED → VERIFIED
Comment 21•23 years ago
|
||
works ...shows the tableelement and the htmlcollection objects...
marking as verified...
verified on win2k
build --2001-07-09-09
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•