Opened 2 months ago
Closed 2 months ago
#66085 closed defect (bug) (fixed)
Privacy: results row in export/erase tables opens a <th> but closes a </td>
| Reported by: | hbhalodia | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Privacy | Version: | 4.9.6 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | javascript |
Description (last modified by )
While working on the ticket #65994 and resolving PR comment here - PR, Found that
appendResultsAfterRow() in src/js/_enqueues/admin/privacy-tools.js builds the results row that appears under a request on the Export and Erase Personal Data screens. The cell opens as a <th> but closes as a </td>, See below snippet:
// src/js/_enqueues/admin/privacy-tools.js:73-79 return '<tr class="' + resultRowClasses + '"><th colspan="5">' + '<div class="notice inline notice-alt ' + classes + '" role="alert">' + '<p>' + summaryMessage + '</p>' + itemList + '</div>' + '</td>' + '</tr>';
The <th> is intentional — [43216] changed the cell from <td colspan="5"> to <th colspan="5"> but did not update the closing tag, which has read </td> ever since.
Impact
No visual defect. Per the HTML parsing spec a </td> end tag with no td in table scope is a parse error and is ignored, so the th is closed by the following </tr> and the element is a th as intended.
The cost is maintenance rather than rendering. The markup is invalid, and it actively misleads: during review of PR the mismatched tag led to a suggestion to select the cell with > td, which would have matched nothing.
Steps to reproduce
- Go to Tools → Export Personal Data and add a request.
- Click "Download personal data" on that row.
- Inspect the results row that appears below. The cell is a
<th>, despite the source closing it with</td>.
Patch
- '</td>' + + '</th>' +
Related
Change History (4)
This ticket was mentioned in PR #13470 on WordPress/wordpress-develop by @hbhalodia.
2 months ago
#1
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/66085
## Description
</th>instead of</td>.## Use of AI Tools