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

RESOLVED INVALID

Status

()

Core
JavaScript Engine
RESOLVED INVALID
13 years ago
4 years ago

People

(Reporter: Fernando Wendt, Unassigned)

Tracking

(Blocks: 1 bug, {regression, testcase})

Trunk
regression, testcase
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.8b2 -
blocking1.8b5 -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
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
Blocks: 268905

Updated

12 years ago
Flags: blocking1.8b2?
Flags: blocking1.7.6?
Flags: blocking-aviary1.1?

Updated

12 years ago
Flags: blocking1.7.6?

Updated

12 years ago
Flags: blocking1.8b2? → blocking1.8b2-

Updated

12 years ago
Flags: blocking-aviary1.1? → blocking1.8b4?
(Reporter)

Updated

12 years ago
Status: NEW → ASSIGNED

Updated

12 years ago
Flags: blocking1.8b4? → blocking1.8b4-
Created attachment 197317 [details]
testcase
Keywords: testcase
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

Comment 5

12 years ago
*** Bug 296858 has been marked as a duplicate of this bug. ***

Comment 6

11 years ago
*** Bug 346789 has been marked as a duplicate of this bug. ***

Updated

7 years ago
Duplicate of this bug: 557119

Comment 8

7 years ago
The same goes for "object" nodes.

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

/be

Updated

7 years ago
blocking2.0: --- → ?

Updated

7 years ago
blocking2.0: ? → beta7+

Updated

7 years ago
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?

Updated

7 years ago
blocking2.0: beta7+ → betaN+

Updated

7 years ago
blocking2.0: betaN+ → ---

Updated

6 years ago
Duplicate of this bug: 650671

Updated

6 years ago
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

Updated

6 years ago
Duplicate of this bug: 421102
>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
Last Resolved: 6 years ago
Resolution: --- → INVALID

Comment 17

4 years ago
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.