electron: [Bug]: Edge case where specific element does not receive click as expected in Electron 29.0.0 and above

Preflight Checklist

Electron Version

29.0.0-alpha.8 and above

What operating system are you using?

Other Linux

Operating System Version

Kubuntu 23.04/Windows 11

What arch are you using?

x64

Last Known Working Electron version

29.0.0-alpha.7

Expected Behavior

Clicking into <pre> element with white-space: pre inside of text editor should work.

Actual Behavior

Clicks are largely ignored in that one sort of element, although not in any others, and not if white-space: pre is removed. This does not appear to be explainable by any traditional explanation such as zIndex, invisible elements, cancelled events, or otherwise.

Testcase Gist URL

I have not been able to reproduce this, but am quite certain this edge case exists

Additional Information

Our code runs perfectly in Electron 28.3.1, and in Chrome 124 (which is in theory basically identical to Electron 29.3.x) - and yet the code that fails in Electron works fine in the browser. Affects Linux and Windows both, and disabling GPU acceleration or using Vulkan does not change this.

I removed all CSS and DOM besides the problem elements and the issue persists.

I load the exact same page in Chrome 124 or Electron 29.x and in Chrome it works fine whereas in Electron clicks are entirely ignored.

Although I cannot create a repro (despite having spent hours trying) this issue is plaguing us and has so far burned 4-5 entire workdays. I would be happy to demo it for a member of the Electron team in a web meeting, and I wonder if anyone has any theories as to what could possibly cause such a strange issue?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

I did in fact take a peek at #40887 while triaging this issue and I’m still confident that it didn’t cause this bug. My rationale is that the changes in that PR have almost no effect[^1] on the execution of Electron, only the code we write.

If you don’t mind, let me explain our strategy for upgrading Chromium. Chromium makes around 3000 commits every week (based on a quick commit count & average over 2024 so far). It’s our job on the Upgrades Working Group to ingest that huge amount of code changes into Electron. It’s thousands of people working on Chromium and a handful of folks working on upgrading Electron, so we’re often sprinting to keep pace with Chromium. (I’m working on one of these upgrades right now haha.)

In those thousands of commits, Chromium may (and often does) change its code in ways that are incompatible with the old code, sometimes dramatically so, and we have to figure out how to keep Electron working the same with their new designs and systems. This is why a Chromium upgrade in Electron may also include many changes to Electron code: those changes are necessary to keep Electron working after bumping the Chromium version.

To clarify, I don’t believe this is a Chromium bug right now. Electron heavily uses Chromium, but we have many patches and code on top of Chromium. As explained above, upgrading Chromium in Electron requires making changes to Electron. Thus, a Chromium upgrade can unfortunately create Electron bugs.

We desire that every commit to our release and mainline development branches to be self-contained and always build and pass tests. This gives contributors a solid and reliable base to start working on new changes. I hope the explanation above also shows why we can’t only bump the version of Chromium without breaking other parts of the project and violating that desire.

That said, we do structure our Chromium upgrade PRs in a fashion like you are alluding to: a given commit is self-contained and either only updates the version of Chromium or makes only a specific change in response to a change in Chromium. On top of this, we also bump Chromium in these rolls in daily increments (unless Chromium has given us too much work in a short period, in which case we pause the automatic daily bump). Since Chromium can break things faster than we can fix them, it’s rarely possible to get a working build of Electron until we’ve caught up and ironed out a full upgrade. We try to keep upgrades as small as possible for exactly the reason you point out, but in reality the duration an upgrade covers varies depending on the work required and other circumstances.

I hope it helps to hear I do believe you and I believe that this issue is real. It seems like a very interesting problem to me, but there is unfortunately nothing we can do right now until you or someone else can narrow the problem space down to something we can dive into. Best of luck!

[^1]: Sure, I can come up with potential long-shots like compiler/optimizer bugs and C++ const-based implementation selection differences, but I am confident they all lead to dead ends.

Hello! Thanks for taking the time to report this issue and investigate what change might have caused this behavior. Pinpointing the behavior change to between 29.0.0-alpha.7 and 29.0.0-alpha.8 is super helpful to us. From my experience, the Chromium upgrade in that range is almost definitely the culprit, but that’s about all we know.

Unfortunately, we can’t help resolve this bug without the ability to reproduce & investigate the issue ourselves. ☹️ I know you’ve poured time into trying to create one without much success isolating the issue on its own. I’m marking this issue blocked for right now as part of our process for triaging and prioritizing actionable issues, but if you are able to narrow the issue down to a small, independent bit of code, please do respond and add that information here! Also feel free to add more details as you discover more about this issue.