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

Use spec concept of Navigable #31520

Open
gterzian opened this issue Mar 6, 2024 · 5 comments
Open

Use spec concept of Navigable #31520

gterzian opened this issue Mar 6, 2024 · 5 comments
Labels
A-constellation Involves the constellation A-content/script Related to the script thread B-meta This issue tracks the status of multiple, related pieces of work

Comments

@gterzian
Copy link
Member

gterzian commented Mar 6, 2024

As I am looking into #31505, I came across what to me is a new concept in the spec: the navigable.

It is described in the spec as:

a user-facing representation of a sequence of documents, i.e., they represent something that can be navigated between documents. Typical examples are tabs or windows in a web browser, or iframes, or frames in a frameset.

This appears to match what we call a Webview, see

pub struct WebViewManager<WebView> {

If that is correct, I think it would be nice to use the same name as the spec.

Besides just renaming, I think we should try to stay as close to the spec as possible in terms of managing these, and their interactions with other concepts like session history, as well as the "update the rending" stuff in the HTML event-loop. As a quick example of how this matters, see https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model:window-event-loop-3, which states that:

An HTML event-loop(which in script is the ScriptThread, and in the constellation is an EventLoop) must wait for a rendering opportunity for an active document for one navigable.

That sentence actually crosses between script and constellation, in the sense that "active document" involves the session history, and "navigable" could be a top-level BC or an iframe in that event-loop. Also "rendering opportunity" requires some knowledge of the rendering cycle.

Needless to say, to properly "wait for a rendering opportunity for an active document for one navigable" will require some cooperation between script and the constellation beyond what we are currently doing(I think).

For example, running the resize steps for a document should be done as part of the "update the rendering" task in script, but currently we are simply handling incoming messages from the constellation for a given pipeline, which to me appears to be lacking the necessary context to determine whether this is an actual rendering opportunity for an active docume of (which?) navigable.

I'll try to come-up with more specific examples as I work through #31505, and make this issue more actionable.

@gterzian gterzian added A-content/script Related to the script thread A-constellation Involves the constellation B-meta This issue tracks the status of multiple, related pieces of work labels Mar 6, 2024
@gterzian
Copy link
Member Author

gterzian commented Mar 6, 2024

@delan @mrobinson @wusyong @jdm

@mrobinson
Copy link
Member

mrobinson commented Mar 6, 2024

I think the concept of a Navigable is wider than a WebView. An iframe and be a Navigable, but an iframe is not a WebView, which is a top level series of Documents. The WebView terminology comes from what Android, Blink, and WebKit use and it has a pretty common understanding (https://en.wikipedia.org/wiki/WebView).

@gterzian
Copy link
Member Author

gterzian commented Mar 6, 2024

The WebView terminology comes from

Thanks for the info.

a WebView, which is a top level series of Documents

Sounds like https://html.spec.whatwg.org/multipage/#traversable-navigable (which is indeed a narrower concept).

@mrobinson
Copy link
Member

a WebView, which is a top level series of Documents

Sounds like https://html.spec.whatwg.org/multipage/#traversable-navigable (which is indeed a narrower concept).

I think it's a great idea to use the spec language the for code that implements it, but I'm not sure it makes sense for this to always be exposed in the Constellation and definitely not the API. Folks using Servo will know what a WebView is, which make it a very useful name.

@wusyong
Copy link
Contributor

wusyong commented Mar 7, 2024

I agree WebView should be a term for external users. The code implementation itself should keep with spec.
I believe the doc comment of Webivew already mentions it's a similar concept to a top-level browsing context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-constellation Involves the constellation A-content/script Related to the script thread B-meta This issue tracks the status of multiple, related pieces of work
Projects
None yet
Development

No branches or pull requests

3 participants