Closed onsetsu closed 1 year ago
Thanks for reaching out! I see that filter
causes elements to be considered absolutely positioned elements by offsetParent
in addition to the position
property. I just pushed an added check for filter
. Want to see if it works?
Works like a charm. Thanks very much.
"Unsure, where to report this due to many moving parts. I at least know that you are very knowledgeable in this topic."
Browser: Chrome Version 108.0.5359.73 (Offizieller Build) (64-Bit)
I'm using this polyfill (all 3 methods) on a deeply nested element in a recursive manner to walk up the parent chain until a designated parent is found. While walking, we accumulate the offset. I use the result to position another element (an svg path).
While everything works fine, once I set the css property
filter
on any element in the parent chain (or a child of it), it seems to not contribute to offset computation anymore. This results in the following effect:https://user-images.githubusercontent.com/1829825/206774853-55c29135-a384-4256-9efb-69c1fb8b1414.mp4
To reproduce:
out
circle element in the Elements tabdiv
withid=container
filter: invert(1);
My question is if this change in behavior due to the filter property is intentional or not?
According to https://drafts.fxtf.org/filter-effects/#FilterProperty
filter
inserts a containing block, but I'm unsure, if this should affectoffset*
.