Repository navigation
script: Fully integrate key event handling - #48324
Conversation
|
🔨 Triggering try run (#35842678458) for Linux (WPT) |
|
Test results for linux-wpt from try job (#35842678458): Flaky unexpected result (39)
Stable unexpected results that are known to be intermittent (12)
|
|
✨ Try run (#35842678458) succeeded. |
| }) | ||
| .shortcut(CMD_OR_CONTROL, 'A', || { | ||
| self.select_all(); | ||
| /// Process a given `EditorAction` and return an action for the caller to execute. |
There was a problem hiding this comment.
Should probably be EditingAction?
|
|
||
| pub(crate) fn perform_editing_action(&self, cx: &mut JSContext, action: EditingAction) -> bool { | ||
| // A couple editing actions can be performed via the external interface of | ||
| // `EditincContext`. If that's the case we want to do that so that the same |
|
|
||
| let mut is_space = false; | ||
| let scroll = match event.key() { | ||
| let scroll = match &event.key { |
There was a problem hiding this comment.
Could cursor movement editing actions be implemented in Document's perform_editing_action instead of re-checking the keyboard scroll keys? Not sure if there's some inconsistency that prevents doing that but it could make the logic less spread out.
There was a problem hiding this comment.
Cursor movement and keyboard scrolling a two entirely separate concepts where cursor motion supersedes keyboard scrolling when it is available. In addition, it is interesting to keep editing actions (such as cursor movement) integrated for text inputs and the contenteditable, whereas keyboard scrolling doesn't apply to text inputs.
There was a problem hiding this comment.
Ah ok! That makes sense especially with respect to contenteditable elements.
This change makes it so that key events for both text inputs and for the `Document` are handled in the same place. In addition, it ensures that all edits from key events happen *after* `keypress` events fire. Signed-off-by: Martin Robinson <[email protected]>
d644dc1 to
4744428
Compare
mrobinson
left a comment
There was a problem hiding this comment.
Thanks. I've addressed the typos.
|
This is a very nice consolidation. Thanks! |
This change makes it so that key events for both text inputs and for the
`Document` are handled in the same place. In addition, it ensures that
all edits from key events happen *after* `keypress` events fire.
Testing: This causes some subtests to start passing. In addition two
tests
have neutral result changes:
- `paste-on-detaching-iframe.https.html`: Moves from timeout to crash
but this
crash is the one caused by the harness still timing out. This is due to
an
issue where handled events for closed iframes are never communicated to
the
WebDriver harness.
- `onselectstart-on-key-in-contenteditable.html`: One more subtest
starts failing
due to getting further along in the process of the test. This should be
fixed
with the implementation of the `selectstart` event.
Signed-off-by: Martin Robinson <[email protected]>
This change makes it so that key events for both text inputs and for the
`Document` are handled in the same place. In addition, it ensures that
all edits from key events happen *after* `keypress` events fire.
Testing: This causes some subtests to start passing. In addition two
tests
have neutral result changes:
- `paste-on-detaching-iframe.https.html`: Moves from timeout to crash
but this
crash is the one caused by the harness still timing out. This is due to
an
issue where handled events for closed iframes are never communicated to
the
WebDriver harness.
- `onselectstart-on-key-in-contenteditable.html`: One more subtest
starts failing
due to getting further along in the process of the test. This should be
fixed
with the implementation of the `selectstart` event.
Signed-off-by: Martin Robinson <[email protected]>
This change makes it so that key events for both text inputs and for the
Documentare handled in the same place. In addition, it ensures thatall edits from key events happen after
keypressevents fire.Testing: This causes some subtests to start passing. In addition two tests
have neutral result changes:
paste-on-detaching-iframe.https.html: Moves from timeout to crash but thiscrash is the one caused by the harness still timing out. This is due to an
issue where handled events for closed iframes are never communicated to the
WebDriver harness.
onselectstart-on-key-in-contenteditable.html: One more subtest starts failingdue to getting further along in the process of the test. This should be fixed
with the implementation of the
selectstartevent.