Case ce-0160-nested-formatting-order-inconsistent · Scenario scenario-nested-formatting

Nested formatting element order is inconsistent in Safari

OS: Windows 11 Device: Desktop or Laptop Any Browser: Safari 17.0 Keyboard: US Status: draft
formatting nested order safari

Phenomenon

When applying multiple formatting operations in Safari, the nesting order of elements varies inconsistently. The same formatting may result in <b><i>text</i></b> or <i><b>text</b></i> depending on application order.

Reproduction example

  1. Select some text
  2. Apply bold, then italic
  3. Observe nesting: <b><i>text</i></b>
  4. Remove formatting and reapply in reverse order (italic, then bold)
  5. Observe nesting: <i><b>text</b></i>

Observed behavior

  • Nesting order depends on application order
  • Same visual result has different DOM structure
  • Inconsistent structure makes management difficult
  • Querying formatting state is complex

Expected behavior

  • Nesting order should be consistent
  • Or order should be predictable
  • Same formatting should have same structure
  • Structure should be normalized

Browser Comparison

  • Chrome/Edge: Nesting order more consistent
  • Firefox: Similar nesting behavior
  • Safari: Nesting order most inconsistent (this case)

Notes and possible direction for workarounds

  • Normalize formatting structure after operations
  • Use consistent nesting order (e.g., always b > i > u)
  • Merge or reorder nested elements
  • Document expected nesting order
Before
Hello World
Basic text
After Bold then Italic
Hello World
Bold first, italic later
vs
✅ Expected
Hello World
Expected: Consistent nesting order (always b > i)

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-0112-nested-formatting-complex Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0128-nested-formatting-removal Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0160-nested-formatting-order-inconsistent Windows 11 Desktop or Laptop Any Safari 17.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: Safari 17.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.