Closed
Bug 299231
Opened 19 years ago
Closed 19 years ago
[FIX]xbl bound elements generated from innerHTML don't work very well
Categories
(Core :: XBL, defect, P1)
Core
XBL
Tracking
()
RESOLVED
FIXED
mozilla1.8beta4
People
(Reporter: martijn.martijn, Assigned: bzbarsky)
References
Details
(Keywords: testcase)
Attachments
(3 files)
(deleted),
text/xml
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
sicking
:
review+
peterv
:
superreview+
benjamin
:
approval1.8b4+
|
Details | Diff | Splinter Review |
See upcoming tetscase.
I can't access properties, methods and so from xbl bounds elements generated
from innerHMTL.
I can access them when generated from a regular dom method (appendChild).
Reporter | ||
Comment 1•19 years ago
|
||
Reporter | ||
Comment 2•19 years ago
|
||
Reporter | ||
Comment 3•19 years ago
|
||
In the testcase, click on the "add xbl spans" button.
I would expect that the result for all the three tests be "true" with a green
background-color.
The "alert(span.thing)" button should alert 3 times 'true'.
Assignee | ||
Comment 4•19 years ago
|
||
I bet the problem is that we disable script execution on the script context
while setting innerHTML so that <script> nodes in it don't execute...
Perhaps we should just disable the scriptloader, not disable script in general?
Why do we do that? <script>s generated through .innerHTML should execute no?
Reporter | ||
Comment 6•19 years ago
|
||
See bug 214874 for why <script>s generated through .innerHTML should not execute.
Assignee | ||
Comment 7•19 years ago
|
||
Bug 116834 is what initially introduced the innerHTML not running scripts thing.
jst, was there a reason for disabling scripts on the context there instead of
just disabling the script loader? I guess the loader disabling is not a
counter, but neither is the script context thing...
Oh, and the surroundContents behavior on that testcase is somewhat correct, per
spec -- the new node is inserted first, then the kids its surrounding are
inserted; the constructor fires when there are no child nodes. So I would
expect to see the text we see, though I'm not sure yet why the background is red.
Assignee | ||
Comment 8•19 years ago
|
||
Actually, the surroundContents behavior is completely correct -- that
constructor throws an exception, as it should. I've filed bug 299741 on the
exception not making it to the JS console in a timely manner.
Assignee | ||
Comment 9•19 years ago
|
||
Attachment #188328 -
Flags: superreview?(peterv)
Attachment #188328 -
Flags: review?(bugmail)
Assignee | ||
Updated•19 years ago
|
Assignee: general → bzbarsky
OS: Windows 2000 → All
Priority: -- → P1
Hardware: PC → All
Summary: xbl bound elements generated from innerHTML don't work very well → [FIX]xbl bound elements generated from innerHTML don't work very well
Target Milestone: --- → mozilla1.8beta3
Updated•19 years ago
|
Attachment #188328 -
Flags: superreview?(peterv) → superreview+
Comment on attachment 188328 [details] [diff] [review]
Proposed fix
I'm still not convinced that disabling scripts in .innerHTML is the right thing
to do. But this is not the bug for that debate.
Attachment #188328 -
Flags: review?(bugmail) → review+
Assignee | ||
Comment 11•19 years ago
|
||
Comment on attachment 188328 [details] [diff] [review]
Proposed fix
Requesting 1.8b4 approval to allow XBL attached to nodes created via innerHTML
to run its constructor.
Attachment #188328 -
Flags: approval1.8b4?
Updated•19 years ago
|
Attachment #188328 -
Flags: approval1.8b4? → approval1.8b4+
Assignee | ||
Comment 12•19 years ago
|
||
Fixed.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.8beta3 → mozilla1.8beta4
You need to log in
before you can comment on or make changes to this bug.
Description
•