Closed Bug 88309 Opened 20 years ago Closed 11 years ago

xhtml:script element as :root element does not execute script

Categories

(Core :: XML, defect, P3)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: hjtoi-bugzilla, Assigned: hjtoi-bugzilla)

References

(Blocks 2 open bugs)

Details

(Keywords: regression, xhtml, Whiteboard: [fixinhand])

Attachments

(3 files)

The reason is we have checks in several places that assume/check that a script
element must have a parent element. I think I have a fix.
Vidur, you broke this with the dynamic script thing, so I think you should
review this. I don't know why the parent requirement was there; if you have a
reason let me know. The way we cause script execution feels a bit fragile and
unintuitive...
Status: NEW → ASSIGNED
Keywords: regression, xhtml
Priority: -- → P3
Whiteboard: [fixinhand]
Target Milestone: --- → mozilla0.9.3
Vidur noted that with the first patch we can end up executing scripts twice. The
fix 2 should take care of that.

But I noticed additional problems. The contents of the script element are
visible, if it is the root element. Same is true for title element, and maybe
every "hidden" XHTML element if they are used as root elements. That seems kinda
weird...
Oh well, I don't like how the fix looks like, and seeing that other XHTML
elements have problems working as root moving this to a later milestone.

I will try to get the cleanup work in another bug (unused variables etc.)
Target Milestone: mozilla0.9.3 → mozilla1.0
This would be a very nice bug to fix for XML in general.  I treasure JavaScript
a great deal, but there's no XML tag specifically for scripting (and shouldn't be).

Would somebody be kind enough to put together a testcase, or give me a link to
one thereto?
Incidentally, I came up with a workaround for this bug -- using a processing in
an XML document (which is itself encapsulated in an HTML iframe).  It's very
ugly, but it works...
Uh, Alex, what are you talking about? This bug is about the script element from
the XHTML namespace not working as the root element of an XML document. It works
everywhere else.

So, this document does not work:

<script type="text/javascript" xmlns="http://www.w3.org/1999/xhtml">
  alert("Hello!");
</script>
But this, and any other document that has a non-script root element as well,
will work:

<doc>
  <script type="text/javascript" xmlns="http://www.w3.org/1999/xhtml">
    alert("Hello!");
  </script></doc>
Oh, sorry about that!  *sheepish grin*
Target Milestone: mozilla1.0 → mozilla0.9.9
Target Milestone: mozilla0.9.9 → Future
QA Contact: petersen → ian
Attached file test case
Right click is also disabled when the script element == root element. Will the
patch fix this or do I need to file a different bug?
Summary: xhtml:script element as root element does not execute script → xhtml:script element as :root element does not execute script
Blocks: 270658
Blocks: 275150
File a different bug on that, but note the bugnumber here just in case...
Blocks: 283683
Depends on: 286000
QA Contact: ian → xml
Fixed five years ago by bug 286000.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.