summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-10-29 18:22:19 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2022-10-29 18:22:19 +0100
commit244e4f5dfbd7b2c8ee8c8d2478058a802004be14 (patch)
tree0f0704db0eff1177ad18fb84f8b2840b0654ed7e
parent3b0f34bccc44e8ea81cfad57a5f6a3f50d8917ef (diff)
downloadlibcss-244e4f5dfbd7b2c8ee8c8d2478058a802004be14.tar.gz
libcss-244e4f5dfbd7b2c8ee8c8d2478058a802004be14.tar.bz2
properties: display: Add grid values
-rw-r--r--include/libcss/properties.h4
-rw-r--r--src/bytecode/opcodes.h4
-rw-r--r--src/parse/properties/properties.gen2
-rw-r--r--src/parse/propstrings.c2
-rw-r--r--src/parse/propstrings.h1
-rw-r--r--src/select/computed.c2
-rw-r--r--src/select/properties/display.c6
7 files changed, 18 insertions, 3 deletions
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index ae00551..e056a75 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -440,7 +440,9 @@ enum css_display_e {
CSS_DISPLAY_TABLE_CAPTION = 0x0f,
CSS_DISPLAY_NONE = 0x10,
CSS_DISPLAY_FLEX = 0x11,
- CSS_DISPLAY_INLINE_FLEX = 0x12
+ CSS_DISPLAY_INLINE_FLEX = 0x12,
+ CSS_DISPLAY_GRID = 0x13,
+ CSS_DISPLAY_INLINE_GRID = 0x14
};
enum css_empty_cells_e {
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index 01ea25a..52886b9 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -332,7 +332,9 @@ enum op_display {
DISPLAY_TABLE_CAPTION = 0x000e,
DISPLAY_NONE = 0x000f,
DISPLAY_FLEX = 0x0010,
- DISPLAY_INLINE_FLEX = 0x0011
+ DISPLAY_INLINE_FLEX = 0x0011,
+ DISPLAY_GRID = 0x0012,
+ DISPLAY_INLINE_GRID = 0x0013
};
enum op_elevation {
diff --git a/src/parse/properties/properties.gen b/src/parse/properties/properties.gen
index 4fd8ba0..a001370 100644
--- a/src/parse/properties/properties.gen
+++ b/src/parse/properties/properties.gen
@@ -16,7 +16,7 @@ cue_before:CSS_PROP_CUE_BEFORE IDENT:( INHERIT: INITIAL: REVERT: UNSET: NONE:0,C
direction:CSS_PROP_DIRECTION IDENT:( INHERIT: INITIAL: REVERT: UNSET: LTR:0,DIRECTION_LTR RTL:0,DIRECTION_RTL IDENT:)
-display:CSS_PROP_DISPLAY IDENT:( INHERIT: INITIAL: REVERT: UNSET: INLINE:0,DISPLAY_INLINE BLOCK:0,DISPLAY_BLOCK LIST_ITEM:0,DISPLAY_LIST_ITEM RUN_IN:0,DISPLAY_RUN_IN INLINE_BLOCK:0,DISPLAY_INLINE_BLOCK TABLE:0,DISPLAY_TABLE INLINE_TABLE:0,DISPLAY_INLINE_TABLE TABLE_ROW_GROUP:0,DISPLAY_TABLE_ROW_GROUP TABLE_HEADER_GROUP:0,DISPLAY_TABLE_HEADER_GROUP TABLE_FOOTER_GROUP:0,DISPLAY_TABLE_FOOTER_GROUP TABLE_ROW:0,DISPLAY_TABLE_ROW TABLE_COLUMN_GROUP:0,DISPLAY_TABLE_COLUMN_GROUP TABLE_COLUMN:0,DISPLAY_TABLE_COLUMN TABLE_CELL:0,DISPLAY_TABLE_CELL TABLE_CAPTION:0,DISPLAY_TABLE_CAPTION NONE:0,DISPLAY_NONE FLEX:0,DISPLAY_FLEX INLINE_FLEX:0,DISPLAY_INLINE_FLEX IDENT:)
+display:CSS_PROP_DISPLAY IDENT:( INHERIT: INITIAL: REVERT: UNSET: INLINE:0,DISPLAY_INLINE BLOCK:0,DISPLAY_BLOCK LIST_ITEM:0,DISPLAY_LIST_ITEM RUN_IN:0,DISPLAY_RUN_IN INLINE_BLOCK:0,DISPLAY_INLINE_BLOCK TABLE:0,DISPLAY_TABLE INLINE_TABLE:0,DISPLAY_INLINE_TABLE TABLE_ROW_GROUP:0,DISPLAY_TABLE_ROW_GROUP TABLE_HEADER_GROUP:0,DISPLAY_TABLE_HEADER_GROUP TABLE_FOOTER_GROUP:0,DISPLAY_TABLE_FOOTER_GROUP TABLE_ROW:0,DISPLAY_TABLE_ROW TABLE_COLUMN_GROUP:0,DISPLAY_TABLE_COLUMN_GROUP TABLE_COLUMN:0,DISPLAY_TABLE_COLUMN TABLE_CELL:0,DISPLAY_TABLE_CELL TABLE_CAPTION:0,DISPLAY_TABLE_CAPTION NONE:0,DISPLAY_NONE FLEX:0,DISPLAY_FLEX INLINE_FLEX:0,DISPLAY_INLINE_FLEX GRID:0,DISPLAY_GRID INLINE_GRID:0,DISPLAY_INLINE_GRID IDENT:)
empty_cells:CSS_PROP_EMPTY_CELLS IDENT:( INHERIT: INITIAL: REVERT: UNSET: SHOW:0,EMPTY_CELLS_SHOW HIDE:0,EMPTY_CELLS_HIDE IDENT:)
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index dd579f1..2cac65f 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -486,6 +486,8 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
SMAP("or"),
SMAP("only"),
SMAP("infinite"),
+ SMAP("grid"),
+ SMAP("inline-grid"),
SMAP("aliceblue"),
SMAP("antiquewhite"),
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index df3bcf1..6c84f71 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -109,6 +109,7 @@ enum {
VERTICAL_LR, CONTENT_BOX, BORDER_BOX, STRETCH, INLINE_FLEX, FLEX_START,
FLEX_END, SPACE_BETWEEN, SPACE_AROUND, SPACE_EVENLY, ROW, ROW_REVERSE,
COLUMN_REVERSE, WRAP_STRING, WRAP_REVERSE, AND, OR, ONLY, INFINITE,
+ GRID, INLINE_GRID,
/* Named colours */
FIRST_COLOUR,
diff --git a/src/select/computed.c b/src/select/computed.c
index 89d6efb..c257f17 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -926,6 +926,8 @@ uint8_t css_computed_display(const css_computed_style *style,
return CSS_DISPLAY_TABLE;
} else if (display == CSS_DISPLAY_INLINE_FLEX) {
return CSS_DISPLAY_FLEX;
+ } else if (display == CSS_DISPLAY_INLINE_GRID) {
+ return CSS_DISPLAY_GRID;
} else if (display == CSS_DISPLAY_INLINE ||
display == CSS_DISPLAY_RUN_IN ||
display == CSS_DISPLAY_TABLE_ROW_GROUP ||
diff --git a/src/select/properties/display.c b/src/select/properties/display.c
index bfe0a5f..5455d20 100644
--- a/src/select/properties/display.c
+++ b/src/select/properties/display.c
@@ -77,6 +77,12 @@ css_error css__cascade_display(uint32_t opv, css_style *style,
case DISPLAY_INLINE_FLEX:
value = CSS_DISPLAY_INLINE_FLEX;
break;
+ case DISPLAY_GRID:
+ value = CSS_DISPLAY_GRID;
+ break;
+ case DISPLAY_INLINE_GRID:
+ value = CSS_DISPLAY_INLINE_GRID;
+ break;
}
}