fix(step-recorder): a field is named by its label, never by what it holds - #400
Merged
Merged
Conversation
…olds A form field with a role the recorder treats as buttonish (combobox, spinbutton, slider, button, switch) was named by its own content before its label was read. With "Never record entered values" on, an address autocomplete labelled "Address" recorded "Type text into the Kyiv, Khreshchatyk 22 field"; with it off, a card number typed into one was masked as the value and then written out as the field's name. The same path named a spinner and a slider by their numbers, a file picker styled as a button by its path, a dropdown by one of its options, and a switch by Chrome's default value, "on". holdsValue() in rec-naming.js marks every form field but a button input, and elementName() skips the buttonish branch for it, so the label, placeholder and the rest of the ladder name the field. A submit or button input keeps its value as its name: for those the value is the caption. Probed against scratchpad copies: dropping the condition, counting button inputs as fields, leaving out TEXTAREA or SELECT, and taking button inputs out of isButtonish each turn an I row red. The same 12 cases in real Chromium: on main 11 are named by a value, an option or "on"; here every one by its label. Closes #393 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #393