summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--render/box_construct.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index 5a25e6ab8..466d9b5f4 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -29,7 +29,7 @@
#ifdef riscos
#include "netsurf/desktop/gui.h"
#endif
-#define NDEBUG
+//#define NDEBUG
#include "netsurf/utils/log.h"
#include "netsurf/utils/messages.h"
#include "netsurf/utils/talloc.h"
@@ -790,6 +790,50 @@ struct css_style * box_get_style(struct content *c,
}
}
+ if ((strcmp((const char *) n->name, "img") == 0) ||
+ (strcmp((const char *) n->name, "applet") == 0)) {
+ if ((s = (char *) xmlGetProp(n,
+ (const xmlChar *) "hspace"))) {
+ if (!strrchr(s, '%')) { /* % not implemented */
+ int value = atoi(s);
+ if (0 <= value) {
+ style->margin[LEFT].margin =
+ CSS_MARGIN_LENGTH;
+ style->margin[LEFT].value.length.value =
+ value;
+ style->margin[LEFT].value.length.unit =
+ CSS_UNIT_PX;
+ style->margin[RIGHT].margin =
+ CSS_MARGIN_LENGTH;
+ style->margin[RIGHT].value.length.value =
+ value;
+ style->margin[RIGHT].value.length.unit =
+ CSS_UNIT_PX;
+ }
+ }
+ }
+ if ((s = (char *) xmlGetProp(n,
+ (const xmlChar *) "vspace"))) {
+ if (!strrchr(s, '%')) { /* % not implemented */
+ int value = atoi(s);
+ if (0 <= value) {
+ style->margin[TOP].margin =
+ CSS_MARGIN_LENGTH;
+ style->margin[TOP].value.length.value =
+ value;
+ style->margin[TOP].value.length.unit =
+ CSS_UNIT_PX;
+ style->margin[BOTTOM].margin =
+ CSS_MARGIN_LENGTH;
+ style->margin[BOTTOM].value.length.value =
+ value;
+ style->margin[BOTTOM].value.length.unit =
+ CSS_UNIT_PX;
+ }
+ }
+ }
+ }
+
if ((s = (char *) xmlGetProp(n, (const xmlChar *) "style"))) {
struct css_style *astyle;
astyle = css_duplicate_style(&css_empty_style);