Phenomenon
When editing text within a table cell in Safari, the table structure may break. Cells may be removed, rows may be deleted, or the table may become malformed.
Reproduction example
- Create a table:
<table><tr><td>Cell 1</td><td>Cell 2</td></tr></table> - Edit text in a cell
- Apply formatting or delete text
- Observe table structure
Observed behavior
- Table cells may be removed
- Rows may be deleted
- Table structure becomes malformed
- DOM structure breaks
Expected behavior
- Table structure should be maintained
- Cells should remain intact
- Rows should not be deleted
- Structure should be preserved during editing
Browser Comparison
- Chrome/Edge: Generally maintains table structure
- Firefox: May break structure occasionally
- Safari: Most likely to break structure (this case)
Notes and possible direction for workarounds
- Intercept editing operations in table cells
- Prevent operations that break structure
- Validate table structure after operations
- Restore structure if broken