Closed
Bug 33577
Opened 25 years ago
Closed 24 years ago
[DOM] event's in createContextualFragment
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: savov, Assigned: joki)
References
Details
(Whiteboard: [fixinhand][nsbeta3+])
Attachments
(1 file)
(deleted),
text/html
|
Details |
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
Comment 3•25 years ago
|
||
* 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 ?
Updated•25 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 5•25 years ago
|
||
Assignee | ||
Comment 8•24 years ago
|
||
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
Assignee | ||
Comment 9•24 years ago
|
||
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
Assignee | ||
Comment 10•24 years ago
|
||
Okay. I have a fix for this in my tree.
Nominating nsbeta3
Keywords: nsbeta3
Whiteboard: [fixinhand]
Comment 11•24 years ago
|
||
*** Bug 44128 has been marked as a duplicate of this bug. ***
Comment 13•24 years ago
|
||
Joki's fixes have been checked in by saari. Marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•