view->LayoutViewport()->DidUpdateVisualViewport();This doesn't fit with the function name, but also in PaintLayerScrollableArea::ShouldSupplyScrollbarsForVisualViewport you return false if it's not the root frame layout viewport. As such, couldn't we update RootFrameViewport::DidUpdateVisualViewport (called on 1133) to notify its layout_viewport_?
UpdateScrollbarProportions();Don't we need to update the proportions when the zoom changes and we early return on line 2842 because we already have scrollbars?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
view->LayoutViewport()->DidUpdateVisualViewport();This doesn't fit with the function name, but also in PaintLayerScrollableArea::ShouldSupplyScrollbarsForVisualViewport you return false if it's not the root frame layout viewport. As such, couldn't we update RootFrameViewport::DidUpdateVisualViewport (called on 1133) to notify its layout_viewport_?
Good idea. Done.
One thing is that the return type of `RootFrameViewport::LayoutViewport()` is ScrollableArea even though its actual type is always PaintLayerScrollableArea.
I made `DidUpdateVisualViewport()` a virtual member of ScrollableArea and override it in RootFrameViewport and PaintLayerScrollableArea.
Another possible option is to modify RootFrameViewport to own PaintLayerScrollableArea instead of ScrollableArea as its member variable.
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/root_frame_viewport.h;drc=352511eefac2ec35f01db21d5cae2048c9e112ec;l=214
Please let me know if you prefer the latter idea or any other approach.
Don't we need to update the proportions when the zoom changes and we early return on line 2842 because we already have scrollbars?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
view->LayoutViewport()->DidUpdateVisualViewport();Ryo HashimotoThis doesn't fit with the function name, but also in PaintLayerScrollableArea::ShouldSupplyScrollbarsForVisualViewport you return false if it's not the root frame layout viewport. As such, couldn't we update RootFrameViewport::DidUpdateVisualViewport (called on 1133) to notify its layout_viewport_?
Good idea. Done.
One thing is that the return type of `RootFrameViewport::LayoutViewport()` is ScrollableArea even though its actual type is always PaintLayerScrollableArea.
I made `DidUpdateVisualViewport()` a virtual member of ScrollableArea and override it in RootFrameViewport and PaintLayerScrollableArea.Another possible option is to modify RootFrameViewport to own PaintLayerScrollableArea instead of ScrollableArea as its member variable.
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/root_frame_viewport.h;drc=352511eefac2ec35f01db21d5cae2048c9e112ec;l=214Please let me know if you prefer the latter idea or any other approach.
I guess the only thing I'm confused about is why we still need an additional call to DidUpdateVisualViewport() here, when we already have one on 1133? Isn't this effectively calling it twice?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
view->LayoutViewport()->DidUpdateVisualViewport();Ryo HashimotoThis doesn't fit with the function name, but also in PaintLayerScrollableArea::ShouldSupplyScrollbarsForVisualViewport you return false if it's not the root frame layout viewport. As such, couldn't we update RootFrameViewport::DidUpdateVisualViewport (called on 1133) to notify its layout_viewport_?
Robert FlackGood idea. Done.
One thing is that the return type of `RootFrameViewport::LayoutViewport()` is ScrollableArea even though its actual type is always PaintLayerScrollableArea.
I made `DidUpdateVisualViewport()` a virtual member of ScrollableArea and override it in RootFrameViewport and PaintLayerScrollableArea.Another possible option is to modify RootFrameViewport to own PaintLayerScrollableArea instead of ScrollableArea as its member variable.
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/root_frame_viewport.h;drc=352511eefac2ec35f01db21d5cae2048c9e112ec;l=214Please let me know if you prefer the latter idea or any other approach.
I guess the only thing I'm confused about is why we still need an additional call to DidUpdateVisualViewport() here, when we already have one on 1133? Isn't this effectively calling it twice?
My bad. I forgot to remove this call. Now in the latest patch set, visual_viewport.cc is not changed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
return visual_viewport.IsActiveViewport() && visual_viewport.Scale() > 1;Is scale > 1 the correct check? What happens if the mobile viewport sets the initial scale greater than 1? E.g. https://output.jsbin.com/qawuyab
What about if the virtual keyboard is showing resulting in the visual viewport now being scrollable without a scale change? E.g. https://output.jsbin.com/mimefaj
If you look at https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/visual_viewport.cc;l=836;drc=f4b1a5f91e14941349a0319b35f71d3efb7350af;bpv=1;bpt=1 that seems to suggest how we could determine whether the visual viewport is currently scrollable.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
PTAL
Made the following three changes:
return visual_viewport.IsActiveViewport() && visual_viewport.Scale() > 1;Is scale > 1 the correct check? What happens if the mobile viewport sets the initial scale greater than 1? E.g. https://output.jsbin.com/qawuyab
What about if the virtual keyboard is showing resulting in the visual viewport now being scrollable without a scale change? E.g. https://output.jsbin.com/mimefaj
If you look at https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/visual_viewport.cc;l=836;drc=f4b1a5f91e14941349a0319b35f71d3efb7350af;bpv=1;bpt=1 that seems to suggest how we could determine whether the visual viewport is currently scrollable.
Thanks that's a good point.
Updated the function to check if the visual viewport is actually scrollable.
| 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. |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
blink: Update scrollbar existence after pinch-zoom
Enable scrollbars when the visual viewport is scrollable, and non-custom overlay scrollbar is used.
BUG=459997344
| 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. |