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

[OSR/Touch] Scrolling initiated by touch events aborted after "navigation within document" occurs #2936

Open
magreenblatt opened this issue May 18, 2020 · 4 comments
Labels
bug Bug report Framework Related to framework code or APIs has fix A fix has been proposed help wanted Issue resolution will likely require community contributions osr Related to off-screen rendering

Comments

@magreenblatt
Copy link
Collaborator

Original report by Dmitry Azaraev (Bitbucket: dmitry-azaraev, GitHub: dmitry-azaraev).


When we perform touch-scrolling sequence, if in this time page will set document.location.hash, then scrolling immediately stops. If you will try reproduce same with devtools sensors emulation - it will work fine. I’m reproduced this on CEF78 and current CEF master.

How to reproduce:

  1. Modify cefclient (it is fastest way):
// In file: `cef/tests/cefclient/browser/test_runner.cc` replace method body.

void RunOtherTests(CefRefPtr<CefBrowser> browser) {
  // Run on some another thread which we can block as we want
  // Because we use Sleep, and this is important to indirectly define scroll speed/power.
  if (!CefCurrentlyOn(TID_FILE_USER_BLOCKING)) {
    CefPostTask(TID_FILE_USER_BLOCKING, base::Bind(&RunOtherTests, browser));
    return;
  }

  int delayMs = 20;

  CefTouchEvent te;
  te.id = 0;
  te.x = 300;
  te.y = 300;
  te.type = CEF_TET_PRESSED;

  auto host = browser->GetHost();
  host->SendTouchEvent(te);

  for (int i = 0; i < 200; i++) {
    te.x = 300 - i;
    te.y = 300;
    te.type = CEF_TET_MOVED;
    host->SendTouchEvent(te);
    Sleep(delayMs);
  }

  te.x = 300 - 200;
  te.type = CEF_TET_RELEASED;
  host->SendTouchEvent(te);
  Sleep(delayMs);
}

2. Run cefclient --off-screen-rendering-enabled

3. Load one of attached files: cef-carousel.html , and run Tests->Other Tests… , it will slowly scroll layer and should stop with ScrollLeft value around 185..186.

4. Load another file: cef-carousel-hashed.html , and run Tests->Other Tests… , it will stop scroll almost immediately, and show some number (usually less than 10).

cef-carousel-hashedonly listen scroll event and perform navigation within document (via document.location.hash = v;). Events generated by devtools emulation and snipped above seems to be identical. The only thing what in one case changing hash is break scrolling and in other case it is not.

PS: This is not uncommon technique, exactly google search may update document.location in same way when you trying to g-scrolling-carousel. However test this over google search is much harder, and requires additional preparations.

@magreenblatt
Copy link
Collaborator Author

Original changes by Dmitry Azaraev (Bitbucket: dmitry-azaraev, GitHub: dmitry-azaraev).


  • edited description

1 similar comment
@magreenblatt
Copy link
Collaborator Author

Original changes by Dmitry Azaraev (Bitbucket: dmitry-azaraev, GitHub: dmitry-azaraev).


  • edited description

@magreenblatt
Copy link
Collaborator Author

Original comment by Dmitry Azaraev (Bitbucket: dmitry-azaraev, GitHub: dmitry-azaraev).


Pull request #317 has fix.

@magreenblatt
Copy link
Collaborator Author

Original changes by Dmitry Azaraev (Bitbucket: dmitry-azaraev, GitHub: dmitry-azaraev).


  • changed component from "Framework" to "Framework-HasFix"

@magreenblatt magreenblatt added the osr Related to off-screen rendering label Mar 12, 2023
@magreenblatt magreenblatt added the help wanted Issue resolution will likely require community contributions label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report Framework Related to framework code or APIs has fix A fix has been proposed help wanted Issue resolution will likely require community contributions osr Related to off-screen rendering
Projects
None yet
Development

No branches or pull requests

1 participant