Skip to content

FOLLOW-UP: DOMParser table element wrapping test for td/tr slots (from PR #72) #74

@adnaan

Description

@adnaan

Context

This follow-up task was identified during the review of PR #72.

Source PR: #72
PR Title: feat: lvt-preserve attributes, navigate SPA nav, DOMParser script fix
Suggested by: @claude[bot]

Task Description

The DOMParser fallback in updateDOM wraps incoming HTML in a tag matching the target element's tagName (e.g. <div>...</div>). For table-cell elements (<td>, <tr>, <tbody>), the HTML spec requires these elements to be inside a full table structure — wrapping <td> content in a bare <td> without a surrounding <table><tbody> causes browser re-parenting.

Add a regression test confirming either:

  • The current wrapping approach works correctly for table-cell slots (if browsers accept it), or
  • A guard is needed (e.g. detect table-family elements and use a full <table><tbody><tr> wrapper)

Original Comment

Potential issue: DOMParser table element wrapping
Wrapping td/tr content in a bare tr/td without surrounding table+tbody still causes browser re-parenting. The HTML spec requires those elements inside a full table structure. The intent is right but incomplete for table-cell slots. Worth a follow-up test.


This issue was automatically created by prmonitor from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions