Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace handling issues with pasted page searches #26650

Open
wknapik opened this issue Nov 9, 2022 · 1 comment
Open

Whitespace handling issues with pasted page searches #26650

wknapik opened this issue Nov 9, 2022 · 1 comment
Labels
Chromium/waiting upstream Issue is in Chromium; we'll likely wait for the fix OS/Desktop priority/P5 Not scheduled. Don't anticipate work on this any time soon. repros-on-chrome

Comments

@wknapik
Copy link
Contributor

wknapik commented Nov 9, 2022

Description

When using page search (^f), a pasted search string gets transformed right in the search field, with no indication to the user, and occurrences of the modified string are matched.

Whitespace is stripped on both sides, but a search for any combination of whitespace characters alone becomes a search for a single space.

This makes certain searches impossible/results incorrect - such as when searching for a tab (or many), or searching for text indented by some number of tabs, or with trailing tabs. The same applies to spaces when pasted, but not when typed in (which is a bit more problematic for tabs).

There is a workaround - if a search string is pasted with whitespace in the middle, it is preserved and if the characters around the whitespace are removed, a search for whitespace in any location in the search string becomes possible and the matches are correct.

However, occurrences of tabs are not highlighted, unless the text containing them is selected.

And lastly, this is just a consequence of the above - if the workaround is used (or the search string is typed in manually) to successfully search for text with whitespace on either side and the search string is selected and copied from the search field and pasted back, it becomes a different search string - with whitespace stripped on both ends, so the actual matches change.

Steps to Reproduce

  1. Open a page, or file containing spaces and tabs in the browser
  2. Hit ^f
  3. Paste search strings containing whitespace on either side

Actual result:

See: above

Expected result:

There's a few issues here. Tabs should be highlighted when found. As for the rest - a checkbox on the search field to preserve surrounding whitespace could be a solution.

Reproduces how often:

Easily reproduced

Brave version (brave://version info)

Brave 1.45.118 Chromium: 107.0.5304.91 (Official Build) (64-bit)
Revision 3d5948960d62418160796d5831a4d2d7d6c90fa8-refs/branch-heads/5304@{#1097}
OS Linux

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel? Yes
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? n/a
  • Does the issue resolve itself when disabling Brave Rewards? n/a
  • Is the issue reproducible on the latest version of Chrome? Yes

Miscellaneous Information:

Arch Linux

@wknapik
Copy link
Contributor Author

wknapik commented Nov 11, 2022

Another issue with match highlighting in page search #26281.

@rebron rebron added repros-on-chrome Chromium/waiting upstream Issue is in Chromium; we'll likely wait for the fix priority/P5 Not scheduled. Don't anticipate work on this any time soon. labels Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chromium/waiting upstream Issue is in Chromium; we'll likely wait for the fix OS/Desktop priority/P5 Not scheduled. Don't anticipate work on this any time soon. repros-on-chrome
Projects
Status: P5 Backlog / waiting upstream
Development

No branches or pull requests

2 participants