THE LINUX FOUNDATION PROJECTS
Blog

Bug Bounty Wins: The Backspace Bug That Haunted Rich Text Editors for a Decade

By November 19, 2026No Comments

TL;DR

For more than ten years, pressing Backspace in a contenteditable element could resurrect previously deleted styles and leave stray <span>, <b>, <u>, and <font> tags in your HTML. A fix by Peng Zhou has now landed that makes Chrome’s editing behavior more faithful to the DOM (Document Object Model).

The ghost in the editor

You select a bold word and delete it. You keep typing, and the new text comes out bold anyway. You check the DOM and find a <b> tag that you never asked for.

If you’ve built a WYSIWYG editor, you’ve met this ghost. A CKEditor core developer reported the problem, and it turned out to be a conceptual one. Blink and WebKit weren’t editing the DOM you wrote. They were editing an internal, invisible model of what the content looked like: an “unstructured styled text” representation that tracked visual style separately from the markup.

Four test cases, four kinds of haunting

The reporter illustrated the problem with four test cases:

  • TC1: The merge that wasn’t. Backspace between an <h1> and a <p> should merge two blocks. Instead, the browser merged their visual styles, such as font size, and produced a spurious <span> carrying the deleted paragraph’s look.
  • TC2: The style that came back. Delete a <strong> element, start typing again, and the browser reintroduced the styling through freshly generated <b> or even <font> tags.
  • TC3: The zombie underline. Delete a link and its underline could persist as a raw <u> tag, long after the link itself was gone.
  • TC4: The paragraph with a memory. Even deleting an entire paragraph could cause its style to be remembered and reapplied later.

The reporter’s argument was that styles should live in the DOM, “on paper,” rather than as hidden parallel state, and that editing operations should be driven from the DOM’s point of view. The results were messy, non-semantic HTML and a hard road for anyone building standards-compliant editors.

A decade of workarounds

This wasn’t a niche annoyance. It affected CKEditor, TinyMCE and WordPress, Raptor Editor, and anyone else building on contenteditable. Editor libraries bolted on manual DOM-cleanup code to compensate, and the thread filled up with recurring, understandably frustrated requests for status updates.

The fix, in stages

The resolution came in stages over many years.

2016: the first pieces.

  • One patch stopped unnecessarily preserving the CSS line-height property during paragraph-merge operations, since a computed line-height can legitimately differ from the source value.
  • Another removed spurious “style spans,” so that merged or pasted text would follow the styling of its containing block (list items, <pre>, table cells, headings) instead of carrying stray inline styles. It was reverted once after breaking a Windows 8 build, then relanded successfully soon after.

The long middle. The bug stayed partially open for years. Maintainers periodically confirmed that TC1 and TC2 were fixed while TC3 and TC4 still reproduced, including as late as 2024.

2026: the finishing patch. A change titled “Preserve HTML equivalent tags in delete typing style” finally addressed TC1 through TC3. When text is deleted, the editor now keeps track of the actual HTML-equivalent tags involved, rather than regenerating wrapper tags like <b> or <font> from an internal style model.

The one that wasn’t a bug

TC4 is the interesting twist. The engineer deliberately left it unfixed because no web standard governs it. Browsers genuinely disagree on whether a “typing style” should persist after you delete the last styled character. Firefox discards it, while Chrome and Safari preserve it. That matches a historical, non-normative discussion in the W3C Editing Task Force.

So TC4 was judged a legitimate implementation choice rather than a defect, and the issue was closed as fixed with TC1 to TC3 resolved. Sometimes a good fix includes an honest note about where the spec runs out.

Why this matters for your code

The Bug Bounty Program focuses on real, user-facing bugs, and this one has been a long-running thorn for a lot of developers.

  • Cleaner HTML. For the TC1 to TC3 scenarios, Backspace, Delete, and paste-merge operations in Chrome should produce more DOM-faithful output, without stray <span>, <b>, <u>, or <font> tags reappearing from an invisible style cache.
  • Fewer workarounds. This reduces, though doesn’t eliminate, the manual cleanup code that libraries like CKEditor and TinyMCE have carried for over a decade.
  • Clarity on what’s left. The TC4 decision documents a specific cross-browser inconsistency. You now know it’s intentional, and you can decide whether to handle it in your own editor logic.
  • A look at the road ahead. The wider discussion, including contentEditable="minimal" proposals and user-intent events, points toward giving editor authors lower-level primitives instead of making them fight opaque built-in heuristics.

Your turn: fix a bug, get paid

The Supporters of Chromium-Based Browsers rewards the developers who make Chromium better for the people and browsers that depend on it every day. Bugs like this one, with deep roots and real impact, are what our Bug Bounty Program exists for.

The process is simple: pick a bug from one of our approved lists, submit a fix, and get paid:

  • Small bugs: $1,000 for targeted fixes with clear user benefit, on the BugBounty-Small hotlist.
  • Medium bugs: $5,000 for moderate-impact issues, on the BugBounty-Medium hotlist.
  • Large bugs: $20,000 for high-impact bugs with broad user or developer visibility, on the BugBounty-Large hotlist.

Ready to fix your first bug? Find out how to get involved →