mirror of
https://github.com/servo/servo
synced 2026-05-13 18:37:30 +02:00
Widgets like `<input>` and `<textarea>` have various behaviors similar to replaced elements, but aren't fully replaced. Therefore, this adds a new case into the `Contents` enum so that it can represent the three states: non-replaced, fully replaced, and widget. This means that `NonReplacedContents::OfTextControl` can be dropped. The code is refactored in order to centralize the logic to identify widgets in a single place. This fixes some places where we weren't checking if the element was a widget, e.g. in `construct_for_root_element()`. But I think the change isn't currently observable in practice. Testing: Unneeded, no behavior change. This is part of #39927 Signed-off-by: Oriol Brufau <obrufau@igalia.com>