Case ce-0135-font-family-empty-style · Scenario scenario-font-family-change

Removing font family leaves empty style attributes

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
font style empty chrome

Phenomenon

When removing font family formatting in Chrome, empty style attributes may be left in the DOM. These empty style attributes bloat the HTML and serve no purpose.

Reproduction example

  1. Apply font family to text: <span style="font-family: Arial">Text</span>
  2. Remove font family formatting
  3. Observe the DOM

Observed behavior

  • Empty style attributes may remain: <span style="">Text</span>
  • Or empty span elements may remain: <span></span>
  • DOM becomes bloated
  • Unnecessary attributes accumulate

Expected behavior

  • Style attributes should be removed when empty
  • Empty elements should be cleaned up
  • DOM should be minimal
  • No unnecessary attributes

Browser Comparison

  • Chrome/Edge: May leave empty styles (this case)
  • Firefox: More likely to leave empty attributes
  • Safari: Most likely to leave empty structures

Notes and possible direction for workarounds

  • Clean up empty style attributes
  • Remove style attribute if empty
  • Unwrap elements with empty styles
  • Normalize DOM structure regularly
Before
Text
Text with Arial font applied
After Removing Font (Bug)
Text
After font removal, empty style attribute remains
vs
✅ Expected
Text
Expected: Empty style attribute and element removed

Browser compatibility matrix

This matrix shows which browser and OS combinations have documented cases for this scenario. The current case is highlighted. Click on a cell to view other cases.

Current case
Confirmed
Draft
No case documented

All variants (detailed table)

Complete list of all cases for this scenario with full environment details.

Case OS Device Browser Keyboard Status
ce-0106-font-family-persistence-safari macOS 14.0 Desktop or Laptop Any Safari 17.0 US draft
ce-0135-font-family-empty-style Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0155-font-family-inheritance-issue Windows 11 Desktop or Laptop Any Firefox 120.0 US draft

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: Windows 11
Device: Desktop or Laptop Any
Browser: Chrome 120.0
Keyboard: US
Your environment
Sample HTML:
Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.

Comments & Discussion

Have questions, suggestions, or want to share your experience? Join the discussion below.