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
[Web] Fix insertions/deletions at inverted selection for TextEditingDeltas #44693
[Web] Fix insertions/deletions at inverted selection for TextEditingDeltas #44693
Conversation
final List<dynamic> eventArgs = <dynamic>[ | ||
'beforeinput', | ||
js_util.jsify(<String, dynamic>{ | ||
'inputType': 'insertLineBreak', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdebbar This test currently fails because there is no DomInputEvent
defined for InputEvent
which contains inputType
. In handleBeforeInput
we check the inputType
in the logic. Is there a way to test this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR to fix the tests: Renzo-Olivares#87
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! I was trying to avoid adding to the DOM API but if that's the only way to test this I think its okay. InputEvent
is a basic building block like KeyboardEvent
and other related events so it would be good to add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It seems to me that extending DOM bindings where needed is better than ad-hoc wrapper just for the test.
80f13cd
to
ea53bab
Compare
@@ -3,6 +3,7 @@ | |||
// found in the LICENSE file. | |||
|
|||
import 'dart:async'; | |||
import 'dart:js_interop'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems causing the CI check to fail.
Thank you for this change @Renzo-Olivares! There appear to be a few linting errors
Also it doesn't look like we're sending |
TextAffinity should be reported, but it's somewhat orthogonal to inverted selection ( |
@htoor3 Sorry about that must've missed these. They should be fixed now. In general the framework does use |
Yep it didn't seem like it was a pressing TODO, but I was curious if it was related to this issue. I think there's a fallback in This change lgtm! There are just a few more breaking tests in what looks like Desktop Safari only - Desktop Safari can be a little weird to test. Take a look at this comment here - it's possible adding these to ensure the placement of the input element could resolve those tests. |
954d2f6
to
1a0ed36
Compare
I can't reproduce the safari error locally (though I do get another test failing - "text editing styles invisible element"). Could this be a problem with different Safari version? |
Right. It seems like the test that is failing for me ( |
I don't think this PR is a result of those failures. I tried running tests locally on |
I think you're getting the failure because after setting EDIT: messed up the version numbers. |
I played with this a little bit. It turns out that Safari 15 doesn't support setting var ev = new InputEvent('beforeinput', {'inputType' : 'deleteContentBackward'})
ev.inputType // always prints ""
I don't know if it is reasonable to expect the CI to be updated to Safari 16 any time soon, but if not then these tests should maybe be disabled for Safari? |
@knopp Thank you for looking into that! Given that information I think its okay to disable these tests on Safari for the time being and a TODO explaining the issue. Our use of |
@Renzo-Olivares I think that makes sense. Let me doublecheck with the team to determine what version of Safari is being used to run our CI tests and also what the version rolling process looks like. Could you point me to the codepath where we're testing |
Here we're creating a |
Thank you @knopp! Regarding the CI Safari version, it seems like it's tied to the CI server MacOS version and probably needs manual intervention to roll. I think in that case, it's fair to disable them for Safari so we can get this fix in. I would add a TODO that links to a newly created issue outlining the Safari issue, mentioning to re-enable these after the Safari version rolls to 16 in CI. |
1a0ed36
to
c0a0a8a
Compare
Looks like the tests pass, can this be merged? |
Yes I'll merge it. I created an issue to re-enable the tests flutter/flutter#134271. |
…134306) flutter/engine@f09a139...6d6b448 2023-09-08 skia-flutter-autoroll@skia.org Roll Skia from 71e40cc0faf6 to c5e67d222f46 (4 revisions) (flutter/engine#45576) 2023-09-08 rmolivares@renzo-olivares.dev [Web] Fix insertions/deletions at inverted selection for TextEditingDeltas (flutter/engine#44693) 2023-09-08 skia-flutter-autoroll@skia.org Roll Skia from ece9f3a15b08 to 71e40cc0faf6 (1 revision) (flutter/engine#45575) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes issue where the delta range would be calculated wrong when the selection is inverted.
Pre-launch Checklist
///
).