Summary: | position: sticky with display: inline-block | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Atomkind <maiksweb3> | ||||||
Component: | Layout and Rendering | Assignee: | Martin Robinson <mrobinson> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bfulgham, changseok, dan, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, hartman.wiki, heycam, jianbo.wu, kondapallykalyan, macpherson, menard, mrobinson, pdr, simon.fraser, webkit-bug-importer, zalan | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | Safari 14 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 203450, 228989 | ||||||||
Attachments: |
|
Description
Atomkind
2021-04-11 03:55:32 PDT
some other examples of how it should work (but does not on any browser!): https://jsfiddle.net/m7uxthqg/3/ and how it actually works but there are still some downsides: https://jsfiddle.net/heqbdw9x/ downside 1: Have to add another wrapping element with display: block downside 2: :hover elements, labels, links, ankers - they are not clickable because of the overlapping block-wrapper! Also adjustment: working around with position: fixed would not work because this element need to be sticky, because there is a big footer element where the "to top" should not fly over! Created attachment 435673 [details]
Patch
Comment on attachment 435673 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=435673&action=review > Source/WebCore/rendering/RenderBoxModelObject.cpp:461 > + if (this->isInline() && containingBlock->isAnonymousBlock()) > + containingBlock = containingBlock->containingBlock(); I think it's possible to have multiple containing anonymous blocks so this should do something like nearestNonAnonymousContainingBlockIncludingSelf(). Created attachment 435759 [details]
Patch
Comment on attachment 435759 [details]
Patch
Thanks for the review!
Committed r281185 (240630@main): <https://commits.webkit.org/240630@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 435759 [details]. *** Bug 218330 has been marked as a duplicate of this bug. *** *** Bug 190580 has been marked as a duplicate of this bug. *** *** Bug 209376 has been marked as a duplicate of this bug. *** |