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)
Tracking
()
RESOLVED
INVALID
People
(Reporter: doronr, Unassigned)
Details
Attachments
(1 file)
1.06 KB,
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).
![]() |
||
Comment 1•19 years ago
|
||
Please attach a usable testcase. Chances are, though, you're messing with the iframe before it's fully set up is all.
Comment 2•19 years ago
|
||
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.
Reporter | ||
Comment 3•19 years ago
|
||
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
![]() |
||
Comment 4•19 years ago
|
||
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.
Description
•