Summary: | position:sticky content is not correctly offset on async scrolled overflow layers with an RTL vertical scrollbar | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Lord <clord> | ||||||
Component: | Compositing | Assignee: | Chris Lord <clord> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | alex, aperez, cgarcia, cmarcelo, darin, ews-watchlist, fred.wang, jamesr, koivisto, luiz, simon.fraser, tonikitoo, webkit-bug-importer, zalan | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 224596 | ||||||||
Attachments: |
|
Description
Chris Lord
2021-05-27 05:55:46 PDT
I believe this does actually affect Mac, but it passes the tests either because async overflow scrolling isn't enabled during testing or because overlay scrollbars are used during testing. Patch incoming. Created attachment 430452 [details]
Patch
Created attachment 430453 [details]
Patch
Comment on attachment 430453 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430453&action=review > Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm:80 > + constrainingRect.move(overflowScrollingNode.scrollDeltaSinceLastCommit()); Seems like we should have operator+ for these types so we could do this as expression rather than a “set to wrong value and then fix with a function call”. (In reply to Darin Adler from comment #4) > Comment on attachment 430453 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=430453&action=review > > > Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm:80 > > + constrainingRect.move(overflowScrollingNode.scrollDeltaSinceLastCommit()); > > Seems like we should have operator+ for these types so we could do this as > expression rather than a “set to wrong value and then fix with a function > call”. I guess the reason there isn't is the behaviour of adding a FloatSize to a FloatRect is pretty ambiguous - in this case, we want to offset the origin, but I think adding the size to the size of the rect would be an equally reasonable thing to expect. There is an operator+ for FloatPoint and FloatSize, so I guess this could be FloatRect(m_constraints.constrainingRectAtLastLayout().location() + overflowScrollingNode.scrollDeltaSinceLastCommit(), m_constraints.constrainingRectAtLastLayout().size()) if we wanted to keep it as a one-liner. (In reply to Chris Lord from comment #5) > I think adding the size to the size of the rect would be an equally > reasonable thing to expect. Interesting point that I hadn’t considered. > There is an operator+ for FloatPoint and FloatSize, so I guess this could be > FloatRect(m_constraints.constrainingRectAtLastLayout().location() + > overflowScrollingNode.scrollDeltaSinceLastCommit(), > m_constraints.constrainingRectAtLastLayout().size()) if we wanted to keep it > as a one-liner. Doesn’t seem better. I tested the patch on macOS, it seems fine. Committed r278429 (238453@main): <https://commits.webkit.org/238453@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430453 [details]. |