This is just a quick draft of a proposal for changing how frames are handled in NetSurf. Updates, changes, comments, etc are welcome.
See the frames documentation.
In the following, "canvas" refers to the front end's "surface" onto which it plots whatever the core tells it to. There would only be one per window (or tab).
The front end only creates one gui_window per window (or tab). It never needs to know about browser_window objects, which will be internal to the core. The front end tells the core the size of the viewport. The front end never knows whether the viewport contains a simple page or a frameset, it just passes mouse actions in and plots into the canvas as the core instructs it.
For iframes, the core just renders the HTML content in the area of the page that the iframe occupies during HTML redraw. If scrollbars are present they are handled by the core scrollbar widget, and html_redraw calls for them to be redrawn. Clicks and mouse movement over iframes are passed on through to the content in question. IIRC we "drill down" into iframes already, so apart form getting the scroll offsets this may already be implemented.
For framesets, the canvas area we render into does not exceed the size of the viewable area in the window. So canvas size is equal to viewport size, and the front end's surface would be unscrollable. This means for large fixed-size frames in a small window, part of the frameset would get cropped. html_redraw would be updated to handle framesets. The canvas would be split up into rectangles with different contents in each rectangular area, according to the frameset. If the frame is scrollable and has scrollbars, scrollbars will be rendered for it. The core mouse tracking and clicking handling would be updated to handle framesets. It also needs to handle actions on the framesets themselves, e.g. frame resizing.
For regular pages (and possibly root framesets containing one frame and no nested framesets), the rendered canvas size is defined by layout in the normal way. So canvas size may exceed front end viewport size, making the front end's surface scrollable.
Mitigation - core scrollbar widget could optionally be overridden by front ends for native looking scrollbars
Thumbnailing should "just work".
Possibility of front ends overriding core scrollbar widgets, for native look.