Closed
Bug 36240
Opened 25 years ago
Closed 23 years ago
Implement nsHTMLObjectElement::GetContentDocument()
Categories
(Core Graveyard :: Plug-ins, defect, P3)
Core Graveyard
Plug-ins
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.9
People
(Reporter: jst, Assigned: peterlubczynski-bugs)
References
Details
Attachments
(1 file)
(deleted),
patch
|
fabian
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
The Level 2 DOM defines a contentDocument attribute on the HTMLObjectElement
interface, this should be implemented in mozilla if possible. Currently the
method always returns a null contentDocument but if the plugin contains a
DOM document that is accessible to the scripting environment then that should be
returned. I don't know enough about plugins to say if this is at all possible,
if it's not then I guess this is an invalid bug.
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way
-- please attach your concern to the bug for reconsideration.
Target Milestone: M19 → Future
Does this bug also apply to IFRAMEs?
DOM2 similarly defines a contentDocument attribute on the HTMLIframeElement
interface, and this also seems to return null.
Perhaps this is a DOM2 rather than a plug-in problem?
Apologies. Retracting previous comment.
contentDocument property of IFRAME does work; I had the script after the <iframe
src=...>, but I suspect it was executing before the src of the IFRAME had
loaded.
When the script is called later, it works fine.
Assignee | ||
Comment 4•23 years ago
|
||
This probably has to do with [Bug 678] text/html and text/plain OBJECTs don't
work.
Should nsHTMLObjectElement::GetContentDocument() return the handel to the
document for OBJECT tag embedded text/html cases?
Reporter | ||
Comment 5•23 years ago
|
||
nsHTMLObjectElement::GetContentDocument() should return a reference to the
document object inside the object plugin, or whatever, not a pointer to the
document in which the object tag was found.
Comment 7•23 years ago
|
||
One note, this bug prevents developers from accessing the embedded document's DOM
through Javascript. The only alternative is using an IFRAME (which does have
GetContentDocument() implemented), which is bad because it's deprecated, it's a
frame, etc, etc. It also makes it pretty pointless that Moz supports text/html
in an OBJECT but developer's can't get access to it.
This would probably be good to have implemented so Moz doesn't make developers
use deprecated HTML.
I'd like to see this in for 1.0; I've already been bitten by it.
Assignee | ||
Comment 8•23 years ago
|
||
I think I can do this by following the example set forth in:
http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsHTMLIFrameElement.cpp#171
Assignee: av → peterlubczynski
Status: ASSIGNED → NEW
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Target Milestone: Future → mozilla0.9.6
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla1.0
Comment 9•23 years ago
|
||
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1
(you can query for this string to delete spam or retrieve the list of bugs I've
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Comment 10•23 years ago
|
||
Well, just stupid yank-and-paste, but seems to work :-)))
(I was able to get url of content document from javascript).
Could anyone review this?
Comment 11•23 years ago
|
||
Comment on attachment 70489 [details] [diff] [review]
nsHTMLObjectElement::GetContentDocument() impl
sounds great and clean, but do you really need all the blank lines in there?
:-)
Also, are you sure all those includes are really needed?
r=fabian anyway
Attachment #70489 -
Flags: review+
Comment 12•23 years ago
|
||
Yes, I need all includes I added - just to make the code to compile :-)
Updated•23 years ago
|
Assignee | ||
Comment 13•23 years ago
|
||
Nice Denis!
jonnny, can you sr=?
Target Milestone: mozilla1.0.1 → mozilla0.9.9
Reporter | ||
Comment 14•23 years ago
|
||
Comment on attachment 70489 [details] [diff] [review]
nsHTMLObjectElement::GetContentDocument() impl
>+ presShell->GetSubShellFor(this, getter_AddRefs(tmp));
>+ NS_ENSURE_TRUE(tmp, NS_OK);
>+
>+ nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(tmp);
>+ NS_ENSURE_TRUE(webNav, NS_OK);
>+
Um, presShell->GetSubShellFor() will return the sub presshell if there is one,
and the presshell does *not* implement nsIWebNavigation, so this won't work.
Also, don't use NS_ENSURE_* in places that can fail for valid reasons, like
after the GetSubShellFor() call, it will assert in debug builds, but there's no
reason to assert there.
Attachment #70489 -
Flags: needs-work+
Comment 15•23 years ago
|
||
> Um, presShell->GetSubShellFor() will return the sub presshell if there is one,
> and the presshell does *not* implement nsIWebNavigation, so this won't work.
But it worked when I tested it... And it's works for nsHTMLIFrameElement.
Reporter | ||
Comment 16•23 years ago
|
||
Comment on attachment 70489 [details] [diff] [review]
nsHTMLObjectElement::GetContentDocument() impl
Oh, oops, my bad. Sorry, should've looked closer at the presshell code. Yes,
the code looks fine, except for the overly eager use of NS_ENSURE_*, replace
the ones of those that could end up asserting with
if (...)
return NS_...;
and you'll have sr=jst
Attachment #70489 -
Flags: needs-work+ → superreview+
a=roc+moz for 0.9.9
Assignee | ||
Comment 18•23 years ago
|
||
patch in trunk, marking FIXED
Updated•23 years ago
|
Keywords: mozilla0.9.9+
Comment 19•23 years ago
|
||
http://web.vee.net/mozilla/object.html
nsHTMLObjectElement::GetContentDocument() returns object "HTMLDocument" and not
'null'. used 0221 trunk builds on all plfs.
Status: RESOLVED → VERIFIED
Updated•2 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•