File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Userland/Libraries/LibWeb/Layout Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,30 @@ float FlexFormattingContext::specified_cross_size(Box const& box) const
197
197
return is_row_layout () ? box_state.content_height : box_state.content_width ;
198
198
}
199
199
200
+ float FlexFormattingContext::resolved_definite_cross_size (Box const & box) const
201
+ {
202
+ if (is_row_layout ())
203
+ VERIFY (box.has_definite_height ());
204
+ else
205
+ VERIFY (box.has_definite_width ());
206
+ auto const & cross_value = is_row_layout () ? box.computed_values ().height () : box.computed_values ().width ();
207
+ if (cross_value->is_length ())
208
+ return cross_value->length ().to_px (box);
209
+ return cross_value->resolved (box, CSS::Length::make_px (specified_cross_size (flex_container ()))).to_px (box);
210
+ }
211
+
212
+ float FlexFormattingContext::resolved_definite_main_size (Box const & box) const
213
+ {
214
+ if (is_row_layout ())
215
+ VERIFY (box.has_definite_width ());
216
+ else
217
+ VERIFY (box.has_definite_height ());
218
+ auto const & cross_value = is_row_layout () ? box.computed_values ().width () : box.computed_values ().height ();
219
+ if (cross_value->is_length ())
220
+ return cross_value->length ().to_px (box);
221
+ return cross_value->resolved (box, CSS::Length::make_px (specified_main_size (flex_container ()))).to_px (box);
222
+ }
223
+
200
224
bool FlexFormattingContext::has_main_min_size (Box const & box) const
201
225
{
202
226
auto value = is_row_layout () ? box.computed_values ().min_width () : box.computed_values ().min_height ();
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ class FlexFormattingContext final : public FormattingContext {
59
59
bool has_definite_cross_size (Box const &) const ;
60
60
float specified_main_size (Box const &) const ;
61
61
float specified_cross_size (Box const &) const ;
62
+ float resolved_definite_main_size (Box const &) const ;
63
+ float resolved_definite_cross_size (Box const &) const ;
62
64
bool has_main_min_size (Box const &) const ;
63
65
bool has_cross_min_size (Box const &) const ;
64
66
float specified_main_max_size (Box const &) const ;
You can’t perform that action at this time.
0 commit comments