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
A-constellationInvolves the constellationA-content/domInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueE-very-complexVery difficult. Do not attempt without significant relevant experience and motivation.I-enhancementNo impact; the issue is a missing or proposed feature.
Nobody is working on it. I don't think anybody has wanted to tackle dealing with multiple toplevel windows and figuring out how that relates to things like the compositor, constellation, and webrender.
#13994 needs to happen first (if you have multiple compositors, you will need multiple top level frames). Also, @glennw might be working on something related.
This issue is about supporting window.open which might not require multiple compositors. Maybe the embedder could just open a new tab instead of a new window, which in this case would only require multiple root frames (not multiple compositors).
Do we support WindowProxy already? Is it necessary to support window.open?
A simple initial approach could be to just fire an event to the embedder and let the embedder create a new top level frame (see how that would work here #13994 (comment)).
Maybe we could ignore opener and refererrer at first.
@paulrouget yes I can first work on #13994 and #13993, it sounds like this one needs a bit more infrastructure in place to be completed, and it's nice way to break up the work.
re the initial approach you mention, am I correct if I say that when you say "just fire an event to the embedder" you mean that window.open would fire something such as the "BrowserEvent::HandleUrl" in your example, and that the "embedder" Tabs, would respond to that event by "asking" for a new browsing context from Servo through the constellation, in your example using new_browser.
In this case we would also need to add such event handling ourselves in ports/servo, which as I understand it is acting like a default embedder to run servo?
@paulrouget yes I can first work on #13994 and #13993, it sounds like this one needs a bit more infrastructure in place to be completed, and it's nice way to break up the work.
And if I'm not mistaken, @glennw is working on multiple WR instances. I'm not sure how this plays with multiple compositors. Supporting multiple compositors will also mean that we need to stop using exclusively the compositor channel to talk back to the embedder. We may need another communication channel (see #15934).
So you need to sync up with them (IRC is a good place for that) to understand where you can help.
re the initial approach you mention, am I correct if I say that when you say "just fire an event to the embedder" you mean that window.open would fire something such as the "BrowserEvent::HandleUrl" in your example, and that the "embedder" Tabs, would respond to that event by "asking" for a new browsing context from Servo through the constellation, in your example using new_browser.
You're correct.
The payload of the event should include enough information for the embedder to be able to create a new frame with the proper context name, opener reference, referrer, etc.
Something like this:
WindowMethod::new_window(opener:FrameId (or PipelineId), disposition: WindowDisposition, load_data: LoadData, context_name: String);
// preferred disposition. Up to the embedder to follow this or not:
pub enum WindowDisposition {
ForegroundTab,
BackgroundTab,
NewWindow,
}
(this event would also be used by target="_blank", not just window.open)
window.open is synchronous, so that means the script will need to wait on the constellation which will wait on the embedder. But I don't think we ever want the constellation to block on anything, so I don't know how this should be done. @asajeffrey might be able to help here.
In this case we would also need to add such event handling ourselves in ports/servo, which as I understand it is acting like a default embedder to run servo?
At this point, we can see that a lot of things are required before being able to fully support window.open.
In term of priorities, supporting multiple compositors is very important for us (more that supporting window.open), along with supporting multiple top frames.
I am not sure what would be best for you to start with. @jdm - what do you think?
I propose to first work on #13993 and #15934 in parallel, ultimately culminating in an implementation of window.open within the context of this issue that would look somewhat like we sketched above.
I assume the actual implementation plan for window.open will become clearer as the other issues are resolved first, and I'll communicate some plan for both other issues after having looked more closely into the code.
There is an 'external' servo-specific compositor/embedder/webrender part to this.
If we create an auxiliary browsing context via the embedder, let's say using NewBrowser, we can 'show' it immediately using SelectBrowser, like a new tab that would actually replace the previous one in the UI, but at least internally work like a separate tab?
SelectBrowser results in sending the frame tree to webrender, and I don't see this having any effect on the script thread. So in theory, we could create a new auxiliary browsing context, 'select it as the active browser', while leaving the 'opener' browsing context still 'running'(so I assume the event loop of the opener could still "do stuff" which would be important in making tests pass, since test assertions will be done in the opener browsing context in most cases.)
Or, we create a new browser but never select it, leaving the opener in the UI, and just running the script thread of the auxiliary browsing context 'in the background'(again, goal would be to work towards making relevant HTML tests pass). This might be better because in case you're running a single test, the test results will only be shown in the 'opener' browsing context, not the auxiliary one...
At that point we basically have separate "tabs", if only from a script_thread/constellation perspective.
I think this could be a way for me to start working on 1, while leaving webrender/compositor as it is for now?
Also, since 'multiple webrender' was mentioned a year back, I was looking into webrender and the concept of webrender::api::DocumentId caught my attention. It seems now we use one DocumentId for the entire constellation, and I'm wondering if we couldn't move to having one for each top_level_browsing_context?
Lastly, if we were to have such a setup, do we really need multiple compositors? Could it be suffecient to pass the (TopLevelBrowsingContextId, webrender::api::DocumentId) around in relevant windowing::WindowEvent or compositor_thread::Msg to allow the compositor to handle multiple 'windows' in the form of multiple webrender documents?
WR can only render one top level browsing context at once, but that doesn't mean other contexts / pipeline are not running. Sending the frametree to WR has not impact in the main event loop or the pipelines (beside the visibility event iirc).
On open(), we can, like you said, create a new tab, select it, and that's it.
The user experience will be affected, but that's fine for now. We will eventually implement tab switching (that works already, but we don't save the list of browsers yet, and we didn't bind the shortcuts).
For tests, I don't think this will have any impact at all. Both pipelines will be running. The one that's on screen should not matter.
Ok, I'll be moving on to this one, starting with #20678 (which I guess doesn't make a lot of sense to merge on it's own with all those TODO's and test failures left?).
To somewhat clarify the scope of this issue, here is a list of (inter-)related concepts, in no particular order:
A-constellationInvolves the constellationA-content/domInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueE-very-complexVery difficult. Do not attempt without significant relevant experience and motivation.I-enhancementNo impact; the issue is a missing or proposed feature.
Activity
gterzian commentedon Apr 21, 2017
is anyone working on this one? If not, I am interested...
jdm commentedon Apr 21, 2017
Nobody is working on it. I don't think anybody has wanted to tackle dealing with multiple toplevel windows and figuring out how that relates to things like the compositor, constellation, and webrender.
gterzian commentedon Apr 22, 2017
ouch, that sounds painful, well I guess I'm up for it, please add the 'assigned' label. 😄
If anything, I love a good piece of glue code!
jdm commentedon Apr 22, 2017
Related discussion: #13338
jdm commentedon Apr 22, 2017
Also: #13993, #13994, and a bunch of relevant stuff in the tracking issue for multiple windows: #13997
paulrouget commentedon Apr 22, 2017
#13994 needs to happen first (if you have multiple compositors, you will need multiple top level frames). Also, @glennw might be working on something related.
This issue is about supporting
window.openwhich might not require multiple compositors. Maybe the embedder could just open a new tab instead of a new window, which in this case would only require multiple root frames (not multiple compositors).Do we support
WindowProxyalready? Is it necessary to supportwindow.open?Do we want to support window opener and referrer?
/cc @glennw @asajeffrey
paulrouget commentedon Apr 22, 2017
A simple initial approach could be to just fire an event to the embedder and let the embedder create a new top level frame (see how that would work here #13994 (comment)).
Maybe we could ignore opener and refererrer at first.
Considerations:
window.openis synchronousMozBrowserEvent::OpenWindoweventgterzian commentedon Apr 23, 2017
@paulrouget yes I can first work on #13994 and #13993, it sounds like this one needs a bit more infrastructure in place to be completed, and it's nice way to break up the work.
re the initial approach you mention, am I correct if I say that when you say "just fire an event to the embedder" you mean that
window.openwould fire something such as the "BrowserEvent::HandleUrl" in your example, and that the "embedder"Tabs, would respond to that event by "asking" for a new browsing context from Servo through the constellation, in your example usingnew_browser.In this case we would also need to add such event handling ourselves in
ports/servo, which as I understand it is acting like a default embedder to run servo?paulrouget commentedon Apr 24, 2017
@asajeffrey is already working on multi top level frames (#13994).
And if I'm not mistaken, @glennw is working on multiple WR instances. I'm not sure how this plays with multiple compositors. Supporting multiple compositors will also mean that we need to stop using exclusively the compositor channel to talk back to the embedder. We may need another communication channel (see #15934).
So you need to sync up with them (IRC is a good place for that) to understand where you can help.
You're correct.
The payload of the event should include enough information for the embedder to be able to create a new frame with the proper context name, opener reference, referrer, etc.
Something like this:
(this event would also be used by target="_blank", not just window.open)
window.openis synchronous, so that means the script will need to wait on the constellation which will wait on the embedder. But I don't think we ever want the constellation to block on anything, so I don't know how this should be done. @asajeffrey might be able to help here.Yes.
paulrouget commentedon Apr 24, 2017
At this point, we can see that a lot of things are required before being able to fully support
window.open.In term of priorities, supporting multiple compositors is very important for us (more that supporting
window.open), along with supporting multiple top frames.I am not sure what would be best for you to start with.
@jdm - what do you think?
3 remaining items
gterzian commentedon Apr 25, 2017
I propose to first work on #13993 and #15934 in parallel, ultimately culminating in an implementation of
window.openwithin the context of this issue that would look somewhat like we sketched above.I assume the actual implementation plan for
window.openwill become clearer as the other issues are resolved first, and I'll communicate some plan for both other issues after having looked more closely into the code.paulrouget commentedon Apr 25, 2017
I think this is a good idea.
gterzian commentedon May 6, 2018
As an update, once #20678 and #20707 land I intend to work on this one.
My current perspective:
If we create an auxiliary browsing context via the embedder, let's say using
NewBrowser, we can 'show' it immediately usingSelectBrowser, like a new tab that would actually replace the previous one in the UI, but at least internally work like a separate tab?SelectBrowserresults in sending the frame tree to webrender, and I don't see this having any effect on the script thread. So in theory, we could create a new auxiliary browsing context, 'select it as the active browser', while leaving the 'opener' browsing context still 'running'(so I assume the event loop of the opener could still "do stuff" which would be important in making tests pass, since test assertions will be done in the opener browsing context in most cases.)Or, we create a new browser but never select it, leaving the opener in the UI, and just running the script thread of the auxiliary browsing context 'in the background'(again, goal would be to work towards making relevant HTML tests pass). This might be better because in case you're running a single test, the test results will only be shown in the 'opener' browsing context, not the auxiliary one...
At that point we basically have separate "tabs", if only from a script_thread/constellation perspective.
I think this could be a way for me to start working on 1, while leaving webrender/compositor as it is for now?
What do you think?
gterzian commentedon May 7, 2018
Also, since 'multiple webrender' was mentioned a year back, I was looking into webrender and the concept of
webrender::api::DocumentIdcaught my attention. It seems now we use oneDocumentIdfor the entire constellation, and I'm wondering if we couldn't move to having one for each top_level_browsing_context?See https://github.com/servo/webrender/blob/eb9415a3b601451476c52be4f444c982a3ed8e0c/webrender/examples/document.rs#L27
I can imagine something like the below on constellation:
tabs: HasMap<TopLevelBrowsingContextId, webrender::api::DocumentId>Lastly, if we were to have such a setup, do we really need multiple compositors? Could it be suffecient to pass the
(TopLevelBrowsingContextId, webrender::api::DocumentId)around in relevantwindowing::WindowEventorcompositor_thread::Msgto allow the compositor to handle multiple 'windows' in the form of multiple webrender documents?paulrouget commentedon May 7, 2018
WR can only render one top level browsing context at once, but that doesn't mean other contexts / pipeline are not running. Sending the frametree to WR has not impact in the main event loop or the pipelines (beside the visibility event iirc).
On
open(), we can, like you said, create a new tab, select it, and that's it.The user experience will be affected, but that's fine for now. We will eventually implement tab switching (that works already, but we don't save the list of browsers yet, and we didn't bind the shortcuts).
For tests, I don't think this will have any impact at all. Both pipelines will be running. The one that's on screen should not matter.
gterzian commentedon May 25, 2018
Ok, I'll be moving on to this one, starting with #20678 (which I guess doesn't make a lot of sense to merge on it's own with all those TODO's and test failures left?).
To somewhat clarify the scope of this issue, here is a list of (inter-)related concepts, in no particular order:
@KiChjang I see you've recently worked in the same area with #20615, would you be interested in reviewing this one?
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=nox,jdm
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=jdm
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=jdm