You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Selections in unfocused iframes should render as inactive. #48254
In other browsers, when creating a selection within an iframe, that selection turns gray once you click outside of the iframe, probably to indicate that it's not going to respond to keyboard inputs of any kind.
Collapsed selections that usually show up as a blinking caret also do not show their caret when they would be gray.
Opening this because I just PR'd #48253 and while a regular selection looking normal in an unfocused iframe isn't too bad, having a blinking caret that won't type anything is quite confusing.
I'm a bit surprised that there can be two selections in the same document tree. Are you sure this is the case? It is the case that unfocusing the top-level window should render the selection as gray.
I'm a bit surprised that there can be two selections in the same document tree. Are you sure this is the case? It is the case that unfocusing the top-level window should render the selection as gray.
You can try for yourself:
<!DOCTYPE html>
Some text outside of the iframe
<iframesrcdoc="Some text inside of the iframe">
All major browsers agree that there's two separate documents with their own selections at play here. A selection started outside of the iframe cannot extend into it and one that started inside of it cannot extend out of it. Similarly, Ctrl+A to select all is scoped to whichever of the two documents has focus and doesn't touch the other one.
In my opinion, this is weird and unintuitive and probably bad, but since all browsers seem to agree on this, I'm not sure how good of an idea it is to challenge the status quo here.
Activity
mrobinson commentedon Sep 23, 2026
I'm a bit surprised that there can be two selections in the same document tree. Are you sure this is the case? It is the case that unfocusing the top-level window should render the selection as gray.
Psychpsyo commentedon Sep 23, 2026
You can try for yourself:
All major browsers agree that there's two separate documents with their own selections at play here. A selection started outside of the iframe cannot extend into it and one that started inside of it cannot extend out of it. Similarly, Ctrl+A to select all is scoped to whichever of the two documents has focus and doesn't touch the other one.
In my opinion, this is weird and unintuitive and probably bad, but since all browsers seem to agree on this, I'm not sure how good of an idea it is to challenge the status quo here.
servo: Add support for system focus handling (servo#48364)
servo: Add support for system focus handling (servo#48364)
servo: Add support for system focus handling (servo#48364)