Files
sousa-gecko/testing/web-platform/tests/html/rendering/widgets
Kent Tamura 9c9c4b56b8 Bug 2047047 [wpt PR 60569] - textarea: Always add a placeholder break to empty elements, a=testonly
Automatic update from web-platform-tests
textarea: Always add a placeholder break to empty elements

This CL ensures that empty TEXTAREA elements always contain a
placeholder break element. This provides a consistent line-height and
baseline, particularly for non-editable textareas (e.g., disabled,
read-only, or within an inert subtree) which previously might have
collapsed or had incorrect layout metrics.

Although the placeholder break is primarily needed for non-editable
states, it is added unconditionally because an element's editability
can change dynamically (e.g., via the 'inert' attribute on an ancestor),
making conditional management complex.

Implementation details:

- HTMLTextAreaElement: Injects the placeholder break into the inner
  editor upon creation if the value is empty.

- TextControlElement: Manages the lifecycle of the placeholder break
  when the value changes.

- RemoveNodeCommand: Updated to correctly handle 'ref_child' when it
  points to a placeholder break, ensuring correct undo/redo behavior.

- SelectionController: Updated 'IsEditableBoxEmpty' to check the
  actual text content instead of just 'HasChildren()', accounting for
  the internal placeholder break.

  trees. It affects <textarea> with a value ending with `\n`.

AX-Relnotes: Placeholder break elements are dropped from accessibility
Bug: 510170707
Change-Id: I5871a6890ceb50945b8995293fcbaafa7c6e25c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7875830
Reviewed-by: David Tseng <dtseng@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1645788}

--

wpt-commits: 640522942a690dae86b3deba5abaae021704e9a3
wpt-pr: 60569
2026-06-16 11:36:16 +00:00
..