L.G.T.M.
LGTM!!
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
What about alert messages and the debugger? They are no different from the modal dialog - they run nested event loops on arbitrary JS stack and make same web calls reentrant. What part of the complexity is going away with the showModalDialog?
Regards
Pavel
showModalDialog allows one WebView to schedule work, whereas with alert/confirm/prompt/print, no WebView may schedule work.
What about debugger? Mutating DOM and evaluating setTimeout from the console while on a breakpoint is a generic use case for us.
The debugger at least doesn't let the page decide to start a nested message loop.
Also, it doesn't require the entire browser to stop doing anything else (note that this is actually broken in chrome - the dialog is currently not modal).
Last but not least, we could do something similar on the main thread to what I recently added for workers: add a separate message queue for debugger tasks, then we don't need a nested message loop anymore.
Best
Jochen
Alright. I just wanted to bring attention to other use cases that require similar complexity. Given they are on radar, this intent looks good.
Jochen, I'll follow up with you on a separate message queue. WebView might be not as simple as worker there.
Regards
Pavel
I'm surprised nobody's really spoken up about the negative effects of this change. I'll try not to make this too rant-y but...
I'm kind of amused at the fact that everyone's quick to say L.G.T.M. without giving any consideration to the implications of a change like this. It seems like this is being removed only because its 'hard to do' and 'nobody uses it'. What real good reason do you have to remove it? Last I checked, its in the HTML5 spec. Maybe I'm crazy and I'm missing something.
What about the people who do use it? Did you guys every think about web application usage? Just to clarify, I'm talking business applications here. Of course you'll only see a small percentage because most people are looking at cat pics or wasting their lives on facebook. I feel like no real research has gone into examining the overall effects of this. Somebody did a web search and said that's good enough. Absolutely ludicrous.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
"We sent out these announcements so that the community can let us know about any potential issues so we can react to them. We need to know about concrete real-world uses in order to make an informed decision."Well, that's us, for instance. Part of our web based application is content creation, using CKEditor on part of the page. Our users are effectively creating HTML pages, and sometimes need more room than is available in the region of the page CK is restricted to. For this reason we have a button that reopens CKEditor in a detached window that can use the whole screen. This has to be modal so changes can't be made in the smaller version at the same time.
We use showModalDialog() for this, because it conveniently pauses execution in the opener until the window closes, at which point it returns (via window.returnValue) the new content and we can just update.
The 'fix' for loosing showModalDialog() would be to display a full-page overlay, right ? This is not as useful as a detached window, because I have to resize the browser (and all its tabs) rather than just the window of interest.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
The showModalDialog method along with alert and prompt are one of the few true blocking calls. Implementing a polyfill is next to IMPOSSIBLE without crashing the browser.Here is an example of why:var returnValue = window.showModalDialog(<someuri>);Now since this is a blocking call window.showModalDialog will not return until the child window (<someurl>) calls a window.close on itself.There is no practical way to simulate a blocking call in javascript to write out a backward compatible javascript polyfill.
Here is a practical example of a use case that is in production on a multi million dollar product.A user is clicking on a feature that requires some setup before it continues to render the page.var featureConfig = window.showModalDialog(<someUrl>); //someUrl might be a wizard walking the user through the complex flow to finally submit the results back to the parent window as the result object.Since the call was blocking the code is scripted to assume a synchronous nature of the method call..
I also have a concern regarding the source of the data in making a swift decision. Most of these method calls tend to happen on pages that require a logged in context. Hence this will not show in a grep search of the top public websites. The amount of work involved in converting a previously synchronous flow (by leveraging the blocking nature of window.showModal) into asynchronous one is not trivial.
This will cause significant issues for some applications and may require more than 3 months of notice to fix.
var featureConfig = window.showModalDialog(<someUrl>); //someUrl might be a wizard walking the user through the complex flow to finally submit the results back to the parent window as the result object.Since the call was blocking the code is scripted to assume a synchronous nature of the method call..To address that use case, you'll probably want to create a full-page element that dims the existing content of the page and prevents the user from interacting with it. You can position your custom dialog on top of that element to let the user interact with the dialog. That's how most web apps handle this use case.
Adam,Don't get me wrong, I am totally in favor of removing this from the browser codebase as it simplifies a lot of things and truly reflects the asynchronous nature of javascript by removing the blocking methods.At the same time, we do also want to point out that despite making progress on the reducing/removing the use of blocking calls, three months is not enough for us. Out entire app (an older version) that has more that half a million active users will be impacted pretty significantly as we will not be able to turnaround in time. We have a fairly large codebase that uses this feature a lot.At this point, is it a given that this will be removed in the next release of chrome or do we have a chance to postpone the removal of this feature by one more release ?