Bug 244978 - [css-contain] Fix contain-size-monolithic-002.html
Summary: [css-contain] Fix contain-size-monolithic-002.html
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-09-09 07:45 PDT by Rob Buis
Modified: 2022-11-23 15:27 PST (History)
13 users (show)

See Also:


Attachments
Patch (2.25 KB, patch)
2022-09-09 07:50 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (2.21 KB, patch)
2022-09-12 13:17 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (2.34 KB, patch)
2022-09-13 08:50 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (2.38 KB, patch)
2022-09-16 10:13 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (2.44 KB, patch)
2022-09-16 14:54 PDT, Rob Buis
zalan: review+
Details | Formatted Diff | Diff
Screenshot of testcase in bug 238854 (206.50 KB, image/png)
2022-09-16 19:46 PDT, Tim Nguyen (:ntim)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2022-09-09 07:45:55 PDT
Fix contain-size-monolithic-002.html.
Comment 1 Rob Buis 2022-09-09 07:50:57 PDT
Created attachment 462230 [details]
Patch
Comment 2 Tim Nguyen (:ntim) 2022-09-10 20:10:23 PDT
Is this is the same bug as bug 238854?
Comment 3 Tim Nguyen (:ntim) 2022-09-10 20:14:51 PDT
Bug 238854 has a testcase of the bug without CSS containment, so ideally the fix would be fixing that testcase as well.
Comment 4 Tim Nguyen (:ntim) 2022-09-10 20:16:16 PDT
Bug 41796 is related as well.
Comment 5 Rob Buis 2022-09-12 13:17:32 PDT
Created attachment 462295 [details]
Patch
Comment 6 Rob Buis 2022-09-13 08:50:44 PDT
Created attachment 462319 [details]
Patch
Comment 7 Rob Buis 2022-09-13 13:12:10 PDT
(In reply to Tim Nguyen (:ntim) from comment #4)
> Bug 41796 is related as well.

Thanks Tim, I knew about this one but not bug 238854.
Comment 8 Rob Buis 2022-09-13 13:19:14 PDT
@Alan I noticed fragmentedFlowPortionOverflowRect does not include column gap. My patch adds the column gap later on to paginationClip so we include the column gap when clipping for painting columns in RenderLayer and thus fixes contain-size-monolithic-002.html and bug 41796 test case. However I do not know this code very well. In general, do you know how clipping should work for multicol? For example I notice for some reason the bug 238854 test case is not clipped to the total column bounds in chromium, but is in Firefox. I also wonder if out of flow content is clipped at all in multcol.
Comment 9 zalan 2022-09-13 13:42:15 PDT
(In reply to Rob Buis from comment #8)
> @Alan I noticed fragmentedFlowPortionOverflowRect does not include column
> gap. My patch adds the column gap later on to paginationClip so we include
> the column gap when clipping for painting columns in RenderLayer and thus
> fixes contain-size-monolithic-002.html and bug 41796 test case. However I do
> not know this code very well. In general, do you know how clipping should
> work for multicol? 
No, I don't know too much about clipping in general. Maybe Simon?

For example I notice for some reason the bug 238854 test
> case is not clipped to the total column bounds in chromium, but is in
> Firefox. I also wonder if out of flow content is clipped at all in multcol.
Not sure but I'd think it's relatively easy to create a test case to confirm it.
Comment 10 Rob Buis 2022-09-14 03:40:29 PDT
Layer tree without the position: relative:
layer 0x143003400 scrollableArea 0x10504d6c0 at (0,0) size 938x753 (composited [root], bounds=at (0,0) size 938x753, drawsContent=1, paints into ancestor=0)
  RenderView 0x143003120 at (0,0) size 938x753
 positive z-order list (1)
  layer 0x143000b90 scrollableArea 0x10504d940 at (0,0) size 938x58
    RenderBlock 0x143001860 {HTML} at (0,0) size 938x58
      RenderBody 0x143001ad0 {BODY} at (8,16) size 922x34
        RenderBlock 0x143005060 {P} at (0,0) size 922x18
          RenderText 0x1430051a0 {#text} at (0,0) size 274x18
            text run at (0,0) width 274: "Test passes if there is a filled green square."
   normal flow list (1)
    layer 0x1430019a0 at (8,50) size 300x0
      RenderBlock 0x143005230 {DIV} at (0,34) size 300x0 id="multicol"
        RenderMultiColumnSet 0x143005a60 at (0,0) size 300x0
     normal flow list (1)
      layer 0x143005930 at (8,50) size 89x0
        RenderMultiColumnFlowThread 0x143005720 at (0,0) size 90x0
          RenderBlock 0x143005370 {DIV} at (0,0) size 90x0 id="container"
   positive z-order list (1)
    layer 0x1430055f0 at (8,50) size 100x100
      RenderBlock (positioned) 0x1430054b0 {DIV} at (8,50) size 100x100 [bgcolor=#008000] id="abs-size-contain"

with position: relative:
layer 0x135003400 scrollableArea 0x10504f380 at (0,0) size 938x753 (composited [root], bounds=at (0,0) size 938x753, drawsContent=1, paints into ancestor=0)
  RenderView 0x135003120 at (0,0) size 938x753
 positive z-order list (1)
  layer 0x135000b90 scrollableArea 0x10504f600 at (0,0) size 938x158
    RenderBlock 0x135001860 {HTML} at (0,0) size 938x158
      RenderBody 0x135001ad0 {BODY} at (8,16) size 922x134
        RenderBlock 0x135005060 {P} at (0,0) size 922x18
          RenderText 0x1350051a0 {#text} at (0,0) size 274x18
            text run at (0,0) width 274: "Test passes if there is a filled green square."
   normal flow list (1)
    layer 0x1350019a0 at (8,50) size 300x100
      RenderBlock 0x135005230 {DIV} at (0,34) size 300x100 id="multicol"
        RenderMultiColumnSet 0x135005b90 at (0,0) size 300x100
     normal flow list (1)
      layer 0x135005a60 at (8,50) size 89x0
        RenderMultiColumnFlowThread 0x135005850 at (0,0) size 90x0 (layout overflow 0,0 100x100)
   positive z-order list (2)
    layer 0x1350054b0 at (8,50) size 89x0
      RenderBlock (relative positioned) 0x135005370 {DIV} at (0,0) size 90x0 id="container" (layout overflow 0,0 100x100)
    layer 0x135005720 at (8,50) size 100x100
      RenderBlock (positioned) 0x1350055e0 {DIV} at (0,0) size 100x100 [bgcolor=#008000] id="abs-size-contain"
Comment 11 Radar WebKit Bug Importer 2022-09-16 07:46:16 PDT
<rdar://problem/100026789>
Comment 12 Rob Buis 2022-09-16 10:13:12 PDT
Created attachment 462399 [details]
Patch
Comment 13 Rob Buis 2022-09-16 14:54:18 PDT
Created attachment 462407 [details]
Patch
Comment 14 Tim Nguyen (:ntim) 2022-09-16 19:37:31 PDT
The testcase in bug 238854 still doesn't look quite right with the patch applied. The green area looks shorter than other browsers.
Comment 15 Tim Nguyen (:ntim) 2022-09-16 19:46:34 PDT
Created attachment 462412 [details]
Screenshot of testcase in bug 238854

I think we might need to expand beyond the colGap, but to the width of the largest item in the column.
Comment 16 zalan 2022-11-18 13:14:08 PST
Comment on attachment 462407 [details]
Patch

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

> COMMIT_MESSAGE:6
> +Include the column gap when calculating the pagination clip.

This comment is rather redundant.
Comment 17 Rob Buis 2022-11-20 10:50:40 PST
Comment on attachment 462407 [details]
Patch

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

>> COMMIT_MESSAGE:6
>> +Include the column gap when calculating the pagination clip.
> 
> This comment is rather redundant.

Thanks for the review! Unfortunately, now that I look at it again, it is probably not the right fix, as the test case will fail if the div is made wider (it would still be clipped at 100px). I think the real fix is https://bugs.webkit.org/show_bug.cgi?id=238854.
Comment 18 Rob Buis 2022-11-22 13:49:56 PST
Ths is fixed by the bug 238854 fix.