Bug 209376

Summary: Text content not getting updated in sticky element.
Product: WebKit Reporter: jianbo.wu
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: mrobinson, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: All   
OS: All   
Attachments:
Description Flags
Testcase none

Description jianbo.wu 2020-03-20 23:22:11 PDT
When updating HTML content and sticky status at the same time in a macrotask/microtask (e.g. setTimeout or Promise.then), the value shown on the screen seems to be stale value. (still 0)

Code sandbox: https://codesandbox.io/s/focused-solomon-z3i79

To replicate the issue, open this link in Safari: https://z3i79.csb.app/ (a popped out version of the sandbox above)

Observation:

- In other browsers, the text content of that sticky footer should be 1.
- In safari, it's 0, until user scroll to bottom.
Comment 1 Radar WebKit Bug Importer 2020-03-21 18:50:51 PDT
<rdar://problem/60733061>
Comment 2 Simon Fraser (smfr) 2020-03-23 09:44:42 PDT
We're failing to repaint the sticky layer.
Comment 3 Simon Fraser (smfr) 2020-03-23 09:47:41 PDT
Oddly this doesn't happen if https://codesandbox.io/public/sse-hooks/sse-hooks.js is not included, yet this JS isn't necessary for the test.
Comment 4 Simon Fraser (smfr) 2020-03-23 10:08:31 PDT
Actually I can reproduce without the included JS file. It's a bit timing dependent.
Comment 5 Simon Fraser (smfr) 2020-03-23 10:23:14 PDT
Created attachment 394275 [details]
Testcase
Comment 6 Simon Fraser (smfr) 2020-03-23 10:23:34 PDT
The repaint we issue in the sticky layer is offset incorrectly. This testcase shows that sometimes the text half-paints.
Comment 7 Simon Fraser (smfr) 2020-03-23 10:26:16 PDT
And the repaint rect is getting offset by layoutDelta().
Comment 8 Martin Robinson 2021-08-25 04:00:14 PDT
I have confirmed that r281185 fixed this in the repository. This fix should be available for Safari in the future.

*** This bug has been marked as a duplicate of bug 224415 ***