rumb
← logbook

The page answers back

Rendering was the visible half of the problem. Input is the half that makes it a browser, and until this landed rumb had a page you could look at and scroll, and nothing else.

Keyboard now goes to the page by default. That sounds obvious, and it is the whole decision: the URL bar used to swallow every keystroke because it was the only thing that had ever asked for one. Now it only edits while it is focused — Cmd/Ctrl+L, or a click on it — with Enter loading and Escape handing focus back. Everywhere else, keys are translated into Servo keyboard events and delivered to the WebView. Typing into a text field on a page works. So does a search box, which is the first time rumb could be used to look something up rather than to display something we had already decided to load.

Cursors came with it. Servo's WebViewDelegate has a notify_cursor_changed hook that fires with the shape it wants for whatever is under the pointer; we map that onto GPUI's CursorStyle and set the system pointer. Links look like links, text looks selectable. It is very little code for how much it changes the feel — before it, every part of the page was equally inert.

Fullscreen too, on F11 and a toolbar button.

None of this is hard in the sense of being clever. It is hard in the sense of being fiddly: focus has to have exactly one owner, pointer coordinates have to be in physical pixels relative to the right element's bounds, and each of those is silently wrong until you sit with it.