Parcourir la source

Add browser list styles, text decorations and border styles

Support disc/circle/square and decimal/alpha/roman list markers, line-through and overline text decorations (including s/strike and u), and solid/dashed/dotted per-side borders in the border shorthand and border-style declarations. Adds ladder 051 and 052.
Johannes Zellner il y a 1 semaine
Parent
commit
dc77f5cbc4

+ 125 - 25
browser.c

@@ -176,7 +176,8 @@ struct lay_run {
 	signed short dy;       /* inline image vertical offset */
 	unsigned short iw, ih;
 	unsigned short w;
-	unsigned char font_px, bold, italic, mono, underline, font_face;
+	unsigned char font_px, bold, italic, mono, underline, strike;
+	unsigned char overline, font_face;
 	unsigned char transform_scale;
 	unsigned char origin_x_kind, origin_y_kind;
 	signed short scale_x, scale_y, rotate_x100;
@@ -392,7 +393,7 @@ static struct hit hits[HIT_MAX];
 static int nhits;
 
 static unsigned short block_h[BR_MAX_NODES];
-static char li_marker[BR_MAX_NODES][6];
+static char li_marker[BR_MAX_NODES][12];
 
 /* one connection object; the browser fetches one resource at a time */
 
@@ -3598,15 +3599,19 @@ static struct br_style base_style(void)
 	for (int i = 0; i < 4; i++) {
 		s.border_c[i] = 0;
 		s.border_w[i] = 0;
+		s.border_s[i] = BR_BORDER_SOLID;
 	}
 	s.font_px = 16;
 	s.bold = 0;
 	s.italic = 0;
 	s.mono = 0;
 	s.underline = 0;
+	s.strike = 0;
+	s.overline = 0;
 	s.align = BR_ALIGN_LEFT;
 	s.display = BR_DISPLAY_BLOCK;
 	s.no_bullet = 0;
+	s.list_style = BR_LIST_AUTO;
 	s.uppercase = 0;
 	s.width_kind = s.max_width_kind = s.min_width_kind = 0;
 	s.height_kind = s.min_height_kind = s.max_height_kind = 0;
@@ -3686,6 +3691,37 @@ static int css_size(unsigned char kind, int val, int base)
 	return -1;
 }
 
+static void draw_border_side(struct ngui *ui, int x, int y, int len,
+			     int thick, int horizontal, unsigned short color,
+			     unsigned char style)
+{
+	int pos;
+
+	if (len <= 0 || thick <= 0)
+		return;
+	if (style != BR_BORDER_DASHED && style != BR_BORDER_DOTTED) {
+		if (horizontal)
+			ngui_fill_rect(ui, (struct ngui_rect){
+				x, y, len, thick}, color);
+		else
+			ngui_fill_rect(ui, (struct ngui_rect){
+				x, y, thick, len}, color);
+		return;
+	}
+	for (pos = 0; pos < len; pos += style == BR_BORDER_DASHED ? 7 : 5) {
+		int seg = len - pos;
+
+		if (seg > (style == BR_BORDER_DASHED ? 4 : 2))
+			seg = style == BR_BORDER_DASHED ? 4 : 2;
+		if (horizontal)
+			ngui_fill_rect(ui, (struct ngui_rect){
+				x + pos, y, seg, thick}, color);
+		else
+			ngui_fill_rect(ui, (struct ngui_rect){
+				x, y + pos, thick, seg}, color);
+	}
+}
+
 static void draw_border_box(struct ngui *ui, struct ngui_rect r,
 			    const struct br_style *st)
 {
@@ -3705,22 +3741,18 @@ static void draw_border_box(struct ngui *ui, struct ngui_rect r,
 		return;
 	}
 	if (top)
-		ngui_fill_rect(ui, (struct ngui_rect){r.x, r.y, r.w, top},
-			       st->border_c[0]);
+		draw_border_side(ui, r.x, r.y, r.w, top, 1,
+				 st->border_c[0], st->border_s[0]);
 	if (bottom)
-		ngui_fill_rect(ui, (struct ngui_rect){r.x,
-						      r.y + r.h - bottom,
-						      r.w, bottom},
-			       st->border_c[2]);
+		draw_border_side(ui, r.x, r.y + r.h - bottom, r.w, bottom, 1,
+				 st->border_c[2], st->border_s[2]);
 	if (left)
-		ngui_fill_rect(ui, (struct ngui_rect){r.x, r.y + top, left,
-						      r.h - top - bottom},
-			       st->border_c[3]);
+		draw_border_side(ui, r.x, r.y + top, r.h - top - bottom,
+				 left, 0, st->border_c[3], st->border_s[3]);
 	if (right)
-		ngui_fill_rect(ui, (struct ngui_rect){r.x + r.w - right,
-						      r.y + top, right,
-						      r.h - top - bottom},
-			       st->border_c[1]);
+		draw_border_side(ui, r.x + r.w - right, r.y + top,
+				 r.h - top - bottom, right, 0,
+				 st->border_c[1], st->border_s[1]);
 }
 
 static void transform_origin(const struct br_style *st, int w, int h,
@@ -4201,6 +4233,17 @@ static void flush_line(struct lay *l)
 						(struct ngui_rect){x,
 						 ry + run_ascent(l->ui, r) + 2,
 						 w, 1}, r->color);
+				if (r->strike)
+					ngui_fill_rect(l->ui,
+						(struct ngui_rect){x,
+						 ry + run_ascent(l->ui, r) -
+						 (r->font_px > 3 ?
+						  r->font_px / 3 : 1),
+						 w, 1}, r->color);
+				if (r->overline)
+					ngui_fill_rect(l->ui,
+						(struct ngui_rect){x, ry,
+						 w, 1}, r->color);
 			}
 			if (r->form || r->href) {
 				if (nhits < HIT_MAX) {
@@ -4295,6 +4338,8 @@ static void add_run(struct lay *l, unsigned short off, unsigned short len,
 		/* A control with its own background is a button, not body copy;
 		 * an inherited link underline would strike through the fill. */
 		r->underline = st->underline && !st->has_bg;
+		r->strike = st->strike && !st->has_bg;
+		r->overline = st->overline && !st->has_bg;
 		r->w = (unsigned short)w;
 		if (r->has_lit)
 			r->w = (unsigned short)run_text_width(
@@ -4675,6 +4720,59 @@ static int list_index(unsigned int parent, unsigned int node)
 	return (int)n + 1;
 }
 
+static void list_roman(char *m, unsigned int *n, int v, int upper,
+		       unsigned int cap)
+{
+	static const int val[] = { 1000, 900, 500, 400, 100, 90,
+				   50, 40, 10, 9, 5, 4, 1 };
+	static const char *lo[] = { "m", "cm", "d", "cd", "c", "xc",
+				    "l", "xl", "x", "ix", "v", "iv", "i" };
+	static const char *up[] = { "M", "CM", "D", "CD", "C", "XC",
+				    "L", "XL", "X", "IX", "V", "IV", "I" };
+	unsigned int i;
+
+	for (i = 0; i < sizeof(val) / sizeof(val[0]); i++) {
+		while (v >= val[i] && *n + 1 < cap) {
+			const char *s = upper ? up[i] : lo[i];
+
+			while (*s && *n + 1 < cap)
+				m[(*n)++] = *s++;
+			v -= val[i];
+		}
+	}
+}
+
+static void list_marker_text(char *m, unsigned int cap, int style, int idx)
+{
+	unsigned int n = 0;
+
+	if (style == BR_LIST_DISC) {
+		m[n++] = '-';
+	} else if (style == BR_LIST_CIRCLE) {
+		m[n++] = 'o';
+	} else if (style == BR_LIST_SQUARE) {
+		m[n++] = '+';
+	} else if (style == BR_LIST_LOWER_ALPHA ||
+		   style == BR_LIST_UPPER_ALPHA) {
+		if (idx >= 1 && idx <= 26)
+			m[n++] = (char)((style == BR_LIST_UPPER_ALPHA ?
+					 'A' : 'a') + idx - 1);
+		else
+			m[n++] = '?';
+		m[n++] = '.';
+	} else if (style == BR_LIST_LOWER_ROMAN ||
+		   style == BR_LIST_UPPER_ROMAN) {
+		list_roman(m, &n, idx, style == BR_LIST_UPPER_ROMAN, cap);
+		if (n + 1 < cap)
+			m[n++] = '.';
+	} else {
+		s_append_dec(m, &n, (unsigned int)idx, cap);
+		if (n + 1 < cap)
+			m[n++] = '.';
+	}
+	m[n] = '\0';
+}
+
 static void add_form_run(struct lay *l, unsigned int node,
 			 const struct br_style *st, unsigned short href)
 {
@@ -5430,17 +5528,18 @@ static void layout_block(struct lay *l, unsigned int node,
 			char *m = li_marker[node];
 			if (!m[0]) {
 				unsigned int parent = doc.nodes[node].parent;
-				if (parent &&
-				    doc.nodes[parent].tag == BR_TAG_OL) {
-					int idx = list_index(parent, node);
-					unsigned int n = 0;
-					s_append_dec(m, &n, (unsigned int)idx, 6);
-					s_append(m, &n, ".", 6);
-				} else {
-					s_copy(m, "-", 6);
-				}
+				int style = st->list_style;
+				int idx = parent ? list_index(parent, node) : 1;
+
+				if (style == BR_LIST_AUTO)
+					style = (parent &&
+						 doc.nodes[parent].tag ==
+						 BR_TAG_OL) ?
+						BR_LIST_DECIMAL : BR_LIST_DISC;
+				list_marker_text(m, sizeof(li_marker[node]),
+						 style, idx);
 			}
-			if (l->draw) {
+			if (l->draw && m[0]) {
 				int mw = (int)ngui_text_width_ui(l->ui, m);
 				ngui_text(l->ui, l->left - mw - 6, l->y, m,
 					  st->color);
@@ -7237,6 +7336,7 @@ static int measure_page(int left, int right)
 		img_h[i] = 0;
 		layout_boxes[i].valid = 0;
 	}
+	memset(li_marker, 0, sizeof(li_marker));
 	l->draw = 0;
 	l->ui = &ui;
 	l->left = left;

+ 111 - 10
browser_html.c

@@ -2313,7 +2313,7 @@ enum {
 	PROP_BG_SIZE_KIND, PROP_BG_SIZE_W, PROP_BG_SIZE_H,
 	PROP_FONT_PX, PROP_FONT_UNIT,
 	PROP_BOLD, PROP_ITALIC, PROP_MONO, PROP_FONT_FACE,
-	PROP_ALIGN, PROP_UNDERLINE,
+	PROP_ALIGN, PROP_UNDERLINE, PROP_STRIKE, PROP_OVERLINE,
 	PROP_DISPLAY, PROP_MT, PROP_MR, PROP_MB, PROP_ML,
 	PROP_PT, PROP_PR, PROP_PB, PROP_PL,
 	PROP_MT_U, PROP_MR_U, PROP_MB_U, PROP_ML_U,
@@ -2321,8 +2321,9 @@ enum {
 	PROP_BORDER_W, PROP_BORDER_COLOR,
 	PROP_BW_T, PROP_BW_R, PROP_BW_B, PROP_BW_L,
 	PROP_BC_T, PROP_BC_R, PROP_BC_B, PROP_BC_L,
+	PROP_BS_T, PROP_BS_R, PROP_BS_B, PROP_BS_L,
 	PROP_RADIUS_TL, PROP_RADIUS_TR, PROP_RADIUS_BR, PROP_RADIUS_BL,
-	PROP_LIST_NONE, PROP_NOWRAP,
+	PROP_LIST_NONE, PROP_LIST_STYLE, PROP_NOWRAP,
 	PROP_WIDTH, PROP_WIDTH_KIND, PROP_MAXW, PROP_MAXW_KIND,
 	PROP_WIDTH_CALC_PCT, PROP_WIDTH_CALC_PX,
 	PROP_MINW, PROP_MINW_KIND, PROP_BOX_SIZING, PROP_ML_AUTO, PROP_MR_AUTO,
@@ -4478,11 +4479,20 @@ static void parse_decls(struct br_doc *d, const char *s,
 				a = BR_ALIGN_RIGHT;
 			decl_add(out, nout, PROP_ALIGN, a, important);
 		} else if (str_eq(prop, "text-decoration")) {
-			int u = 0;
-			if (vend - vstart >= 9 &&
-			    ci_eq_n(s + vstart, "underline", 9))
+			int u = 0, stv = 0, ov = 0;
+
+			if (contains_ci_len(s + vstart, vend - vstart,
+					    "underline"))
 				u = 1;
+			if (contains_ci_len(s + vstart, vend - vstart,
+					    "line-through"))
+				stv = 1;
+			if (contains_ci_len(s + vstart, vend - vstart,
+					    "overline"))
+				ov = 1;
 			decl_add(out, nout, PROP_UNDERLINE, u, important);
+			decl_add(out, nout, PROP_STRIKE, stv, important);
+			decl_add(out, nout, PROP_OVERLINE, ov, important);
 		} else if (str_eq(prop, "text-transform")) {
 			int u = (vend - vstart >= 9 &&
 				 ci_eq_n(s + vstart, "uppercase", 9));
@@ -4961,10 +4971,42 @@ static void parse_decls(struct br_doc *d, const char *s,
 			}
 		} else if (str_eq(prop, "list-style") ||
 			   str_eq(prop, "list-style-type")) {
-			int none = (vend - vstart >= 4 &&
-				    contains_ci_len(s + vstart, vend - vstart,
-						    "none"));
-			decl_add(out, nout, PROP_LIST_NONE, none, important);
+			int ls = BR_LIST_AUTO;
+
+			if (contains_ci_len(s + vstart, vend - vstart,
+					    "none"))
+				ls = BR_LIST_NONE;
+			else if (contains_ci_len(s + vstart, vend - vstart,
+						 "circle"))
+				ls = BR_LIST_CIRCLE;
+			else if (contains_ci_len(s + vstart, vend - vstart,
+						 "square"))
+				ls = BR_LIST_SQUARE;
+			else if (contains_ci_len(s + vstart, vend - vstart,
+						 "lower-alpha") ||
+				 contains_ci_len(s + vstart, vend - vstart,
+						 "lower-latin"))
+				ls = BR_LIST_LOWER_ALPHA;
+			else if (contains_ci_len(s + vstart, vend - vstart,
+						 "upper-alpha") ||
+				 contains_ci_len(s + vstart, vend - vstart,
+						 "upper-latin"))
+				ls = BR_LIST_UPPER_ALPHA;
+			else if (contains_ci_len(s + vstart, vend - vstart,
+						 "lower-roman"))
+				ls = BR_LIST_LOWER_ROMAN;
+			else if (contains_ci_len(s + vstart, vend - vstart,
+						 "upper-roman"))
+				ls = BR_LIST_UPPER_ROMAN;
+			else if (contains_ci_len(s + vstart, vend - vstart,
+						 "decimal"))
+				ls = BR_LIST_DECIMAL;
+			else if (contains_ci_len(s + vstart, vend - vstart,
+						 "disc"))
+				ls = BR_LIST_DISC;
+			decl_add(out, nout, PROP_LIST_NONE,
+				 ls == BR_LIST_NONE, important);
+			decl_add(out, nout, PROP_LIST_STYLE, ls, important);
 		} else if (str_eq(prop, "border-radius") ||
 			   str_eq(prop, "border-top-left-radius") ||
 			   str_eq(prop, "border-top-right-radius") ||
@@ -5165,6 +5207,14 @@ static void parse_decls(struct br_doc *d, const char *s,
 					    (te - ts == 6 &&
 					     ci_eq_n(v + ts, "hidden", 6)))
 						stv = 0;
+					else if (te - ts == 6 &&
+						 ci_eq_n(v + ts,
+							 "dashed", 6))
+						stv = 2;
+					else if (te - ts == 6 &&
+						 ci_eq_n(v + ts,
+							 "dotted", 6))
+						stv = 3;
 					else
 						stv = 1;
 					styles[ns++] = stv;
@@ -5177,17 +5227,29 @@ static void parse_decls(struct br_doc *d, const char *s,
 							decl_add(out, nout,
 								 PROP_BW_T + side,
 								 0, important);
+						else
+							decl_add(out, nout,
+								 PROP_BS_T + side,
+								 styles[0] - 1,
+								 important);
 					} else {
-						for (i = 0; i < 4; i++)
+						for (i = 0; i < 4; i++) {
 							if (!styles[i])
 								decl_add(out, nout,
 									 PROP_BW_T + i,
 									 0,
 									 important);
+							else
+								decl_add(out, nout,
+									 PROP_BS_T + i,
+									 styles[i] - 1,
+									 important);
+						}
 					}
 				}
 			} else {
 				int bw = -1, bc = -1, style_none = 0;
+				int bstyle = -1;
 
 				while (next_token(v, vl, &pos, &ts, &te)) {
 					unsigned short c;
@@ -5198,6 +5260,15 @@ static void parse_decls(struct br_doc *d, const char *s,
 					    (te - ts == 6 &&
 					     ci_eq_n(v + ts, "hidden", 6))) {
 						style_none = 1;
+					} else if (te - ts == 6 &&
+						   ci_eq_n(v + ts, "dashed", 6)) {
+						bstyle = BR_BORDER_DASHED;
+					} else if (te - ts == 6 &&
+						   ci_eq_n(v + ts, "dotted", 6)) {
+						bstyle = BR_BORDER_DOTTED;
+					} else if (te - ts == 5 &&
+						   ci_eq_n(v + ts, "solid", 5)) {
+						bstyle = BR_BORDER_SOLID;
 					} else if (parse_len_token(v + ts,
 								   te - ts, &x)) {
 						bw = x;
@@ -5219,6 +5290,12 @@ static void parse_decls(struct br_doc *d, const char *s,
 						decl_add(out, nout,
 							 PROP_BORDER_COLOR, bc,
 							 important);
+					if (bstyle >= 0)
+						for (i = 0; i < 4; i++)
+							decl_add(out, nout,
+								 PROP_BS_T + i,
+								 bstyle,
+								 important);
 				} else {
 					if (bw >= 0)
 						decl_add(out, nout,
@@ -5228,6 +5305,10 @@ static void parse_decls(struct br_doc *d, const char *s,
 						decl_add(out, nout,
 							 PROP_BC_T + side, bc,
 							 important);
+					if (bstyle >= 0)
+						decl_add(out, nout,
+							 PROP_BS_T + side,
+							 bstyle, important);
 				}
 			}
 		} else if (str_eq(prop, "margin") || str_eq(prop, "padding")) {
@@ -6387,6 +6468,12 @@ static void apply_decl(struct br_style *st, const struct br_decl *dcl)
 	case PROP_UNDERLINE:
 		st->underline = (unsigned char)(dcl->val != 0);
 		break;
+	case PROP_STRIKE:
+		st->strike = (unsigned char)(dcl->val != 0);
+		break;
+	case PROP_OVERLINE:
+		st->overline = (unsigned char)(dcl->val != 0);
+		break;
 	case PROP_DISPLAY:
 		st->display = (unsigned char)dcl->val;
 		st->list_item = 0;
@@ -6451,6 +6538,10 @@ static void apply_decl(struct br_style *st, const struct br_decl *dcl)
 	case PROP_BC_R: set_border_side_c(st, 1, dcl->val); break;
 	case PROP_BC_B: set_border_side_c(st, 2, dcl->val); break;
 	case PROP_BC_L: set_border_side_c(st, 3, dcl->val); break;
+	case PROP_BS_T: st->border_s[0] = (unsigned char)dcl->val; break;
+	case PROP_BS_R: st->border_s[1] = (unsigned char)dcl->val; break;
+	case PROP_BS_B: st->border_s[2] = (unsigned char)dcl->val; break;
+	case PROP_BS_L: st->border_s[3] = (unsigned char)dcl->val; break;
 	case PROP_RADIUS_TL:
 	case PROP_RADIUS_TR:
 	case PROP_RADIUS_BR:
@@ -6461,6 +6552,9 @@ static void apply_decl(struct br_style *st, const struct br_decl *dcl)
 	case PROP_LIST_NONE:
 		st->no_bullet = (unsigned char)(dcl->val != 0);
 		break;
+	case PROP_LIST_STYLE:
+		st->list_style = (unsigned char)dcl->val;
+		break;
 	case PROP_NOWRAP:
 		st->nowrap = (unsigned char)(dcl->val != 0);
 		break;
@@ -6693,6 +6787,7 @@ void br_style_for(struct br_doc *d, unsigned int node,
 	for (i = 0; i < 4; i++) {
 		out->border_w[i] = 0;
 		out->border_c[i] = 0;
+		out->border_s[i] = BR_BORDER_SOLID;
 		out->radius[i] = 0;
 	}
 	out->width = out->max_width = out->min_width = out->height = 0;
@@ -6801,6 +6896,12 @@ void br_style_for(struct br_doc *d, unsigned int node,
 	case BR_TAG_I: case BR_TAG_EM:
 		out->italic = 1;
 		break;
+	case BR_TAG_U:
+		out->underline = 1;
+		break;
+	case BR_TAG_S: case BR_TAG_STRIKE:
+		out->strike = 1;
+		break;
 	case BR_TAG_CODE:
 		out->color = 0x8010;
 		out->mono = 1;

+ 20 - 0
browser_html.h

@@ -62,6 +62,22 @@
 #define BR_ALIGN_CENTER 1
 #define BR_ALIGN_RIGHT  2
 
+/* list-style-type; AUTO follows the parent ul/ol. */
+#define BR_LIST_AUTO        0
+#define BR_LIST_DISC        1
+#define BR_LIST_CIRCLE      2
+#define BR_LIST_SQUARE      3
+#define BR_LIST_DECIMAL     4
+#define BR_LIST_LOWER_ALPHA 5
+#define BR_LIST_UPPER_ALPHA 6
+#define BR_LIST_LOWER_ROMAN 7
+#define BR_LIST_UPPER_ROMAN 8
+#define BR_LIST_NONE        9
+
+#define BR_BORDER_SOLID   0
+#define BR_BORDER_DASHED  1
+#define BR_BORDER_DOTTED  2
+
 enum br_tag {
 	BR_TAG_UNKNOWN = 0,
 	BR_TAG_HTML, BR_TAG_HEAD, BR_TAG_BODY, BR_TAG_TITLE, BR_TAG_STYLE,
@@ -104,6 +120,8 @@ struct br_style {
 	unsigned char mono;
 	unsigned char font_face;    /* 1-based @font-face id, 0 = built-in */
 	unsigned char underline;
+	unsigned char strike;       /* text-decoration: line-through */
+	unsigned char overline;     /* text-decoration: overline */
 	unsigned char align;        /* BR_ALIGN_* */
 	unsigned char display;      /* BR_DISPLAY_* */
 	unsigned char vis_hidden, opacity_hidden, overflow_hidden;
@@ -131,10 +149,12 @@ struct br_style {
 	signed short origin_x, origin_y;
 	unsigned char origin_x_kind, origin_y_kind; /* 0 px, 1 percent */
 	unsigned char no_bullet;    /* list-style: none (inherited) */
+	unsigned char list_style;   /* BR_LIST_* (inherited from ul/ol) */
 	unsigned char list_item;    /* li marker is drawn */
 	unsigned char nowrap;       /* white-space: nowrap (inherited) */
 	unsigned char uppercase;    /* text-transform: uppercase (inherited) */
 	unsigned char border_w[4];  /* top, right, bottom, left */
+	unsigned char border_s[4];  /* BR_BORDER_* per side */
 	/* border-radius in pixels, one entry per corner: TL, TR, BR, BL.
 	 * Percentages are stored as 255 so they clamp to the box half. */
 	unsigned char radius[4];

+ 49 - 0
testdata/browser/compat/051-list-decoration.html

@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>051 list styles and text decoration</title>
+<style>
+  body { background: #ffffff; color: #202020; font-family: sans-serif;
+         margin: 12px; font-size: 18px; }
+  .row { display: flex; gap: 24px; }
+  .row > div { flex-grow: 1; }
+  ul, ol { margin: 0 0 12px 0; padding-left: 28px; }
+  .disc { list-style-type: disc; }
+  .circle { list-style-type: circle; }
+  .square { list-style-type: square; }
+  .none { list-style-type: none; }
+  .alpha { list-style-type: lower-alpha; }
+  .ualpha { list-style-type: upper-alpha; }
+  .roman { list-style-type: lower-roman; }
+  .uroman { list-style-type: upper-roman; }
+  .strike { text-decoration: line-through; }
+  .over { text-decoration: overline; }
+  .both { text-decoration: underline line-through overline; }
+</style>
+</head>
+<body>
+<h1>051 &mdash; list styles and text decoration</h1>
+<div class="row">
+  <div>
+    <ul class="disc"><li>disc one</li><li>disc two</li></ul>
+    <ul class="circle"><li>circle one</li><li>circle two</li></ul>
+    <ul class="square"><li>square one</li><li>square two</li></ul>
+    <ul class="none"><li>no marker one</li><li>no marker two</li></ul>
+  </div>
+  <div>
+    <ol><li>decimal one</li><li>decimal two</li></ol>
+    <ol class="alpha"><li>lower alpha</li><li>lower alpha</li></ol>
+    <ol class="ualpha"><li>upper alpha</li><li>upper alpha</li></ol>
+    <ol class="roman"><li>lower roman</li><li>lower roman</li><li>lower roman</li></ol>
+    <ol class="uroman"><li>upper roman</li><li>upper roman</li><li>upper roman</li></ol>
+  </div>
+</div>
+<p><span class="strike">struck-through text</span> and
+   <span class="over">overlined text</span> and
+   <span class="both">all three lines</span> and <s>the s tag</s>.</p>
+<div style="background: #c8f0c8; color: #000000; padding: 8px; font-size: 18px;">
+  LIST/DECORATION: check the marker shapes and the three lines above.
+</div>
+</body>
+</html>

+ 31 - 0
testdata/browser/compat/052-border-styles.html

@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>052 border styles</title>
+<style>
+  body { background: #ffffff; color: #202020; font-family: sans-serif;
+         margin: 12px; font-size: 18px; }
+  .box { margin: 10px 0; padding: 10px; width: 520px; }
+  .solid { border: 4px solid #202020; }
+  .dashed { border: 4px dashed #b02020; }
+  .dotted { border: 4px dotted #2020b0; }
+  .mixed { border-top: 4px dashed #b02020;
+           border-right: 4px dotted #2020b0;
+           border-bottom: 4px solid #202020;
+           border-left: 8px dashed #208020; }
+  .none { border: 4px solid #202020; border-style: none; }
+</style>
+</head>
+<body>
+<h1>052 &mdash; border styles</h1>
+<div class="box solid">solid border</div>
+<div class="box dashed">dashed border</div>
+<div class="box dotted">dotted border</div>
+<div class="box mixed">mixed per-side styles (dashed / dotted / solid / dashed)</div>
+<div class="box none">border-style: none</div>
+<div style="background: #c8f0c8; color: #000000; padding: 8px; font-size: 18px;">
+  BORDER-STYLES: dashed, dotted and per-side styles must be visible.
+</div>
+</body>
+</html>

+ 1 - 1
testdata/browser/compat/README

@@ -17,7 +17,7 @@ Serve this directory from the host and open it on the board:
   browser http://<host>:8000/            # board
   browser http://10.0.2.2:8000/         # QEMU with -netdev user
 
-Status: 010-050 and 030a pass.  036a needs the POST echo server:
+Status: 010-052 and 030a pass.  036a needs the POST echo server:
 
   python3 testdata/browser/compat/post_server.py
   browser /floppy1/036a.htm      # action is http://10.0.2.2:8765/echo

+ 2 - 0
testdata/browser/compat/index.html

@@ -73,6 +73,8 @@ a { color: #0645ad; }
 <tr><td>048</td><td><a href="048-link-pseudo.html">link pseudo-class</a></td><td><code>a:link</code> colour applies; visited/hover do not stick</td><td class="pass">PASS</td></tr>
 <tr><td>049</td><td><a href="049-table-layout.html">table width and alignment</a></td><td>legacy width attributes, one-column stretch, nested 100%, cell alignment</td><td class="pass">PASS</td></tr>
 <tr><td>050</td><td><a href="050-font-shorthand.html">font shorthand</a></td><td>size with a family token, bold/italic and line-height</td><td class="pass">PASS</td></tr>
+<tr><td>051</td><td><a href="051-list-decoration.html">list styles and text decoration</a></td><td>disc/circle/square/alpha/roman markers, line-through and overline</td><td class="pass">PASS</td></tr>
+<tr><td>052</td><td><a href="052-border-styles.html">border styles</a></td><td>solid, dashed, dotted and per-side borders</td><td class="pass">PASS</td></tr>
 </table>
 </body>
 </html>