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

Wrong highlighted text on search #13292

Closed
calixteman opened this issue Apr 24, 2021 · 7 comments · Fixed by #13306
Closed

Wrong highlighted text on search #13292

calixteman opened this issue Apr 24, 2021 · 7 comments · Fixed by #13306

Comments

@calixteman
Copy link
Contributor

Attach (recommended) or Link to PDF file here:
LesAccentsFrancais(1).pdf

Steps to reproduce the problem:

  1. Search for "a" and click on "Highlight All"

What is the expected behavior? (add screenshot)
The two "A" in "FRANÇAIS" must be highlighted

What went wrong? (add screenshot)
They aren't but "R" and "N" are.
image

Reproductible in Firefox nightly or in a local dev environment.

@Snuffleupagus
Copy link
Collaborator

Search for "a" and click on "Highlight All"

Interestingly it seems that this is specific to the "Highlight All" mode, since if you do a "normal" search and simply advance through the matches the highlights are correct.

@calixteman
Copy link
Contributor Author

calixteman commented Apr 24, 2021

The HTML is:

<span role="presentation" dir="ltr" style="left: 185.956px; top: 102.908px; font-size: 32.9133px; font-family: sans-serif; transform: scaleX(1.01694);">
  LES 
  <span class="highlight selected">A</span>
  CCENTS FR
  <span class="highlight">A</span><span class="highlight">A</span>
  IS 
</span>

And using devtools we can see the container for "CCENTS FR" has the same starting position has the span for the first "A".

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 24, 2021

This issue can be reproduced in any document, and a quick git bisect run points to this being a regression from PR #13171.

@calixteman
Copy link
Contributor Author

@calixteman
Copy link
Contributor Author

Yep adding back the > fixes the issue.

@calixteman
Copy link
Contributor Author

So a fix could be to add a position: relative in .highlight, @Snuffleupagus wdyt ?

@Snuffleupagus
Copy link
Collaborator

So a fix could be to add a position: relative in .highlight, @Snuffleupagus wdyt ?

Assuming that it doesn't cause any other issues, that seems like a small/simple way to fix the issue!
(We might want to consider uplifting the patch, once landed, since "Highlight All" is now broken in Firefox 89.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants