Closed Bug 33577 Opened 25 years ago Closed 24 years ago

[DOM] event's in createContextualFragment

Categories

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

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: savov, Assigned: joki)

References

Details

(Whiteboard: [fixinhand][nsbeta3+])

Attachments

(1 file)

hello, first look at the code: <html> <title>haven't got :events & position:absolute in innerHTML</title> <script> HTMLElement.prototype.innerHTML setter = function (str) { // Remove all childNodes while (this.hasChildNodes()) this.removeChild(this.firstChild); var r = this.ownerDocument.createRange(); r.selectNodeContents(this); r.collapse(true); var df = r.createContextualFragment(str); this.appendChild(df); return str; } function init() { var theDiv = document.getElementById("theDiv"); var innerHTML = 'generated'; innerHTML += '<button id="theBut" style="position:absolute;top:0;left:0;" onclick="dump(this);">push me</button>'; innerHTML += '<button id="theBu1" style="position:absolute;top:100;left:0;" onclick="dump(this);">push me</button>'; theDiv.innerHTML = innerHTML; } </script> <body onload="init();"> <div id="theDiv" style="position:absolute;top:50;left:10;background:silver;width:500;height:200;overflow:auto;"> </div> <div style="position:absolute;top:255;left:10;background:silver;width:500;height:200;overflow:auto;"> must be... <button style="position:absolute;top:100;left:50;" onclick="dump(this);">push me</button> <button style="position:absolute;top:50;left:100;" onclick="dump(this);">push me</button> </div> </body> </html> the main pain for me is the events. i wonder why doesn't it works when i put it from innerHTML and the second one is style attribute position:absolute i think the position:absolute refers to the parent which in the case is the Div but as i can see in this case it refers to the body is thease a real bugs or i don't do something as should be. 10'x in advanced and please forgive me for my terrible english regards
*** Bug 34031 has been marked as a duplicate of this bug. ***
Joki, I think this one is yours (probably a dup).
Assignee: jst → joki
* Non directly bug-related comment (sorry)* Instead of the plain new createContextualFragment method (which is not, to my understanding, part of DOM2) wouldn't it be more logical to expand the underused DOM1 DocumentFragment so that it includes methods close, open, write and writeln already defined by object Document? A DocumentFragment having some functionality of Document would make sense, wouldn't it ?
Status: UNCONFIRMED → NEW
Ever confirmed: true
*** Bug 37195 has been marked as a duplicate of this bug. ***
*** Bug 36423 has been marked as a duplicate of this bug. ***
*** Bug 41479 has been marked as a duplicate of this bug. ***
This is probably a dupe of 7997 but I'm not 100% sure so I'm just going to make a dependency.
Status: NEW → ASSIGNED
Depends on: 7997
Adding [DOM] prefix to bugs related to DOM Level 0, 1, or 2 compatibility/compliance.
Summary: event's in createContextualFragment → [DOM] event's in createContextualFragment
Okay. I have a fix for this in my tree. Nominating nsbeta3
Keywords: nsbeta3
Whiteboard: [fixinhand]
*** Bug 44128 has been marked as a duplicate of this bug. ***
Marking nsbeta3+...
Whiteboard: [fixinhand] → [fixinhand][nsbeta3+]
Joki's fixes have been checked in by saari. Marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Mass update of qa contact
QA Contact: gerardok → janc
Verified: 2000-09-28-09-MN6 : Windows
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: