If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

xbl script element does nothing

RESOLVED DUPLICATE of bug 58757

Status

()

Core
XBL
--
major
RESOLVED DUPLICATE of bug 58757
14 years ago
14 years ago

People

(Reporter: pb, Assigned: David Hyatt)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.05  [en]
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040206 Firefox/0.8

Regardless of position in an xbl document, and regardless of whether script
is defined inline or by relative URL, functions declared in the script element cannot be called.


Reproducible: Always
Steps to Reproduce:
1.create an xbl document
2.add the following code anywhere in the document.
<script id="myScript" type="text/javascript">
<![CDATA[
alert("The Script has been found");
function doStuff()
{
 alert("stuff done");
}
]]>
</script>
3. in the constructor for a binding in that document, add the line:
doStuff();
4. attach the binding to an element in the browser

Actual Results:  
an error message appears:
ReferenceError: doStuff is not defined

Expected Results:  
the script should have been "evaluated the first time a binding in the XBL file is attached to a bound element in the document".
This means that on binding, two alerts should appear, first "The Script has been found", when the binding attaches, then "stuff done" when the binding's constructor is called.

see: http://www.mozilla.org/projects/xbl/xbl.html#script
The spec and what we implement are rather unrelated... (and the spec is in the
process of being updated).

In any case, this has just not been implemented yet.

*** This bug has been marked as a duplicate of 58757 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.