### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

18.1.0

### What operating system are you using?

Ubuntu

### Operating System Version

Ubuntu 20.04

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

Offscreen rendering paint events should receive events for SELECT input elements.

### Actual Behavior

Sometimes an empty white box appears, or nothing happens.

### Testcase Gist URL

https://gist.github.com/gtalusan/c0ad56685aeb3b2c1108fbccf6b451b4

### Additional Information

Here's a screenshot when the fiddle is run with `offscreen = false`:

<img width="760" alt="Screen Shot 2022-05-03 at 9 54 42 AM" src="https://user-images.githubusercontent.com/355585/166471227-1e0e27b0-cc8b-4c8e-94e5-a4261e2437b6.png">

Here are the paint event images saved to PNGs when `offscreen = true`:
![0](https://user-images.githubusercontent.com/355585/166471435-209960eb-27e2-47f1-a758-1760a052f3d1.png)
![1](https://user-images.githubusercontent.com/355585/166471445-269fab98-f046-43d4-b72a-65a49c5bc067.png)


shell/browser/osr/osr_render_widget_host_view.cc
compositor_allocator_.GenerateId();
  compositor_surface_id_ = compositor_allocator_.GetCurrentLocalSurfaceId();
  delegated_frame_host_client_ =
      std::make_unique<ElectronDelegatedFrameHostClient>(this);
  delegated_frame_host_ = std::make_unique<content::DelegatedFrameHost>(
      AllocateFrameSinkId(), delegated_frame_host_client_.get(),
      true );
  root_layer_ = std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR);
  bool opaque = SkColorGetA(background_color_) == SK_AlphaOPAQUE;
  GetRootLayer()->SetFillsBoundsOpaquely(opaque);
  GetRootLayer()->SetColor(background_color_);
  ui::ContextFactory* context_factory = content::GetContextFactory();
  compositor_ = std::make_unique<ui::Compositor>(
      context_factory->AllocateFrameSinkId(), context_factory,
      base::ThreadTaskRunnerHandle::Get(), false ,
      false );
  compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
  compositor_->SetDelegate(this);
  compositor_->SetRootLayer(root_layer_.get());
  ResizeRootLayer(false);
  render_widget_host_->SetView(this);
  if (content::GpuDataManager::GetInstance()->HardwareAccelerationEnabled()) {
    video_consumer_ = std::make_unique<OffScreenVideoConsumer>(
        this, base::BindRepeating(&OffScreenRenderWidgetHostView::OnPaint,
                                  weak_ptr_factory_.GetWeakPtr()));
    video_consumer_->SetActive(IsPainting());
    video_consumer_->SetFrameRate(GetFrameRate());
  }
}
OffScreenRenderWidgetHostView::~OffScreenRenderWidgetHostView() {