diff options
author | bptato <nincsnevem662@gmail.com> | 2024-12-20 22:56:29 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-12-20 23:43:32 +0100 |
commit | 022a9fb9aa95e9bcace1aa5fd8030425167c8104 (patch) | |
tree | 39631f6e177895bf037072ceabee17d4f01c622c /src | |
parent | 4f0524c199902b5e363b63c8df40e03ecc2e069b (diff) | |
download | chawan-022a9fb9aa95e9bcace1aa5fd8030425167c8104.tar.gz |
cascade: blockify on position: absolute or fixed
Welp, turns out I was overthinking it. CSS does not support inline position: absolute at all, it just blockifies. That does leave us with the question of "why does inline-block behave differently than block?" Especially because both in Gecko and Blink, getComputedStyle for absolute inline-blocks gives me "block", not "inline-block", and yet there is the same difference in rendering when I change the CSS. I first thought it's a quirks mode issue, but standards mode doesn't affect it. Wat.
Diffstat (limited to 'src')
-rw-r--r-- | src/css/cascade.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/css/cascade.nim b/src/css/cascade.nim index 8b0d9574..7fb7734d 100644 --- a/src/css/cascade.nim +++ b/src/css/cascade.nim @@ -270,10 +270,10 @@ func buildComputedValues(rules: CSSValueEntryMap; if not inited[t]: result.initialOrInheritFrom(parent, t) if result{"float"} != FloatNone: - #TODO it may be better to handle this in layout - let display = result{"display"}.blockify() - if display != result{"display"}: - result{"display"} = display + result{"display"} = result{"display"}.blockify() + elif result{"position"} in {PositionAbsolute, PositionFixed} and + result{"display"} == DisplayInline: + result{"display"} = DisplayBlock if (result{"overflow-x"} in {OverflowVisible, OverflowClip}) != (result{"overflow-y"} in {OverflowVisible, OverflowClip}): result{"overflow-x"} = result{"overflow-x"}.bfcify() |