Last Comment Bug 226193 - Javascript exception when accessing document["config"] or document["domConfig"]
: Javascript exception when accessing document["config"] or document["domConfig"]
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal with 3 votes (vote)
: mozilla6
Assigned To: Nobody; OK to take it and work on it
: 239550 262981 295581 302383 360654 362132 (view as bug list)
Depends on: 615509
  Show dependency treegraph
Reported: 2003-11-19 03:49 PST by Hubert Kauker
Modified: 2011-05-01 18:58 PDT (History)
18 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

testcase (497 bytes, text/html)
2003-11-19 08:34 PST, Zibi Braniecki [:gandalf][:zibi]
no flags Details

Description Hubert Kauker 2003-11-19 03:49:55 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6a) Gecko/20031030
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6a) Gecko/20031030

"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED)

when the following javascript loop is run:

	for( var p in window.document )
		try {
			var v = window.document[p];
		catch(e) { 
			alert ( e.message );

This both happens before and after the onload event of the window.
At the point of exception we have p == "config".

Reproducible: Always

Steps to Reproduce:
1.Include above script fragment into SCRIPT element in HEAD of a document.
2.Optionally enclose the code by window.onload = function() { ... }
3.Load the document.

Actual Results:  
Alert() is shown containing message:

Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED)

Expected Results:  
Should have executed the loop without any visible action.
Comment 1 Zibi Braniecki [:gandalf][:zibi] 2003-11-19 08:34:07 PST
Confirming with Linux Firebird 0.7+
Comment 2 Zibi Braniecki [:gandalf][:zibi] 2003-11-19 08:34:29 PST
Created attachment 135926 [details]
Comment 3 Zibi Braniecki [:gandalf][:zibi] 2003-11-19 08:35:38 PST
Comment on attachment 135926 [details]

This testcase throws error on "config" element in Mozilla Suite and on
"domConfig" element in Firebird
Comment 4 Boris Zbarsky [:bz] 2003-11-19 09:03:07 PST
It throws on domConfig on both, actually, if you use a recent suite or
something.  And that's correct -- you are accessing a DOM3 property that is in
fact not implemented....

Is there a reason here to make it not throw?

Anyway, not JS engine; the "Component returned failure code" means it's an error
in the Mozilla code somewhere.
Comment 5 Zibi Braniecki [:gandalf][:zibi] 2003-11-19 09:09:31 PST
then why it can be iterated with for-in ?
Comment 6 Boris Zbarsky [:bz] 2003-11-19 09:24:05 PST
Because it _is_ defined as a property on the nsIDOM3Document interface.  It's
just one that throws if you try to access its getter.

Please do not undo my component changes.  Thank you.
Comment 7 Zibi Braniecki [:gandalf][:zibi] 2003-11-19 09:33:53 PST
Ouch. Sorry - ctrl+r in Gecko leaves selects in old position.

So what kind of bug is it? 

The goal is to remove not implemented method/property from interface or to
implement it?!?
Comment 8 Boris Zbarsky [:bz] 2003-11-19 09:53:23 PST
The goal is to eventually implement this.
Comment 9 Boris Zbarsky [:bz] 2004-04-03 17:51:01 PST
*** Bug 239550 has been marked as a duplicate of this bug. ***
Comment 10 Boris Zbarsky [:bz] 2004-10-06 10:34:31 PDT
*** Bug 262981 has been marked as a duplicate of this bug. ***
Comment 11 WADA 2005-07-27 15:01:06 PDT
*** Bug 302383 has been marked as a duplicate of this bug. ***
Comment 12 Boris Zbarsky [:bz] 2005-07-29 14:36:03 PDT
*** Bug 295581 has been marked as a duplicate of this bug. ***
Comment 13 Phil Ringnalda (:philor) 2006-11-14 07:51:30 PST
*** Bug 360654 has been marked as a duplicate of this bug. ***
Comment 14 Erik Fabert 2006-11-28 13:01:41 PST
*** Bug 362132 has been marked as a duplicate of this bug. ***
Comment 15 James Justin Harrell 2007-03-27 23:21:41 PDT
> Is there a reason here to make it not throw?

Iterating over document can throw an error, even if there's no attempt to use the property.

for each( var propValue in document ) { ... }
for( var [propName, propValue] in document ) { ... }
Comment 16 Georg Maaß 2007-06-23 08:54:10 PDT
In XulRunner trunk: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; de-DE; rv:1.9a5pre) Gecko/20070525 this bug occures too.
Comment 17 Tom Schuster [:evilpie] 2011-04-30 10:40:31 PDT
domConfig was removed by Bug 615509.
Comment 18 Georg Maaß 2011-04-30 10:51:12 PDT
Status should be set to RESOLVED WONT FIX as this bug is not invalid for the release it was filed for, but is obsolete for upcoming release. So status RESOLVED INVALID is not correct. Correct status is RESOLVED WONT FIX because the domConfig interface this bug belongs to will be removed in XulRunner 6.0.
Comment 19 Tom Schuster [:evilpie] 2011-04-30 10:55:52 PDT
George Maaß not sure this was explained in an other way to me. This Bug is invalid because it refers to something that doesn't exists anymore. I think it's not important when it will be removed from where. But i have no experience with the DOM component, so it might as well we Wontfix. (Actually i don't really care about the resolution thought)
Comment 20 :Ms2ger (⌚ UTC+1/+2) 2011-05-01 01:30:45 PDT
I'd argue it's fixed: accessing document.domConfig doesn't throw anymore.
Comment 21 Biju 2011-05-01 15:46:07 PDT
The resolution should be WORKSFORME, see bug 385520
FIXED only when we exactly know which bug/patch fixed that.
Comment 22 Boris Zbarsky [:bz] 2011-05-01 18:58:20 PDT
Biju, we do know that.  The bug number is even listed in comment 17.

Verified fixed.  Please no more noise in this bug!

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