mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 07:33:20 +00:00
![]() If there are multiple nested `position: fixed` or `position: absolute` elements that are positioned based on their static position due to not specifying any insets, we sum up all their ancestor offsets to calculate said static position. However, these offsets represent the offset to the containing block. So summing up all the ancestor blocks will count elements multiple times for cases where the containing block is not based on the closest element capable of forming a containing block (i.e. absolute and fixed position elements) when multiple such elements are nested. With this change we only iterate over ancestors forming containing blocks instead of over all ancestors boxes. To sum up everything between the box currently being positioned and its containing block, we start the iteration on the parent box of the current box. This fixes 3 WPT tests that I could find. But these tests are not intended to test the error cases fixed here, they just incidentally rely on the correct behavior. As such, I have added dedicated tests myself. Note that two of the tests already pass on master, but they seemed like a good cases to have anyway. |
||
---|---|---|
.. | ||
AK | ||
ClangPlugins | ||
LibCompress | ||
LibCore | ||
LibCrypto | ||
LibDiff | ||
LibDNS | ||
LibGC | ||
LibGfx | ||
LibJS | ||
LibMedia | ||
LibRegex | ||
LibTest | ||
LibTextCodec | ||
LibThreading | ||
LibTLS | ||
LibUnicode | ||
LibURL | ||
LibWasm | ||
LibWeb | ||
LibWebView | ||
LibXML | ||
Resources | ||
CMakeLists.txt |