케이스 ce-0140-empty-span-style-attributes-ko · 시나리오 scenario-empty-element-cleanup

style 속성이 있는 빈 span 요소가 누적됨

OS: Windows 11 기기: Desktop or Laptop Any 브라우저: Chrome 120.0 키보드: US 초안
emptyspanstylecleanupchrome

현상

Chrome에서 서식(굵게, 기울임꼴, 색상 등)을 제거할 때 빈 또는 불필요한 style 속성이 있는 빈 span 요소가 DOM에 누적됩니다. 이러한 요소는 HTML을 비대하게 만들고 목적이 없습니다.

재현 예시

  1. 텍스트에 여러 서식을 적용합니다
  2. 서식을 하나씩 제거합니다
  3. DOM 구조를 관찰합니다

관찰된 동작

  • <span style=""> 요소가 남습니다
  • 또는 공백만 있는 <span> 요소가 남습니다
  • style 속성이 비어 있지만 여전히 존재할 수 있습니다
  • DOM이 빈 span으로 비대해집니다

예상 동작

  • 빈 span 요소가 제거되어야 합니다
  • style 속성이 비어 있을 때 제거되어야 합니다
  • DOM이 깨끗하고 최소한이어야 합니다
  • 불필요한 요소가 남지 않아야 합니다

브라우저 비교

  • Chrome/Edge: 빈 span을 남김 (이 케이스)
  • Firefox: 빈 요소를 남길 가능성이 더 높음
  • Safari: 빈 요소를 누적할 가능성이 가장 높음

참고 및 해결 방법 가능한 방향

  • 서식 제거 후 빈 span 요소 정리
  • 비어 있으면 style 속성 제거
  • 공백만 포함하는 span 언래핑
  • DOM 구조를 정기적으로 정규화

이 시나리오의 변형

케이스 OS 브라우저 상태
ce-0111-empty-elements-accumulate-ko Windows 11 Chrome 120.0 초안
ce-0127-empty-paragraph-after-delete-ko Windows 11 Chrome 120.0 초안
ce-0140-empty-span-style-attributes-ko Windows 11 Chrome 120.0 초안
ce-0159-empty-elements-after-format-remove-ko Windows 11 Safari 17.0 초안
ce-0174-empty-div-after-list-removal-ko Windows 11 Chrome 120.0 초안

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.