bool Document::HasActiveUnboundedElements() const {It's a little weird to me that a document essentially says "yes" to having unbounded elements if some other document in the same local frame tree has an unbounded element.
Can you remind me where this is actually used?
if (widget) {I feel like you can just nest that in the if
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool Document::HasActiveUnboundedElements() const {It's a little weird to me that a document essentially says "yes" to having unbounded elements if some other document in the same local frame tree has an unbounded element.
Can you remind me where this is actually used?
Yeah, this is one area where a public API will need more thought, e.g. allowing sub-frames to have permission to do this. But currently unbounded elements are one-per-top-level-frame, and that's being more hard-coded with this patch.
`HasActiveUnboundedElements` is used roughly one place right now, here:
That needs to know "is there any unbounded window right now? If so, I need to look for hit test results outside clips".
if (widget) {I feel like you can just nest that in the if
Before I just go do that, you mean like this?
```
if (active && widget) {
widget->IncrementActiveUnboundedElementCount();
} else if (!active && widget) {
widget->DecrementActiveUnboundedElementCount();
}
```
Because if so, I really prefer the existing thing...
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Anything I can do to help with the review here?
unbounded_surface_state_ =Are there issues with supporting multiple simultaneous unbounded elements? Here we overwrite unbounded_surface_state_, but the old one is still active. This can now happen with this patch due to unbounded elements being created from different iframes which have different execution contexts.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Are there issues with supporting multiple simultaneous unbounded elements? Here we overwrite unbounded_surface_state_, but the old one is still active. This can now happen with this patch due to unbounded elements being created from different iframes which have different execution contexts.
Yeah, that's currently possible. It's been on my to-do list to lock down, but I just hadn't gotten to it yet. Because of this comment, I've implemented protections against multiple unbounded elements. See patchset 13+.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
+rakina for content/browser/*
(I would have tagged jonross, but he's ooo for some time.)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
parent_view_->GetWeakPtr(), this));Eventhough the RWHVB owns `UnboundedSurfaceWindowAura`, it can already be destroyed by the sync deletion from `RequestUnboundedSurface` right? Then this is unsafe. Are there IDs that you can use that are not raw ptrs? You can use WeakPtrs I guess but differentiate the case where you pass nullptr from the start vs when the intended unbounded surface is already destroyed.
| Code-Review | +1 |
(pre-LGTM assuming the comment gets addressed)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
Done, but that change cleared your +1's unfortunately.
parent_view_->GetWeakPtr(), this));Mason FreedEventhough the RWHVB owns `UnboundedSurfaceWindowAura`, it can already be destroyed by the sync deletion from `RequestUnboundedSurface` right? Then this is unsafe. Are there IDs that you can use that are not raw ptrs? You can use WeakPtrs I guess but differentiate the case where you pass nullptr from the start vs when the intended unbounded surface is already destroyed.
Done - I switched to WeakPtr. For the one sync delete path, I now just pass the active window's weak pointer, and if it's nullptr, then we just clear the pointer.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
vmpstr@ I'm going to ack these two comments. Still happy to do something about both of them, but I'd like to get this landed, so that'd be via a followup. Hopefully ok! Just let me know.
Mason FreedIt's a little weird to me that a document essentially says "yes" to having unbounded elements if some other document in the same local frame tree has an unbounded element.
Can you remind me where this is actually used?
Yeah, this is one area where a public API will need more thought, e.g. allowing sub-frames to have permission to do this. But currently unbounded elements are one-per-top-level-frame, and that's being more hard-coded with this patch.
`HasActiveUnboundedElements` is used roughly one place right now, here:
That needs to know "is there any unbounded window right now? If so, I need to look for hit test results outside clips".
Acknowledged
Mason FreedI feel like you can just nest that in the if
Before I just go do that, you mean like this?
```
if (active && widget) {
widget->IncrementActiveUnboundedElementCount();
} else if (!active && widget) {
widget->DecrementActiveUnboundedElementCount();
}
```Because if so, I really prefer the existing thing...
Acknowledged
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Unbounded Element: Support unbounded element from iframes
This patch enables the Unbounded Element API to work correctly when the
unbounded element resides inside an iframe. Active unbounded element
tracking is moved from Document (TopDocument) to WebFrameWidgetImpl,
ensuring correct tracking across local subframes within a local root
frame tree. Additionally, GetOrCreateUnboundedSurfaceState is updated
to accept and use the subframe element's execution context instead of
assuming the local root's, and binds Mojo pipes using the subframe's
task runner.
To correctly position the unbounded surface relative to the top-level
viewport, unbounded element bounds are converted to viewport
coordinates during showUnboundedElement() and PrePaintTreeWalk.
Finally, to avoid losing the first submitted frame (which was causing
the newly-added web_test to fail), a forced commit and redraw via
SetNeedsCommitWithForcedRedraw is triggered when allocating a new
surface or updating the local surface ID on the LayerTreeHost.
This patch also adds code to ensure only one unbounded element can
be shown from one top level window. If `showUnboundedElement()` is called while another one is already open, it will be closed first.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |