Skip to content
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

Broken move-to-end-of-word in caret mode on Windows #8146

Open
The-Compiler opened this issue Mar 27, 2024 · 0 comments
Open

Broken move-to-end-of-word in caret mode on Windows #8146

The-Compiler opened this issue Mar 27, 2024 · 0 comments
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. language: javascript Issues which require knowing JavaScript. os: Windows Issues which only happen on Windows. priority: 2 - low Issues which are currently not very important.

Comments

@The-Compiler
Copy link
Member

With qutebrowser v3.1.0 and QtWebEngine 5.15.2, on Windows, pressing e in caret mode on tests/end2end/data/caret.html results in:

|one two threeone| two threeone two| threeone two thre|e

with the last one obviously being incorrect.

On Qt 6.2 to 6.5, the behavior got worse, with the first e jumping to one| two three, and then the cursor being stuck there (and not jumping over the space) even with further e keypresses. This looks to be due to a behavior change in window.getSelection().modify("move", "forward", "word") between Chromium 83 and Chromium 90 somewhere, though I couldn't find the exact culprit.

With "extend" in place of "move", Chromium 83 (QtWebEngine 5.15) results in one| two threeone[ two ]three as selection, but Chromium 90 results in one[ ]two three instead.

Together with our workaround here:

if (CaretBrowsing.isWindows &&
(direction === "forward" ||
direction === "right") &&
granularity === "word") {
CaretBrowsing.move("left", "character");
}

which is due to Chromium following platform-specific behavior of including the trailing space:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/editing_behavior.h;l=99-107;drc=03d34ce775fcc7578d9b2507f66f12cb05f5a205

this results in us just clearing the selection and thus further e keypresses not doing anything useful.

That in turn results in test failures on Windows:

Error: FAILED tests/end2end/features/test_caret_bdd.py::test_yank_selection_with_keep - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'category': 'message', 'loglevel': 20, 'message': '7 chars yanked to clipboard'}.
Error: FAILED tests/unit/browser/test_caret.py::TestWord::test_moving_to_end_and_selecting_a_word[webengine] - Failed: Failed to get selection!

I'm not sure how to best fix this. We might need to manually inspect and adjust the selection or something to prevent the Chromium behavior. In the meantime, I'm going to adjust the tests so they don't use move-to-end-of-word I suppose...

@The-Compiler The-Compiler added os: Windows Issues which only happen on Windows. priority: 2 - low Issues which are currently not very important. language: javascript Issues which require knowing JavaScript. bug: behavior Something doesn't work as intended, but doesn't crash. labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. language: javascript Issues which require knowing JavaScript. os: Windows Issues which only happen on Windows. priority: 2 - low Issues which are currently not very important.
Projects
None yet
Development

No branches or pull requests

1 participant