Closed Bug 280277 Opened 15 years ago Closed 7 years ago

Add a contentWindow attribute to HTMLObjectElement

Categories

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

enhancement
Not set

Tracking

()

RESOLVED DUPLICATE of bug 827158

People

(Reporter: jwatt, Unassigned)

Details

(Keywords: html5)

Attachments

(1 obsolete file)

We have added a contentWindow member to the DOM for HTML frames. It would be
useful to do the same for the HTMLObjectElement interface.
Attached patch not sure where to go from here (obsolete) — Splinter Review
jst, I know I said I would do this, but I didn't think it would take as long as
I've spent on it so far. I've gotten stuck on every approach I've taken. The
main reason for that is probably because I'm splashing about in code that I
don't know. Anyway, here's what I think I'm doing right. If you could give me
an idea of where to proceed from here I'd appreciate it.
For the time being, since the subdocument is loaded by the frame, you could get
the primary frame, and then maybe add a method to some interface implemented by
nsSubDocumentFrame to get the right contentWindow?
jst: what do you think about adding contentDocument and contentWindow to
HTMLEmbedElement at the same time? If you think that's a good idea, can I add
the necessary members to the frozen nsIDOMHTMLEmbedElement interface, or should
I create an nsIDOMNSHTMLEmbedElement interface?
Status: NEW → ASSIGNED
Go for it, but add a new interface, don't change the frozen one.
Assignee: jwatt → general
Status: ASSIGNED → NEW
Assignee: general → nobody
QA Contact: ian → general
Keywords: html5
Whiteboard: [good first bug][mentor=Ms2ger]
So, we don't do frozen interfaces anymore, so the attribute can just be added to the nsIDOMHTMLObjectElement interface.

For the implementation, I think we can just get the nsIDocument like in nsHTMLObjectElement::GetContentDocument, and then get the window by calling GetWindow(). (Smarter people CC'd on this bug, please correct me if I'm wrong.)
You should probably do something more like nsGenericHTMLFrameElement::GetContentWindow (possibly reusing the "get stuff from the frameloader" code by refactoring that into a static method or a method on the frameloader).
Comment on attachment 172769 [details] [diff] [review]
not sure where to go from here

Most of this patch is no longer relevant with the more recent suggestions for how to implement this change.
Attachment #172769 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 827158
Whiteboard: [good first bug][mentor=Ms2ger] → [mentor=Ms2ger]
Whiteboard: [mentor=Ms2ger]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.