diff options
author | bptato <nincsnevem662@gmail.com> | 2024-10-13 19:57:37 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-10-15 02:11:45 +0200 |
commit | e7f61dc70169a72dcdf8b50e135505bdbbfa9217 (patch) | |
tree | efe9662d6d85d6a67703208ddf308d2d75f394f9 /test/layout/inline-block-no-margin-collapsing.html | |
parent | a4c8194e8cd941c374f1cee3a3f93c8d9993c541 (diff) | |
download | chawan-e7f61dc70169a72dcdf8b50e135505bdbbfa9217.tar.gz |
layout: correct `position: absolute' (FINALLY)
This fixes a) resolution of `position: absolute' percentage sizes with an indefinite containing block size (wait what?), and b) positioning of `position: absolute' inner block boxes inside inline boxes. a) is possible because `position: absolute' does not affect its parent's layout. I would love to have a long talk with whoever thought that specifying it like this is a good idea. You know, just because you can... anyways, shockingly enough, this was still the more straightforward part. b) forced me to change the box tree to allow blocks inside inlines, which is ugly, but no big deal. Two questions then remained: 1. *where* to put such boxes, and 2. *how large* these boxes should be; this is hardly obvious since an inline box does not have an unambiguous width or height. Of course the CSS standard, never too eager to fulfill my basic expectations, says nothing about this (other than "it's not defined"). So I first tried to reverse engineer what Gecko does, and after hours of pain and suffering I realized... that it's broken LOL https://bugzilla.mozilla.org/show_bug.cgi?id=489100 Therefore I ended up (partially) copying Blink behavior, which, while equally nonsensical as Gecko (and of course divergent), at least does not change after a partial layout. Thank you LayoutNG for saving my sanity. As for the practical benefits: this fixes the bug where Invidious [video] tags wouldn't show up. Hey, it's something! Still left to-do: `position: absolute' for `display: inline' boxes.
Diffstat (limited to 'test/layout/inline-block-no-margin-collapsing.html')
-rw-r--r-- | test/layout/inline-block-no-margin-collapsing.html | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/layout/inline-block-no-margin-collapsing.html b/test/layout/inline-block-no-margin-collapsing.html new file mode 100644 index 00000000..de41d5a1 --- /dev/null +++ b/test/layout/inline-block-no-margin-collapsing.html @@ -0,0 +1,3 @@ +<div style="display: inline-block; margin-top: 1em"> +<div style="margin-top: 1em"> +test |