Long CSS values clipped in DevTools Styles pane

#431091918 Filed 2025-07-11 New P4 / S4

Summary

Bug

When editing a CSS property value in the DevTools Styles pane and entering a very long value (e.g. a large number without spaces), the text extends beyond the visible area and is clipped. There is no horizontal scrollbar or wrapping to see the full value.

Reproduction Steps

  1. Open this page in Chrome and right-click the colored box below, then select Inspect.
  2. In DevTools, find the .demo-box element in the Styles pane.
  3. Click on the width value (200px) to edit it.
  4. Replace it with a very long value, e.g.: 99999999999999999999999999999999999999999999999999px
  5. Before fix: The typed value extends beyond the visible area with no way to see it.
  6. After fix: The long value wraps to the next line, remaining fully visible.

Right-click this box and Inspect to reproduce

Root Cause

Non-editing display

The .tree-outline li elements in the Styles pane had white-space: normal (allows wrapping at spaces) but no overflow-wrap: break-word. Long values without spaces did not wrap and were clipped by the parent section's overflow: hidden.

Editing

The TextPrompt creates a proxy <span> with display: inline-block that grows unconstrained with content width. Even though li.child-editing has overflow-wrap: break-word, the inline-block proxy prevents wrapping because it expands to fit content.

Fix

Changes in stylePropertiesTreeOutline.css

1. Added overflow-wrap: break-word to .tree-outline li -- ensures long values wrap in the non-editing display.

2. Added max-width: 100% to the TextPrompt proxy span inside li.child-editing via :has() selector -- constrains the editing area so typed values wrap instead of overflowing.

/* Non-editing: long values now wrap */
.tree-outline li {
  overflow-wrap: break-word;  /* NEW */
}

/* Editing: constrain proxy span width */
.tree-outline li.child-editing {
  > span:has(> .text-prompt-root) {
    max-width: 100%;          /* NEW */
  }
}

Links

Chromium Issue #431091918

Original reproduction page (CodePen)