summaryrefslogtreecommitdiff
path: root/include/libcss/types.h
diff options
context:
space:
mode:
authorMichael Drake <Michael Drake tlsa@netsurf-browser.org>2019-05-07 13:57:29 +0100
committerMichael Drake <Michael Drake tlsa@netsurf-browser.org>2019-05-07 13:57:29 +0100
commitd09f33131b8079f3886e0827cf458e1fc2c7f2d6 (patch)
tree7fdb8912406b33ba93f7602f86f75fe1af7579f3 /include/libcss/types.h
parenta7830f2452116f57e7880a3f1802c1c3bf1209c9 (diff)
downloadlibcss-d09f33131b8079f3886e0827cf458e1fc2c7f2d6.tar.gz
libcss-d09f33131b8079f3886e0827cf458e1fc2c7f2d6.tar.bz2
Media queries: Feature matching: Compare lengths in pixels.
Clients now provide viewport dimensions in pixels. LibCSS can now convert the units from the stylesheet to pixels. Client must also provide default font size and line height for handling viewport and root element relative sizes.
Diffstat (limited to 'include/libcss/types.h')
-rw-r--r--include/libcss/types.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/libcss/types.h b/include/libcss/types.h
index 44aef12..d8ac494 100644
--- a/include/libcss/types.h
+++ b/include/libcss/types.h
@@ -194,11 +194,6 @@ typedef enum css_media_scripting {
CSS_MEDIA_SCRIPTING_ENABLED = 2
} css_media_scripting;
-typedef struct css_media_length {
- css_fixed value;
- css_unit unit;
-} css_media_length;
-
typedef struct css_media_resolution {
css_fixed value;
css_unit unit;
@@ -211,9 +206,9 @@ typedef struct css_media {
/* Media type */
css_media_type type;
- /* Screen / Device media features */
- css_media_length width;
- css_media_length height;
+ /* Viewport / page media features */
+ css_fixed width; /* In css pixels */
+ css_fixed height; /* In css pixels */
css_fixed aspect_ratio;
css_media_orientation orientation;
@@ -242,6 +237,10 @@ typedef struct css_media {
/* Scripting media features */
css_media_scripting scripting;
+
+ /* Client details for length conversion */
+ css_fixed client_font_size; /* In pt */
+ css_fixed client_line_height; /* In css pixels */
} css_media;
/**