summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-10-02 17:19:17 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2017-10-20 17:46:37 +0100
commitf7f18042bf00b431dbf2c8a93b0a6d7feb44f0d8 (patch)
tree08874b5a59df7f0ed47eb6eabceaad8b8d24ea66 /render
parent7fa4b3624530f6d66d4e862ad5210fd3d94a3bab (diff)
downloadnetsurf-f7f18042bf00b431dbf2c8a93b0a6d7feb44f0d8.tar.gz
netsurf-f7f18042bf00b431dbf2c8a93b0a6d7feb44f0d8.tar.bz2
CSS: Wrappers for computed style getters that return unsupported values.
We don't yet handle the Flexbox-related values for certain properties.
Diffstat (limited to 'render')
-rw-r--r--render/box_construct.c27
-rw-r--r--render/layout.c6
2 files changed, 17 insertions, 16 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index 549d9122f..1982622f9 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -46,6 +46,7 @@
#include "content/content_protected.h"
#include "css/hints.h"
#include "css/select.h"
+#include "css/utils.h"
#include "desktop/gui_internal.h"
#include "render/box.h"
@@ -612,7 +613,7 @@ static void box_construct_generate(dom_node *n, html_content *content,
}
/* create box for this element */
- computed_display = css_computed_display(style, box_is_root(n));
+ computed_display = ns_computed_display(style, box_is_root(n));
if (computed_display == CSS_DISPLAY_BLOCK ||
computed_display == CSS_DISPLAY_TABLE) {
/* currently only support block level boxes */
@@ -625,7 +626,7 @@ static void box_construct_generate(dom_node *n, html_content *content,
}
/* set box type from computed display */
- gen->type = box_map[css_computed_display(
+ gen->type = box_map[ns_computed_display(
style, box_is_root(n))];
box_add_child(box, gen);
@@ -831,11 +832,11 @@ bool box_construct_element(struct box_construct_ctx *ctx,
if ((css_computed_position(box->style) == CSS_POSITION_ABSOLUTE ||
css_computed_position(box->style) ==
CSS_POSITION_FIXED) &&
- (css_computed_display_static(box->style) ==
+ (ns_computed_display_static(box->style) ==
CSS_DISPLAY_INLINE ||
- css_computed_display_static(box->style) ==
+ ns_computed_display_static(box->style) ==
CSS_DISPLAY_INLINE_BLOCK ||
- css_computed_display_static(box->style) ==
+ ns_computed_display_static(box->style) ==
CSS_DISPLAY_INLINE_TABLE)) {
/* Special case for absolute positioning: make absolute inlines
* into inline block so that the boxes are constructed in an
@@ -848,7 +849,7 @@ bool box_construct_element(struct box_construct_ctx *ctx,
box->type = BOX_BLOCK;
} else {
/* Normal mapping */
- box->type = box_map[css_computed_display(box->style,
+ box->type = box_map[ns_computed_display(box->style,
props.node_is_root)];
}
@@ -876,7 +877,7 @@ bool box_construct_element(struct box_construct_ctx *ctx,
box->styles->styles[CSS_PSEUDO_ELEMENT_BEFORE]);
}
- if (box->type == BOX_NONE || (css_computed_display(box->style,
+ if (box->type == BOX_NONE || (ns_computed_display(box->style,
props.node_is_root) == CSS_DISPLAY_NONE &&
props.node_is_root == false)) {
css_select_results_destroy(styles);
@@ -968,7 +969,7 @@ bool box_construct_element(struct box_construct_ctx *ctx,
box_add_child(props.inline_container, box);
} else {
- if (css_computed_display(box->style, props.node_is_root) ==
+ if (ns_computed_display(box->style, props.node_is_root) ==
CSS_DISPLAY_LIST_ITEM) {
/* List item: compute marker */
if (box_construct_marker(box, props.title, ctx,
@@ -1559,7 +1560,7 @@ bool box_image(BOX_SPECIAL_PARAMS)
css_unit wunit = CSS_UNIT_PX;
css_unit hunit = CSS_UNIT_PX;
- if (box->style && css_computed_display(box->style,
+ if (box->style && ns_computed_display(box->style,
box_is_root(n)) == CSS_DISPLAY_NONE)
return true;
@@ -1666,7 +1667,7 @@ bool box_object(BOX_SPECIAL_PARAMS)
dom_node *c;
dom_exception err;
- if (box->style && css_computed_display(box->style,
+ if (box->style && ns_computed_display(box->style,
box_is_root(n)) == CSS_DISPLAY_NONE)
return true;
@@ -2316,7 +2317,7 @@ bool box_iframe(BOX_SPECIAL_PARAMS)
struct content_html_iframe *iframe;
int i;
- if (box->style && css_computed_display(box->style,
+ if (box->style && ns_computed_display(box->style,
box_is_root(n)) == CSS_DISPLAY_NONE)
return true;
@@ -2551,7 +2552,7 @@ bool box_input(BOX_SPECIAL_PARAMS)
corestring_lwc_image)) {
gadget->type = GADGET_IMAGE;
- if (box->style && css_computed_display(box->style,
+ if (box->style && ns_computed_display(box->style,
box_is_root(n)) != CSS_DISPLAY_NONE &&
nsoption_bool(foreground_images) == true) {
dom_string *s;
@@ -2887,7 +2888,7 @@ bool box_embed(BOX_SPECIAL_PARAMS)
dom_string *src;
dom_exception err;
- if (box->style && css_computed_display(box->style,
+ if (box->style && ns_computed_display(box->style,
box_is_root(n)) == CSS_DISPLAY_NONE)
return true;
diff --git a/render/layout.c b/render/layout.c
index 8c3374bcf..7ca688fab 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1110,7 +1110,7 @@ layout_find_dimensions(int available_width,
css_fixed value = 0;
css_unit unit = CSS_UNIT_PX;
- type = css_computed_min_width(style, &value, &unit);
+ type = ns_computed_min_width(style, &value, &unit);
if (type == CSS_MIN_WIDTH_SET) {
if (unit == CSS_UNIT_PCT) {
@@ -1157,7 +1157,7 @@ layout_find_dimensions(int available_width,
css_fixed value = 0;
css_unit unit = CSS_UNIT_PX;
- type = css_computed_min_height(style, &value, &unit);
+ type = ns_computed_min_height(style, &value, &unit);
if (type == CSS_MIN_HEIGHT_SET) {
if (unit == CSS_UNIT_PCT) {
@@ -2395,7 +2395,7 @@ static bool layout_apply_minmax_height(struct box *box, struct box *container)
}
/* min-height */
- if (css_computed_min_height(box->style, &value, &unit) ==
+ if (ns_computed_min_height(box->style, &value, &unit) ==
CSS_MIN_HEIGHT_SET) {
if (unit == CSS_UNIT_PCT) {
if (containing_block &&