Explanation is here: https://code.google.com/p/chromium/codesearch#chromium/src/content/renderer/render_thread_impl.cc&l=978Might no longer be true though... +piman
On Thu, Apr 14, 2016, 5:14 AM Avi Drissman <a...@google.com> wrote:I don't actually know. :(I got involved in alert dialogs when I implemented them for the Mac, and later when I worked in that area for content. I'm pretty up on the UI half, but know nothing about how the mechanisms behind them work. If it is indeed a legacy requirement from showModalDialog, and if nowadays we can actually downgrade them to a less messy implementation, I'm all for it. That's probably independent of any work that I do on OldSpice, yes? Given that such a change wouldn't be visible to the web, I would say to go for it if you can.BTW, OldSpice is going to take a while to get all the UI in line, get agreement on implementations, and get coordination across browser vendors. I would highly recommend that you do not wait for it if possible :)AviOn Wed, Apr 13, 2016 at 11:08 PM, Alexandre Elias <ael...@google.com> wrote:Hi Avi,Following up on https://codereview.chromium.org/1865143003/ -- can you answer my question about why alert() uses a nested message loop? My mental model is that alert() needs to block on a single result, the Yes/No boolean answer from the browser-side dialog box. A full nested message loop that processes every message is overkill for this and introduces a requirement on a lot of other subsystems to support possible reentrancy and reordering. If we simply need to wait on a single message type, why not use an ordinary sync IPC for alert? (Or, if we need to also process one or two other types of messages, why not specifically filter those in the nested message loop and repost out every unknown message to the outer loop?)I'm hoping the answer is that it's implemented this way purely as a legacy of showModalDialog() and that there's no remaining reason why we can't switch to sync IPC. If that's the case, changwan@ has volunteered to switch alert() to it as it will unblock his project and he has a decent understanding of the problem space. It seems that fixing the nested message loop is unfortunately *not* a part of the current OldSpice plan, but maybe we can add it in?If it's not so easy, please explain why! cc'ing also danakj@ who is working on nested-message-loop primitives for other use cases in the browser like resize -- if we are forced to use nested message loops after all, we should at least have a single shared implementation that fits all the uses of it in Chrome.--
Alex
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CANMdWTs6qNSUeOBOMnp1%3D30jvu5HyKRHY3Y3fNmxoEj-gT0gfw%40mail.gmail.com.
This comment is outdated and should be removed or updated after the removal of NPAPI.There are still a few places where IPC::SyncMessage::EnableMessagePumping() is called, which is what triggers this code path. JS dialogs are one of them. Even ignoring plugins, this behavior was originally added to maintain compatibility with IE and Firefox. They implemented JS dialogs by calling win32's MessageBox on the same thread where the html engine was running. Internally that runs a nested message loop. So we wanted animations to continue running to match their behavior. A simple example: https://jsfiddle.net/sfc75sg6/1/I tested this now and while animations continue in IE and Edge, this doesn't work anymore in Safari and Firefox. My hunch is we don't care to maintain this behavior anymore, in which case we can simplify this a lot, but I defer to folks more knowledgeable about the web.On Wed, Apr 13, 2016 at 9:15 PM, Avi Drissman <a...@google.com> wrote:Are you talking about the comment?// This could cause// a complete hang of Chrome if a windowed plugin is trying to communicate// with the renderer threadWe have no windowed plugins any more (goodbye, NPAPI!) so does this still apply?+jam
Sgtm, simpler is better.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CANMdWTsyyv1pTTbZrg7KMnfduH5sjzw6N8DJvb9HiwY%2Bn6LwXQ%40mail.gmail.com.
Explanation is here: https://code.google.com/p/chromium/codesearch#chromium/src/content/renderer/render_thread_impl.cc&l=978Might no longer be true though... +piman
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAMeTaZcJvdOL%3DxR3Q_KLB5Pj%2BiHAJD7hJ%2BB7FVStrQy2LCXc5w%40mail.gmail.com.
This nested message loop you're talking about is in the browser process though right?
Could the browser process instead mark the renderer as needing a resize, unwind the layout stack, notice there's dirty web contents then install a message loop filter?
In blink we wouldn't try to process something like this sync under the layout system, we'd use dirty bits or store the state and then process it when coming out. It allows better asserts and lifecycle control.
aelias and I chatted, next steps are:1. Make a proposal to share with other browser vendors at https://github.com/WICG/interventions/issues.2. If this is in a spec somewhere, make a patch to the spec that we attach to that issue.3. Send an intent to implement and ship. This doesn't need to block on #1/#2 above completing, but it should block on the discussions having been started.4. Ship.Domenic or Tab, would you be willing to help with #1 and #2 here? The specific thing is that we want to change the behavior of web pages when a modal dialog is open to match Safari. Namely, accelerated CSS animations continue, but main thread rendering and animated gifs are paused (currently in Chrome the main thread keeps pumping). It's not clear to me what spec would even cover this. Is it the HTML spec? I know the HTML spec has the main thread rendering pipeline.
On Fri, Apr 15, 2016 at 7:21 PM Ojan Vafai <oj...@google.com> wrote:aelias and I chatted, next steps are:1. Make a proposal to share with other browser vendors at https://github.com/WICG/interventions/issues.2. If this is in a spec somewhere, make a patch to the spec that we attach to that issue.3. Send an intent to implement and ship. This doesn't need to block on #1/#2 above completing, but it should block on the discussions having been started.4. Ship.Domenic or Tab, would you be willing to help with #1 and #2 here? The specific thing is that we want to change the behavior of web pages when a modal dialog is open to match Safari. Namely, accelerated CSS animations continue, but main thread rendering and animated gifs are paused (currently in Chrome the main thread keeps pumping). It's not clear to me what spec would even cover this. Is it the HTML spec? I know the HTML spec has the main thread rendering pipeline.Sure, happy to help. This will require some research, definitely, as I'm not sure how to disentangle things.The current spec situation, as far as I know, is that the spec says:
which pauses the entire message loop so that no tasks or rendering or script can continue to run. That seems like it would preclude CSS animations from running to me, since they are part of the update the rendering idea currently, due to the simplistic model of how rendering works in the spec.
On Fri, Apr 15, 2016 at 7:52 PM Domenic Denicola <dom...@google.com> wrote:On Fri, Apr 15, 2016 at 7:21 PM Ojan Vafai <oj...@google.com> wrote:aelias and I chatted, next steps are:1. Make a proposal to share with other browser vendors at https://github.com/WICG/interventions/issues.2. If this is in a spec somewhere, make a patch to the spec that we attach to that issue.3. Send an intent to implement and ship. This doesn't need to block on #1/#2 above completing, but it should block on the discussions having been started.4. Ship.Domenic or Tab, would you be willing to help with #1 and #2 here? The specific thing is that we want to change the behavior of web pages when a modal dialog is open to match Safari. Namely, accelerated CSS animations continue, but main thread rendering and animated gifs are paused (currently in Chrome the main thread keeps pumping). It's not clear to me what spec would even cover this. Is it the HTML spec? I know the HTML spec has the main thread rendering pipeline.Sure, happy to help. This will require some research, definitely, as I'm not sure how to disentangle things.The current spec situation, as far as I know, is that the spec says:
which pauses the entire message loop so that no tasks or rendering or script can continue to run. That seems like it would preclude CSS animations from running to me, since they are part of the update the rendering idea currently, due to the simplistic model of how rendering works in the spec.Ah. I'm much less fussed about allowing the things we happen to let through already (accelerated animations) than I am about disallowing the things we let through today that we shouldn't (main thread animations). If I read the spec correctly, this change actually makes us more spec compatible and we could just ship it today. So, I think we could just do 3 and 4 above to ship this.Although, I do find the following from the spec super confusing: " User agents should remain responsive to user input while paused, however, albeit in a reduced capacity since the event loop will not be doing anything." If the event loop is paused, then we can't remain responsive to user input.
It seems like we'd need to have the spec understand that there's another event loop for stuff that happens on the compositor thread to spec this properly? +Ian Kilpatrick +Ian Vollick since this is effectively about scheduling the rendering pipeline.
On Fri, Apr 15, 2016 at 7:52 PM Domenic Denicola <dom...@google.com> wrote:On Fri, Apr 15, 2016 at 7:21 PM Ojan Vafai <oj...@google.com> wrote:aelias and I chatted, next steps are:1. Make a proposal to share with other browser vendors at https://github.com/WICG/interventions/issues.2. If this is in a spec somewhere, make a patch to the spec that we attach to that issue.3. Send an intent to implement and ship. This doesn't need to block on #1/#2 above completing, but it should block on the discussions having been started.4. Ship.Domenic or Tab, would you be willing to help with #1 and #2 here? The specific thing is that we want to change the behavior of web pages when a modal dialog is open to match Safari. Namely, accelerated CSS animations continue, but main thread rendering and animated gifs are paused (currently in Chrome the main thread keeps pumping). It's not clear to me what spec would even cover this. Is it the HTML spec? I know the HTML spec has the main thread rendering pipeline.Sure, happy to help. This will require some research, definitely, as I'm not sure how to disentangle things.The current spec situation, as far as I know, is that the spec says:
which pauses the entire message loop so that no tasks or rendering or script can continue to run. That seems like it would preclude CSS animations from running to me, since they are part of the update the rendering idea currently, due to the simplistic model of how rendering works in the spec.Ah. I'm much less fussed about allowing the things we happen to let through already (accelerated animations) than I am about disallowing the things we let through today that we shouldn't (main thread animations). If I read the spec correctly, this change actually makes us more spec compatible and we could just ship it today. So, I think we could just do 3 and 4 above to ship this.Although, I do find the following from the spec super confusing: " User agents should remain responsive to user input while paused, however, albeit in a reduced capacity since the event loop will not be doing anything." If the event loop is paused, then we can't remain responsive to user input.It seems like we'd need to have the spec understand that there's another event loop for stuff that happens on the compositor thread to spec this properly? +Ian Kilpatrick +Ian Vollick since this is effectively about scheduling the rendering pipeline.In either case, Alex, I think you can move forward here with just sending the intent to implement and ship that clarifies what web-exposed behavior is changing since this makes us more spec-compatible.