Closed Bug 93649 Opened 24 years ago Closed 24 years ago

document.plugins === document.embeds in NN4 while document.plugins === navigator.plugins in Mozilla

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: martin.honnen, Assigned: fabian)

References

()

Details

Attachments

(1 file)

I stumbled today over the following: in NN4.06+ document.plugins === document.embeds evals to true while in Mozilla we have document.plugins === navigator.plugins I think Mozilla should be backwards compatible with NN4 so I am opening this bug. Note that the fix of bug http://bugzilla.mozilla.org/show_bug.cgi?id=9392 seems to have caused this but I can't understand why the fix implemented a different behaviour in Mozilla than there is in NN4. document.plugins is not part of any standard so if Mozilla supports it it should be backwards compatible with NN4.
Confirming that this is still happening.... ...sounds like a DOM bug
Assignee: av → jst
Component: Plug-ins → DOM Level 0
Keywords: 4xp
OS: Windows 95 → All
QA Contact: shrir → desale
Hardware: PC → All
SEVERITY = LOW [(1)No Crash, (2)Good functional failure, (3)No Cosmetic failure] VISIBILITY = HIGH [(1) real website usage could be high because of backward compatibility. (2)Gets one point of compatibility with other browsers since it works very well on NS4.x. (3)Gets one more point on compliance with adopted techonology which is JS] PRIORITY = VISIBILITY * SEVERITY Hence Priority = p3 adding word "qawanted" because I'm setting this priority on available data & if someone feels otherwise then please investigate this more & feel free to change this priority.
Keywords: qawanted
Priority: -- → P3
Stealing this bug. Patch coming up.
Assignee: jst → hidday
Keywords: qawanted
Target Milestone: --- → mozilla1.0
There is a problem... .plugins is part of nsIDOMNSDocument.idl, which means it's implemented only by nsDocument. .embeds is part of nsIDOMNSHTMLDocument.idl, which means it's implemented only by nsHTMLDocument. We have two solutions: 1) Move .plugins to be only available to html documents (my preferred solution) 2) Make each subclass of nsDocument implement the method. However I don't know why documents other than HTML should need access to it, and they can always use navigator.plugins Thoughts?
Status: NEW → ASSIGNED
Given that document.plugins should be equal to document.embeds it doesn't make sense for document.plugins to be available on any other documents than HTML. I believe that when document.plugins was implemented (incorrectly) the belief was that since it was equal to navigator.plugins it made sense to put it on all documents. I agree with Fabian, let's move it from nsIDOMNSDocument to nsIDOMNSHTMLDocument. Thanks Fabian for looking into this!
Attached patch Proposed fix.Splinter Review
Comment on attachment 69475 [details] [diff] [review] Proposed fix. >+// Mapped to document.embeds for NS4 compatibility >+NS_IMETHODIMP >+nsHTMLDocument::GetPlugins(nsIDOMHTMLCollection** aPlugins) >+{ >+ *aPlugins = nsnull; You don't need this here since you're simply forwarding this call to GetEmbeds(), GetEmebeds() is responsible for nulling out this parameter. >+ >+ return GetEmbeds(aPlugins); > } > Other than that, this looks awesome. Thank you Fabian for the quick fix, sr=jst
Attachment #69475 - Flags: superreview+
Comment on attachment 69475 [details] [diff] [review] Proposed fix. whee! comments in interfaces! r=bzbarsky
Attachment #69475 - Flags: review+
i'm marking this nsbeta1 as an extra precaution so that it goes on the radar, but thanks Fabian for fixing it :-)
Keywords: nsbeta1
Checked in the trunk, marking FIXED, thanks for the reviews :-)
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Oh, I'd just like to say a booh to the reviewers for not catching that I had forgotten nsXULDocument.cpp in my diff. That almost broke the build :-P
Oops! :-)
Verified with builds 2002-04-12-10 on WinNT.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: