In browser.xhtml <scripts> inside <template> seem to execute
Categories
(Core :: XUL, defect)
Tracking
()
People
(Reporter: tschuster, Unassigned)
Details
I can't really explain this behavior, but using <template><script></script></template> inside the browser.xhtml file, somehow triggers the script to execute inside the template. This behavior definitely doesn't reproduce for normal HTML: data:text/html,<template><h1>hey</h1><script>console.log(window.location.href);</script></template>.
This patch shows some possible variants of this, that all seem to execute.
Comment 1•2 years ago
|
||
What happens for XHTML served as XHTML (data: or http) ?
| Reporter | ||
Comment 2•2 years ago
|
||
It does not execute the script: data:application/xhtml+xml,<?xml version="1.0" ?><html xmlns="http://www.w3.org/1999/xhtml"><body><template><script>console.log(window.location.href);</script></template></body></html>
(For comparison: data:application/xhtml+xml,<?xml version="1.0" ?><html xmlns="http://www.w3.org/1999/xhtml"><body><script>console.log(window.location.href);</script></body></html>)
Comment 4•2 years ago
|
||
All three scripts run from https://searchfox.org/mozilla-central/rev/c414b4538dd3c7e1dc674f7b66176e7c309afa95/dom/prototype/PrototypeDocumentContentSink.cpp#568
The PrototypeDocumentContentSink needs to check for a template ancestor.
Updated•2 years ago
|
Description
•