Skip to content

fix(rcdom): inspect descendant node data in get_a_selects_enabled_selectedcontent (closes #776) - #783

Open
rushikeshgarad2024-dev wants to merge 1 commit into
servo:mainfrom
rushikeshgarad2024-dev:fix/rcdom-selectedcontent-lookup-776
Open

rushikeshgarad2024-dev wants to merge 1 commit into
servo:mainfrom
rushikeshgarad2024-dev:fix/rcdom-selectedcontent-lookup-776

Conversation

@rushikeshgarad2024-dev

Copy link
Copy Markdown

Summary of Fix

Resolves #776: Node::get_a_selects_enabled_selectedcontent in rcdom/lib.rs walked descendant nodes but erroneously matched &self.data instead of &node.data.

Details

  • self refers to the parent <select> element, so name.local_name() == &local_name!("selectedcontent") evaluated to false on every iteration, always returning None.
  • Consequently, the clone_an_option_into_selectedcontent routine never ran when parsing customizable selects.
  • Changing the pattern match from &self.data to &node.data allows <selectedcontent> descendants to be discovered and properly populated with cloned <option> children per WHATWG HTML spec.

Closes #776.

…ectedcontent (closes servo#776)

- In `Node::get_a_selects_enabled_selectedcontent`, match `&node.data` instead of `&self.data` when iterating through descendant nodes.
- Previously, matching `&self.data` tested the parent `<select>` element rather than the descendant node, causing `selectedcontent` lookup to always return `None` and preventing `<option>` cloning.
@github-actions github-actions Bot added the V-non-breaking A non-breaking change label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

V-non-breaking A non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rcdom: selectedcontent lookup reads self.data, option clone never runs

1 participant