summaryrefslogtreecommitdiff
path: root/content/handlers
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-11-01 15:45:57 +0000
committerMichael Drake <mdrake.unique@gmail.com>2022-12-14 22:53:35 +0000
commitfbb39f0d49f2606400dcf6bb2fb1d5c56903ddf9 (patch)
tree09bfbf0f00733b59797388beb954df395018ab35 /content/handlers
parentf30f869ea40ad7633ec34903d0f1594c860a32ae (diff)
downloadnetsurf-fbb39f0d49f2606400dcf6bb2fb1d5c56903ddf9.tar.gz
netsurf-fbb39f0d49f2606400dcf6bb2fb1d5c56903ddf9.tar.bz2
html: layout: Helper for whether flex direction is reversed
Diffstat (limited to 'content/handlers')
-rw-r--r--content/handlers/html/layout_internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/content/handlers/html/layout_internal.h b/content/handlers/html/layout_internal.h
index 974f49348..c6eb56d6e 100644
--- a/content/handlers/html/layout_internal.h
+++ b/content/handlers/html/layout_internal.h
@@ -184,6 +184,19 @@ static inline bool lh__flex_main_is_horizontal(const struct box *flex)
}
}
+static inline bool lh__flex_direction_reversed(const struct box *flex)
+{
+ switch (css_computed_flex_direction(flex->style)) {
+ default: /* Fallthrough. */
+ case CSS_FLEX_DIRECTION_ROW_REVERSE: /* Fallthrough. */
+ case CSS_FLEX_DIRECTION_COLUMN_REVERSE:
+ return true;
+ case CSS_FLEX_DIRECTION_ROW: /* Fallthrough. */
+ case CSS_FLEX_DIRECTION_COLUMN:
+ return false;
+ }
+}
+
static inline int lh__non_auto_margin(const struct box *b, enum box_side side)
{
return (b->margin[side] == AUTO) ? 0 : b->margin[side];