Closed Bug 268945 Opened 20 years ago Closed 13 years ago

Applet (object, embed) tag returns function instead of object with typeof JavaScript method

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: fernando.wendt, Unassigned)

References

()

Details

(Keywords: regression, testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Firefox 1.0 seems to be handling the applet tag <applet> as a function, instead
a object as he does in version 9.0 and before.

The JavaScript engine has changed, or its a bug, because its returning a
function when applied a typeof() on the applet tag.

Reproducible: Always
Steps to Reproduce:
1.Insert a applet tag
2.Create a function to return the type of the tag (shoud be object)
3.FireFox 1.0 returns a function instead

Actual Results:  
Some JavaScript programing codes are no longer working.

Expected Results:  
It shoud be returning a object, like it does make before 1.0
Confirming for document.applets[n], and true of document.embeds[n] as well.
typeof returns function, but the member itself is an HTMLAppletElement (or
HTMLEmbedElement) object. Same thing with document.getElementById(objID), typeof
returns "function" but it appears to be the appropriate HTMLElement.

-->Core
Assignee: firefox → nobody
Severity: critical → normal
Status: UNCONFIRMED → NEW
Component: General → Plug-ins
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → plugins
Version: unspecified → 1.0 Branch
I'm not sure the plugin components is right, but the plugin interfaces did
change in the regression timeframe and may have affected this.
Keywords: regression
OS: Windows 2000 → All
Hardware: PC → All
Version: 1.0 Branch → Trunk
Flags: blocking1.8b2?
Flags: blocking1.7.6?
Flags: blocking-aviary1.1?
Flags: blocking1.7.6?
Flags: blocking1.8b2? → blocking1.8b2-
Flags: blocking-aviary1.1? → blocking1.8b4?
Status: NEW → ASSIGNED
Flags: blocking1.8b4? → blocking1.8b4-
Attachment #197317 - Attachment is patch: false
Attachment #197317 - Attachment mime type: text/plain → text/html
XPC_WN_WithCall object ops are confusing JS_TypeOfObject (see the third clause
in the ternary operator in the unhappy if statement). Should we be testing
OBJ_IS_NATIVE instead of a direct test against map->ops and js_ObjectOps?

Tentatively moving this to JS Engine.
Assignee: nobody → general
Status: ASSIGNED → NEW
Component: Plug-ins → JavaScript Engine
QA Contact: plugins → general
*** Bug 296858 has been marked as a duplicate of this bug. ***
*** Bug 346789 has been marked as a duplicate of this bug. ***
The same goes for "object" nodes.

var x = document.createElement("object");
typeof x; -- "function"
Blake, can you take this and fix it fast?

/be
blocking2.0: --- → ?
blocking2.0: ? → beta7+
Assignee: general → nobody
Component: JavaScript Engine → XPConnect
QA Contact: general → xpconnect
This really is a JS engine issue, no?  These objects have a [[Call]].  That's the only part where XPConnect is involved, and that part is correct.  The rest is all js-land...
Assignee: nobody → general
Component: XPConnect → JavaScript Engine
QA Contact: xpconnect → general
Why are we blocking 4.0 beta 7 on a six year old bug?
blocking2.0: beta7+ → betaN+
blocking2.0: betaN+ → ---
Summary: Applet tag returns function instead of object with typeof JavaScript method → Applet (object, embed) tag returns function instead of object with typeof JavaScript method
>This really is a JS engine issue, no?  These objects have a [[Call]].  That's
>the only part where XPConnect is involved, and that part is correct.  The rest
>is all js-land...

I am not familiar with DOM related stuff, but when these element have a [[Call]] method, ES5 wants us to say "function". If the [[Call]] method is not intentional it's probably a DOM bug.
The [[Call]] is very intentional on the DOM side: these are callable objects.
I think this bug is invalid these object have a [[Call]] internal method and ES5 11.4.3 explicitly say "Object (native or _host_ and does implement [[Call]])" => "function".
Blocks: 545565
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
As someone just now hitting this issue and trying to make sense of the history for this ticket resolution, why on earth are Embed/Object elements callable in the first place?
That's an excellent question.  As far as anyone can tell, because some plug-ins do something when you call them and no one wants to break that for compat reasons...  But maybe we should break it after all.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: