Bug 231292

Summary: Ensure that the top layer is always anchored to the RenderView
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: Tim Nguyen (:ntim) <ntim>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cdumez, changseok, commit-queue, esprehn+autocc, ews-watchlist, fred.wang, glenn, gyuyoung.kim, kondapallykalyan, mrobinson, ntim, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=235063
Bug Depends on: 231332, 234984    
Bug Blocks: 84635    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Testcase that fails with top layer reparenting patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch none

Comment 1 zalan 2021-10-06 08:39:00 PDT
Created attachment 440374 [details]
Patch
Comment 2 EWS 2021-10-06 10:55:05 PDT
Committed r283634 (242585@main): <https://commits.webkit.org/242585@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440374 [details].
Comment 3 Radar WebKit Bug Importer 2021-10-06 10:56:17 PDT
<rdar://problem/83941854>
Comment 4 WebKit Commit Bot 2021-10-06 15:24:19 PDT
Re-opened since this is blocked by bug 231332
Comment 5 Tim Nguyen (:ntim) 2021-10-15 13:10:19 PDT
Created attachment 441416 [details]
Patch
Comment 6 Tim Nguyen (:ntim) 2021-10-16 04:47:07 PDT
Created attachment 441487 [details]
Patch
Comment 7 Tim Nguyen (:ntim) 2021-10-18 08:20:42 PDT
Created attachment 441604 [details]
Testcase that fails with top layer reparenting patch
Comment 8 Brent Fulgham 2021-10-25 10:03:36 PDT
This is now being tracked by rdar://84618684.
Comment 9 Tim Nguyen (:ntim) 2021-11-07 10:15:50 PST
Created attachment 443512 [details]
Patch
Comment 10 Tim Nguyen (:ntim) 2021-12-06 09:12:19 PST
Created attachment 446043 [details]
Patch
Comment 11 Tim Nguyen (:ntim) 2021-12-06 09:23:03 PST
Created attachment 446044 [details]
Patch
Comment 12 Tim Nguyen (:ntim) 2021-12-21 13:53:41 PST
Created attachment 447750 [details]
Patch
Comment 13 zalan 2022-01-05 20:18:19 PST
Created attachment 448465 [details]
Patch
Comment 14 Tim Nguyen (:ntim) 2022-01-06 05:44:21 PST
Comment on attachment 448465 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448465&action=review

Thanks for taking another look at this!

> Source/WebCore/rendering/RenderObject.cpp:666
> +    auto containingBlockForRenderer = [](const auto& renderer) -> RenderBlock* {
> +        if (isInTopLayerOrBackdrop(renderer.style(), renderer.element()))
> +            return &renderer.view();
>          if (renderer.isAbsolutelyPositioned())
>              return renderer.containingBlockForAbsolutePosition();
>          if (renderer.isFixedPositioned())

containingBlockForAbsolutePosition/containingBlockForFixedPosition is also used in LogicalSelectionOffsetCaches.cpp / LogicalSelectionOffsetCaches.h

Should we adapt those instead?
Comment 15 zalan 2022-01-06 06:17:45 PST
(In reply to Tim Nguyen (:ntim) from comment #14)
> Comment on attachment 448465 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448465&action=review
> 
> Thanks for taking another look at this!
> 
> > Source/WebCore/rendering/RenderObject.cpp:666
> > +    auto containingBlockForRenderer = [](const auto& renderer) -> RenderBlock* {
> > +        if (isInTopLayerOrBackdrop(renderer.style(), renderer.element()))
> > +            return &renderer.view();
> >          if (renderer.isAbsolutelyPositioned())
> >              return renderer.containingBlockForAbsolutePosition();
> >          if (renderer.isFixedPositioned())
> 
> containingBlockForAbsolutePosition/containingBlockForFixedPosition is also
> used in LogicalSelectionOffsetCaches.cpp / LogicalSelectionOffsetCaches.h
> 
> Should we adapt those instead?
will do a bit of a cleanup there.
Comment 16 EWS 2022-01-06 06:34:35 PST
Committed r287683 (245779@main): <https://commits.webkit.org/245779@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448465 [details].