Closed Bug 372740 Opened 17 years ago Closed 16 years ago

The document.Script object is not supported

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

VERIFIED WONTFIX

People

(Reporter: mark, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20060601 Firefox/2.0.0.2 (Ubuntu-edgy)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20060601 Firefox/2.0.0.2 (Ubuntu-edgy)

An web application that our company licenses for internal use doesn't work with Firefox due to it's use of the non-standard (IE) object 'document.Script'.

The document.Script object is a non-standard IE extension to the DOM. A Mozilla porting guide[1] notes that Mozilla does not allow DOM elements to be accessed via 'document.elementName'. 

Please see the attached testcase for a complete example of the problem. 

1. http://developer.mozilla.org/en/docs/Migrate_apps_from_Internet_Explorer_to_Mozilla#Accessing_elements

Reproducible: Always

Steps to Reproduce:
1. Create an HTML file with a JavaScript <script> block.
2. Write an example function named 'foo' 
3. Try to invoke the function using 'document.Script.foo()'
Actual Results:  
The foo() function is not invoked.

Expected Results:  
The foo() function should be invoked.
Does it have any actual purpose? And perhaps more importantly, has it ever been documented, anywhere? I couldn't find a shred of documentation, and the few non-Pascal instances google.com/codesearch knows of seem to be "how to prompt for user input from WSH by creating an instance of IE and manipulating it."
Assignee: nobody → general
Component: General → DOM
OS: Linux → All
Product: Firefox → Core
QA Contact: general → ian
Hardware: PC → All
Version: unspecified → Trunk
(In reply to comment #2)

appears to be a synonym for window as ie7 alerts true for 
javascript:alert(window == document.Script)
This appears to be a strange and undocumented IE hack. I was also unable to find any documentation for the document.Script object.

The web application was using it as a convenience to allow functions from other pages to be invoked without continually referring to the absolute DOM location of the page containing the function.

For example, at the top of the script it would create a global dispatch variable named 'obj':

    var obj = parent.document.Script;

This creates an object whose methods are aliases to all of the functions contained in the parent document. And then throughout the rest of the script it would call methods of 'obj' instead of directly calling the function from the parent page.

For example, they would call:

     obj.doStuff();

Instead of calling:

     parent.doStuff();

Don't ask me why or how the developers of the web application decided to use this undocumented technique. I have sent them a bug report asking them to use a more normal way to invoke functions. 
Note that doing:

  var obj = parent;
  obj.doStuff()

... would work as well.
Is the Script object mentioned here the same that has been removed in Firefox 3?
There's anote about it in "Firefox 3 for developers": https://developer.mozilla.org/en/Updating_web_applications_for_Firefox_3#JavaScript_changes

If that's the case, this bug is either Won'tFix or Invalid.
Not an extension we're going to want to support, given the craziness and lack of documentation.  From what you described, |obj = parent.document| would have the same effect.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
shaver: obj = parent, not object = parent.document.

In reply to comment 6, no, this is nothing to do with the SpiderMonkey Script object, late and unlamented.

/be
Assignee: general → nobody
Status: RESOLVED → VERIFIED
QA Contact: ian → general
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: