Closed Bug 153505 Opened 23 years ago Closed 19 years ago

Adding elements into an html:iframe do not display (dom accessing works)

Categories

(Core :: XBL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: doronr, Unassigned)

Details

Attachments

(1 file)

(deleted), application/xhtml+xml
Details
Here is the binding. I am adding content to the xbl created html:iframe. the innerHTML of the iframe's document shows the text node, I can walk the iframe's DOM to get to the text node, but it doesn't get shown in the iframe itself. <binding id="myElement"> <implementation> <constructor> <![CDATA[ var myIFrame = document.getAnonymousNodes(this)[0]; var myDoc = myIFrame.contentDocument; var myText = myDoc.createTextNode("TEst!!!!!"); myDoc.getElementsByTagName('body')[0].appendChild(myText); dump("\n IFrame's Body Content: "+myIFrame.contentDocument.documentElement.innerHTML + "\n") ]]> </constructor> </implementation> <content> <html:iframe height="360" width="400"></html:iframe><html:div style="color:green;"><children/></html:div> </content> </binding> According to bryner, no one has tried this before. Also, not sure if it matters, the DOM Inspector does display the iframe and its body element, but the body element is shown to have no children (yet walking the dom myself does get me to the text node).
Assignee: hyatt → general
Blocks: 296931
Please attach a usable testcase. Chances are, though, you're messing with the iframe before it's fully set up is all.
Attached file testcase (deleted) —
Sorry, bug 296931 had nothing to do with this, I misunderstood what this bug was about. I think this works just fine. I just need a small delay to make sure the iframe has been loaded, before I can add content to it with dom methods.
No longer blocks: 296931
Would be nice if constructor were called once all the content has finished loading, but oh well :)
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
This is the same issue as if you createElement an iframe, append it to the document, and then immediately modify the DOM. The constructor is being called when it should be -- when the iframe is created...
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: