22
33#include < karm-text/prose.h>
44#include < vaev-values/display.h>
5+ #include < vaev-values/insets.h>
56#include < vaev-values/keywords.h>
67
78export module Vaev.Layout:inline_;
@@ -72,9 +73,11 @@ struct InlineFormatingContext : FormatingContext {
7273 }
7374 );
7475
75- boxStrutCell.size = atomicBoxOutput.size ;
76- // FIXME: hard-coding alphabetic alignment, missing alignment-baseline and dominant-baseline
77- boxStrutCell.baseline = getUsedBaselineFromBox (atomicBox, atomicBoxOutput).alphabetic ;
76+ if (atomicBox.style ->position != Position::ABSOLUTE) {
77+ boxStrutCell.size = atomicBoxOutput.size ;
78+ // FIXME: hard-coding alphabetic alignment, missing alignment-baseline and dominant-baseline
79+ boxStrutCell.baseline = getUsedBaselineFromBox (atomicBox, atomicBoxOutput).alphabetic ;
80+ }
7881 }
7982
8083 // FIXME: prose has a ongoing state that is not reset between layout calls, but it should be
@@ -89,19 +92,27 @@ struct InlineFormatingContext : FormatingContext {
8992 auto positionInProse = prose->queryPosition (runeIdx);
9093
9194 auto & boxStrutCell = *strutCell->strut ();
95+ auto & atomicBox = *inlineBox.atomicBoxes [boxStrutCell.id ];
9296
93- Math::Vec2<Opt<Au>> knownSize = {
94- boxStrutCell.size .x ,
95- boxStrutCell.size .y
96- };
97+ Math::Vec2<Opt<Au>> knownSize;
98+ if (atomicBox.style ->position != Position::ABSOLUTE) {
99+ knownSize = {
100+ boxStrutCell.size .x ,
101+ boxStrutCell.size .y
102+ };
103+ }
97104
98105 layout (
99106 tree,
100- inlineBox. atomicBoxes [boxStrutCell. id ] ,
107+ atomicBox ,
101108 Input{
102109 .fragment = input.fragment ,
103110 .knownSize = knownSize,
104111 .position = input.position + positionInProse,
112+ .containingBlock = {
113+ input.knownSize .x .unwrapOr (0_au),
114+ input.knownSize .y .unwrapOr (0_au)
115+ },
105116 }
106117 );
107118 }
0 commit comments