-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Reset "focusedByTab" field when doing another search #85506
Conversation
Some changes occurred in HTML/CSS/JS. |
I updated the search.js on my test page: https://data.estada.ch/rustdoc-nightly_4e3e6db01_2021-05-18/multiplayer_snake/index.html?search=send
|
Interesting because it creates a |
@dns2utf8 Try again? :) |
src/librustdoc/html/static/search.js
Outdated
var description = document.createElement("div"); | ||
var spanDesc = document.createElement("span"); | ||
spanDesc.className = "desc"; | ||
spanDesc.innerText = item.desc + " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spanDesc.innerText = item.desc + " "; | |
spanDesc.innerText = item.desc + '\u00A0'; |
spanDesc.innerText = item.desc + " "; | |
spanDesc.innerText = item.desc; | |
spanDesc.innerHTML += " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I added the NO-BREAK SPACE comment to the lines |
It looks like this contains two changes: b8909fc that fixes the bug described in the PR, and 12efcf4569ed756d5859b3660538ff662067c6a8, "generate DOM more securely." Can you say more about what makes this approach more secure? And how it related to |
12efcf4
to
b8909fc
Compare
This looks good to me and fixes the focus bug 👍 |
@bors r+ |
📌 Commit b8909fc has been approved by |
@bors: rollup |
…r=jsha Reset "focusedByTab" field when doing another search Fixes rust-lang#85467. The problem was simply that we forget to reset the `focusedByTab` field, which was still referring to removed DOM elements. r? `@jsha`
…laumeGomez Rollup of 4 pull requests Successful merges: - rust-lang#85506 (Reset "focusedByTab" field when doing another search) - rust-lang#85548 (Remove dead toggle JS code) - rust-lang#85550 (facepalm: operator precedence fail on my part.) - rust-lang#85555 (Check for more things in THIR unsafeck) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…ration, r=jsha Better result dom generation First commit is from rust-lang#85506. We realized in rust-lang#85506 (comment) thanks to `@dns2utf8` that in some cases, the generated search result DOM was invalid. This was not strict enough and the DOM was inserted as a big string, which wasn't great. r? `@jsha`
Fixes #85467.
The problem was simply that we forget to reset the
focusedByTab
field, which was still referring to removed DOM elements.r? @jsha