Open
Description
Describe the bug
When you put a standalone <tr></tr>
element in a <template>
and try to get it out with .firstChild
, you get null
instead. This also happens with <tbody>
or <td>
, but NOT with <li>
.
To Reproduce
import { GlobalRegistrator } from '@happy-dom/global-registrator';
GlobalRegistrator.register();
const html = '<tr></tr>'
const elem = document.createElement('template');
elem.innerHTML = html;
const fragment = elem.content;
console.log(fragment.firstChild)
This prints null
.
If you use something like const html = '<div></div>'
instead, it returns the <div>
node.
Expected behavior
When you run this code in the browser, it returns the node <tr></tr>
:

Device:
System:
OS: macOS 15.0.1
CPU: (10) arm64 Apple M1 Max
Memory: 9.37 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.13.0 - ~/.local/share/mise/installs/node/22/bin/node
npm: 10.9.2 - ~/.local/share/mise/installs/node/22/bin/npm
pnpm: 9.12.3 - ~/.local/share/mise/installs/node/22/bin/pnpm
npmPackages:
@happy-dom/global-registrator: ^16.5.3 => 16.5.3
happy-dom: ^16.5.3 => 16.5.3
Additional context
Add any other context about the problem here.