summaryrefslogtreecommitdiff
path: root/content/handlers/css
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2019-12-08 13:02:56 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2019-12-22 11:26:45 +0000
commit93bed2cc67ba149801f2dfd1919e92aceed0e323 (patch)
treed8e8662ed760f26b1a44d27e756c3e314e77eaf4 /content/handlers/css
parentfb4f1d28ba4d2b0935ac56a3d37ea9fa52c5de51 (diff)
downloadnetsurf-93bed2cc67ba149801f2dfd1919e92aceed0e323.tar.gz
netsurf-93bed2cc67ba149801f2dfd1919e92aceed0e323.tar.bz2
CSS: Simplify css display to box type conversion.
Diffstat (limited to 'content/handlers/css')
-rw-r--r--content/handlers/css/dump.c8
-rw-r--r--content/handlers/css/utils.h36
2 files changed, 7 insertions, 37 deletions
diff --git a/content/handlers/css/dump.c b/content/handlers/css/dump.c
index b12e1d9e8..3d17b36b1 100644
--- a/content/handlers/css/dump.c
+++ b/content/handlers/css/dump.c
@@ -823,7 +823,7 @@ void nscss_dump_computed_style(FILE *stream, const css_computed_style *style)
}
/* display */
- val = ns_computed_display_static(style);
+ val = css_computed_display_static(style);
switch (val) {
case CSS_DISPLAY_INLINE:
fprintf(stream, "display: inline ");
@@ -873,6 +873,12 @@ void nscss_dump_computed_style(FILE *stream, const css_computed_style *style)
case CSS_DISPLAY_NONE:
fprintf(stream, "display: none ");
break;
+ case CSS_DISPLAY_FLEX:
+ fprintf(stream, "display: flex ");
+ break;
+ case CSS_DISPLAY_INLINE_FLEX:
+ fprintf(stream, "display: inline-flax ");
+ break;
default:
break;
}
diff --git a/content/handlers/css/utils.h b/content/handlers/css/utils.h
index e35a6605b..05ab73882 100644
--- a/content/handlers/css/utils.h
+++ b/content/handlers/css/utils.h
@@ -105,42 +105,6 @@ static inline css_fixed nscss_pixels_physical_to_css(
nscss_screen_dpi);
}
-/**
- * Temporary helper wrappers for for libcss computed style getter, while
- * we don't support flexbox related property values.
- */
-
-static inline uint8_t ns_computed_display(
- const css_computed_style *style, bool root)
-{
- uint8_t value = css_computed_display(style, root);
-
- if (value == CSS_DISPLAY_FLEX) {
- return CSS_DISPLAY_BLOCK;
-
- } else if (value == CSS_DISPLAY_INLINE_FLEX) {
- return CSS_DISPLAY_INLINE_BLOCK;
- }
-
- return value;
-}
-
-
-static inline uint8_t ns_computed_display_static(
- const css_computed_style *style)
-{
- uint8_t value = css_computed_display_static(style);
-
- if (value == CSS_DISPLAY_FLEX) {
- return CSS_DISPLAY_BLOCK;
-
- } else if (value == CSS_DISPLAY_INLINE_FLEX) {
- return CSS_DISPLAY_INLINE_BLOCK;
- }
-
- return value;
-}
-
static inline uint8_t ns_computed_min_height(
const css_computed_style *style,