Commit 2be7ac77 authored by Esmael El-Moslimany's avatar Esmael El-Moslimany Committed by Chromium LUCI CQ

WebUI NTP: define rect for initial OneGoogleBar load

Initially the OneGoogleBar iframe is hidden. After the OneGoogleBar is
loaded in the iframe, the iframe sends a 'loaded' message to ntp-app.
ntp-app sets the clip-path style to the #oneGoogleBarClipPath with no
rects defined (no part of the OGB is shown). It's possible to get into
a broken state that stops processing changes to the OneGoogleBar. The
changes seem to be paused until some part of the iframe is showing in
the content area. The changes that pause I think are related to resize.
From my testing, ResizeObserver and window 'resize' callbacks are not
called until some part of the iframe is visible in the content area.
This effect is not limited to clipPath and also includes when the iframe
is scrolled out of view.

This CL introduces an initial rect that will show the OneGoogleBar once
loaded. It is immediately replaced with the rects sent by the iframe's
'overlaysUpdated' message.

Bug: 1164733
Change-Id: I25f4bb4e448777216d78e29c1c7d645eac6f2985
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2621979
Commit-Queue: Esmael Elmoslimany <aee@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Auto-Submit: Esmael Elmoslimany <aee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842265}
parent 8e2208a9
......@@ -361,6 +361,13 @@
<div id="oneGoogleBarOverlayBackdrop"></div>
<svg>
<defs>
<clipPath id="oneGoogleBarClipPath"></clipPath>
<clipPath id="oneGoogleBarClipPath">
<!-- Set an initial non-empty clip-path so the OneGoogleBar resize events
are processed. When the clip-path is empty, it's possible for the
OneGoogleBar to get into a state where it does not send the
'overlayUpdates' message which is used to populate this
clip-path. -->
<rect x="0" y="0" width="1" height="1"></rect>
</clipPath>
</defs>
</svg>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment