-
Notifications
You must be signed in to change notification settings - Fork 77
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
Codemirror: platform-custom code in editor #347
Comments
Since the sanitizer script doesn't seem to be happening in near future, can we put up a PR to remove this style manually? |
I'm not worried about platform-specific checks but more about browser-specific checks. We need to check whether these occurrences are in the path of the tests. |
It's worth looking into the linked examples above to see which of them is getting executed and has a meaningful performance impact, but based on personal experience with contentEditable it might be impossible to remove browser-specific checks without breaking the editor itself (or setting up a future breakage if/when we expand the test to hit a currently-unused code path). I agree that in general we don't want browser-specific code in the benchmark, but in this case it may be inevitable given the nature of editors (part of the reason these libraries get popular is because they smooth over cross browser behavior differences). |
There was some back and forth discussion today highlighting that while in general we don't want this kind of workaround, the nature of |
Is there a PR for this that I can test out? |
I've duplicated the editor code in my branch: https://github.com/camillobruni/Speedometer/tree/2024-01-24_custom_editor And it contains the patched browser object: https://github.com/camillobruni/Speedometer/blob/2024-01-24_custom_editor/resources/editors_sanitized/dist/assets/codemirror-ba10726a.js |
I've gotten 5 samples of run for each browser's. The results look largely unchanged although maybe ~0.5% or so better in "after" measurements across the board. Given this, I'm fine with going ahead with this change. Is there an open PR for it? Chrome 122.0.6261.57 == After == 29.7 ± 0.81 Firefox 123.0 == After == Safari Technology Preview 188 == After == |
As I mentioned in #347 (comment), I prefer the behavior as-is, since contentEditable creates the need for browser-specific quirks (part of the reason editor libraries are popular are so these get abstracted away). So we'd really have to validate not just any performance difference but also investigate whether removing those changes the actual functionality. Given that there doesn't seem to be a strong performance difference one way or the other, I'd like to just close this issue (perhaps with a note in the README indicating that we avoid browser-specific behavior in general, but in this particular test we are allowing it). |
I'm fine with that outcome as well. Sounds like maybe we're leaning more towards closing this then? |
Per today's meeting, closing this issue in favor of keeping the current code. |
There are quite a few places where we have very android and iOS specific code that is not executed elsewhere.
I don't think that's ideal, I'd still propose to integrate my navigator sanitizer (see #336) to get rid of this entirely.
The text was updated successfully, but these errors were encountered: