Cross Origin iframe and scrolling does not work as expected

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Cross Origin iframe and scrolling does not work as expected

Postby mikew » Wed Jul 26, 2023 9:57 am

When running CEF in OSR mode scrolling of the main document stops when moving the mouse pointer over the x-origin iframe. Does not happen with every x-origin iframe, but i do have 2 cases where this happens.
Following HTML example page will illustrate the issue. This can be reproduced with `cefclient` run in OSR mode as well.
Code: Select all
<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Test iframe</title>

  <style>
    .main {
        display: block;
    }
    iframe {
        background-color: aqua;
    }
  </style>

</head>

<body>
    <div class="main">
      <iframe width="200px" height="1500px" src="https://google.com/" scrolling="yes"></iframe> <!-- will show the issue. Although loading of goole.com is blocked -->
      <!--<iframe width="200px" height="1500px" src="https://openid.net/" scrolling="yes"></iframe>--> <!-- this is a working example of x-origin and scrolling -->
    </div>
</body>
</html>


The site where i faced the issue the first does have a x-origin iframe too, but there the content can be loaded. But the effect is the same as in this example with the blocked google page.

Question is whether i do something wrong when sending the mouse events (wheel scroll for that mather along aside mouse move).

Any help appreciated :)
mikew
Newbie
 
Posts: 4
Joined: Wed Jul 26, 2023 2:27 am

Re: Cross Origin iframe and scrolling does not work as expec

Postby magreenblatt » Wed Jul 26, 2023 12:54 pm

What OS and CEF version?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Cross Origin iframe and scrolling does not work as expec

Postby mikew » Thu Jul 27, 2023 3:05 am

Sorry forgot about the important bits of information :(

OS: unbuntu 18.04LTS
CEF: 115.5790.40
mikew
Newbie
 
Posts: 4
Joined: Wed Jul 26, 2023 2:27 am

Re: Cross Origin iframe and scrolling does not work as expec

Postby magreenblatt » Thu Jul 27, 2023 8:49 am

Possibly related to https://github.com/chromiumembedded/cef/issues/2789. You could try debugging the code mentioned in that issue.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Cross Origin iframe and scrolling does not work as expec

Postby mikew » Thu Aug 24, 2023 3:10 am

So using `--disable-site-isolation-trails` makes it work. Meanwhile i tried to debug as deep as possible but the only difference i could see between a start of a view based cefclient and one with offscreen rendering, when it comes to resolve the event target, is the fact that at some point the view based finally gets the render widget host of the main frame as the target whereas in offscreen rendering it seems the render widget host of the x-origin iframe which prevents scrolling when there's no content or the frame is setup to not have scroll bars, but still is big enough to require a scrollbar on the main frame. However, my understanding of all this is quite limited.
But the fix mentioned in your linked issue does not fix my problem (only the above metioned "workaround")
mikew
Newbie
 
Posts: 4
Joined: Wed Jul 26, 2023 2:27 am

Re: Cross Origin iframe and scrolling does not work as expec

Postby magreenblatt » Thu Aug 24, 2023 8:37 am

at some point the view based finally gets the render widget host of the main frame as the target whereas in offscreen rendering it seems the render widget host of the x-origin iframe which prevents scrolling when there's no content or the frame is setup to not have scroll bars

This sounds like an issue with the routing logic in CefRenderWidgetHostViewOSR::SendMouseWheelEvent. Perhaps we need to modify that logic for x-origin iframes under certain circumstances.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Cross Origin iframe and scrolling does not work as expec

Postby mikew » Wed Aug 30, 2023 6:32 am

Maybe this printf output (that's how i tried/been able to debug), from trying to wheel scroll within the x-origin iframe, helps:
Code: Select all
CefRenderWidgetHostViewOSR::SendMouseWheelEvent()
CefRenderWidgetHostViewOSR::SendMouseWheelEvent(): routing event 0x5585ab8fe470
RenderWidgetHostInputEventRouter::RouteMouseWheelEvent(): root_view = 0x5585ab8fe470
RenderWidgetTargeter::ResolveTargetingRequest(): request_target = 0x5585ab8fe470, request_target_location = 635x543
RenderWidgetHostInputEventRouter::FindMouseWheelEventTarget(): root_view = 0x5585ab8fe470, mouse_locked = 0, event_phase = 00000001
RenderWidgetTargeter::ResolveTargetingRequest(): target = 0x5585ab94f480
FoundTarget: target = 0x5585ab94f480
FoundTarget: isWebInputEventRequest
RenderWidgetHostInputEventRouter::DispatchMouseWheelEvent(): root_view = 0x5585ab8fe470, target = 0x5585ab94f480
RenderWidgetHostInputEventRouter::DispatchMouseWheelEvent(): target_location = (478x543)
RenderWidgetHostViewBase::ProcessMouseWheelEvent(): host = 0x5585abf76910
RenderWidgetHostImpl::ForwardWheelEventWithLatencyInfo: ignor input events 0
MouseWheelEventQueue::TryForwardNextEventToRenderer: 0x5585abf7d028
InputRouterImpl::SendMouseWheelEventImmediately
InputRouterImpl::MouseWheelEventHandled: SET_NON_BLOCKING
RenderWidgetHostViewBase::ProcessMouseWheelEvent(): host = 0x5585ab8d4f70
RenderWidgetHostImpl::ForwardWheelEventWithLatencyInfo: ignor input events 0
MouseWheelEventQueue::TryForwardNextEventToRenderer: 0x5585ab913738
InputRouterImpl::SendMouseWheelEventImmediately
InputRouterImpl::MouseWheelEventHandled: IGNORED
SendMouseEvent: routing event


And to compare with, the same from a view base start of cefclient (where x-origin iframe wheel scrolling works as expected):
Code: Select all
RenderWidgetHostInputEventRouter::RouteMouseWheelEvent(): root_view = 0x558e45ef1060
RenderWidgetTargeter::ResolveTargetingRequest(): request_target = 0x558e45ef1060, request_target_location = 897x554
RenderWidgetHostInputEventRouter::FindMouseWheelEventTarget(): root_view = 0x558e45ef1060, mouse_locked = 0, event_phase = 00000001
RenderWidgetTargeter::ResolveTargetingRequest(): target = 0x558e45a1f770
FoundTarget: target = 0x558e45a1f770
FoundTarget: isWebInputEventRequest
RenderWidgetHostInputEventRouter::DispatchMouseWheelEvent(): root_view = 0x558e45ef1060, target = 0x558e45a1f770
RenderWidgetHostInputEventRouter::DispatchMouseWheelEvent(): target_location = (742x464)
RenderWidgetHostViewBase::ProcessMouseWheelEvent(): host = 0x558e4604fd10
RenderWidgetHostImpl::ForwardWheelEventWithLatencyInfo: ignor input events 0
MouseWheelEventQueue::TryForwardNextEventToRenderer: 0x558e46057068
InputRouterImpl::SendMouseWheelEventImmediately
InputRouterImpl::MouseWheelEventHandled: SET_NON_BLOCKING
RenderWidgetHostInputEventRouter::RouteMouseWheelEvent(): root_view = 0x558e45ef1060
RenderWidgetTargeter::ResolveTargetingRequest(): request_target = 0x558e45ef1060, request_target_location = 897x554
RenderWidgetHostInputEventRouter::FindMouseWheelEventTarget(): root_view = 0x558e45ef1060, mouse_locked = 0, event_phase = 00000008
RenderWidgetTargeter::ResolveTargetingRequest(): target = (nil)
FoundTarget: target = (nil)
FoundTarget: isWebInputEventRequest
RenderWidgetHostInputEventRouter::DispatchMouseWheelEvent(): root_view = 0x558e45ef1060, target = (nil)
RenderWidgetHostInputEventRouter::DispatchMouseWheelEvent(): TransformRootPointToViewCoordSpace = (742x584)
RenderWidgetHostViewBase::ProcessMouseWheelEvent(): host = 0x558e4604fd10
RenderWidgetHostImpl::ForwardWheelEventWithLatencyInfo: ignor input events 0
MouseWheelEventQueue::TryForwardNextEventToRenderer: 0x558e46057068
InputRouterImpl::SendMouseWheelEventImmediately
InputRouterImpl::MouseWheelEventHandled: IGNORED
mikew
Newbie
 
Posts: 4
Joined: Wed Jul 26, 2023 2:27 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 219 guests