Bug 264173 - [Content-visibility][repaint] Boxes with "content-visibility: hidden" lingers around
Summary: [Content-visibility][repaint] Boxes with "content-visibility: hidden" lingers...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-03 11:54 PDT by zalan
Modified: 2024-01-27 00:26 PST (History)
6 users (show)

See Also:


Attachments
test case (283 bytes, text/html)
2023-11-03 11:54 PDT, zalan
no flags Details
Alternative test case (no content-visibility used) (340 bytes, text/html)
2024-01-09 13:31 PST, Rob Buis
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2023-11-03 11:54:09 PDT
Created attachment 468475 [details]
test case

this may very well be a containment repaint issue.
Comment 1 Radar WebKit Bug Importer 2023-11-03 11:54:44 PDT
<rdar://problem/117916396>
Comment 2 Rob Buis 2024-01-04 11:22:47 PST
I think this may be not exclusively a content-visibility problem, this triggers lingering content too:

<script>
function runTest() {
container.style.position = "relative";
change_this.style.visibility = "hidden";
};
</script>
<body onclick="runTest()">
PASS if no red box disappears.
<div id=container><div id=change_this style="width: 50px; height: 50px; position: absolute; background-color: red; top: 0px; left: 0px;"></div></div>
</body>

I think this happens when canContainAbsolutelyPositionedObjects was false and becomes true for a container (other than the outer view) and the repaint rect of the absolute positioned element becomes empty due to this, so the repaint due to RenderElement::repaintBeforeStyleChange is incomplete.
Do people know of a similar bug like this (so non content-visibility)?
Comment 3 Rob Buis 2024-01-07 11:46:06 PST
Pull request: https://github.com/WebKit/WebKit/pull/22491
Comment 4 Rob Buis 2024-01-09 13:31:43 PST
Created attachment 469350 [details]
Alternative test case (no content-visibility used)

Shows part of the problem why the original test case has repaint issues.
Comment 5 Rob Buis 2024-01-09 13:34:33 PST
The attached alternative test case (first mentioned in comment 2) is failing on TP 185 and ToT going back to Oct 31 2023 (did not check before that). Surprisingly to me, my official Safari (version 17.2.1 (19617.1.17.11.12)) does not show the repaint issue.
Comment 6 Rob Buis 2024-01-10 04:52:05 PST
Some more data, I went back to June 2023 and the problem with "alternative test case" was still present. I can't go before that since it does not build on Sonoma.

A colleague tried Safari 16.3 and the problem is also there.
Comment 7 Rob Buis 2024-01-11 13:57:01 PST
Cathie tried on Safari Version 15.5 (17613.2.7.1.8), same paint artifact. Seems like this is a quite old repaint problem!
Comment 8 EWS 2024-01-27 00:26:05 PST
Committed 273602@main (b96b33ee6c4c): <https://commits.webkit.org/273602@main>

Reviewed commits have been landed. Closing PR #22491 and removing active labels.