Case ce-0144-font-size-unit-conversion · Scenario scenario-font-size-change

Font size units are converted inconsistently (px to em)

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
font size unit conversion chrome

Phenomenon

When applying font sizes in Chrome, the units (px, em, rem) may be converted inconsistently. Relative units may be converted to absolute units, or vice versa, making it difficult to maintain consistent sizing.

Reproduction example

  1. Apply font size with em unit: font-size: 1.2em
  2. Edit the text or apply other formatting
  3. Observe the font-size value

Observed behavior

  • Units may be converted: 1.2em becomes 19.2px
  • Or units may be preserved
  • Conversion is inconsistent
  • Relative sizing is lost

Expected behavior

  • Units should be preserved as specified
  • Or conversion should be predictable
  • Relative units should remain relative
  • Behavior should be consistent

Browser Comparison

  • Chrome/Edge: May convert units (this case)
  • Firefox: Similar conversion behavior
  • Safari: Unit handling varies

Notes and possible direction for workarounds

  • Preserve original units explicitly
  • Convert units only when necessary
  • Document unit conversion behavior
  • Consider using data attributes to store original units
Before
Text
Font size applied with relative unit (em)
After Conversion (Bug)
Text
After editing, relative unit converted to absolute unit (px)
vs
✅ Expected
Text
Expected: Original unit (em) preserved

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-0119-font-size-persistence-safari macOS 14.0 Desktop or Laptop Any Safari 17.0 US draft
ce-0144-font-size-unit-conversion Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0166-font-size-persistence-edge Windows 11 Desktop or Laptop Any Edge 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.