Added color support for Horizontal Rules. Federico G. Benavento Reference: /n/sources/patch/applied/libhtml-hr-color Date: Sun Nov 25 01:44:38 CET 2007 Signed-off-by: benavento@gmail.com --- /sys/include/html.h Sun Nov 25 01:42:27 2007 +++ /sys/include/html.h Sun Nov 25 01:42:20 2007 @@ -207,6 +207,7 @@ uchar align; /* alignment spec */ uchar noshade; /* if true, don't shade */ int size; /* size attr (rule height) */ + int color; /* color attr */ Dimen wspec; /* width spec */ }; --- /sys/src/libhtml/build.c Sun Nov 25 01:42:53 2007 +++ /sys/src/libhtml/build.c Sun Nov 25 01:42:38 2007 @@ -283,7 +283,7 @@ static Item* newiformfield(Formfield* ff); static Item* newiimage(Rune* src, Rune* altrep, int align, int width, int height, int hspace, int vspace, int border, int ismap, Map* map); -static Item* newirule(int align, int size, int noshade, Dimen wspec); +static Item* newirule(int align, int size, int noshade, int color, Dimen wspec); static Item* newispacer(int spkind); static Item* newitable(Table* t); static ItemSource* newitemsource(Docinfo* di); @@ -415,6 +415,7 @@ int bramt; int sty; int nosh; + int color; int oldcuranchor; int dfltbd; int v; @@ -1020,7 +1021,8 @@ if(dimenkind(wd) == Dnone) wd = makedimen(Dpercent, 100); nosh = aflagval(tok, Anoshade); - additem(ps, newirule(al, sz, nosh, wd), tok); + color = acolorval(tok, Acolor, 0); + additem(ps, newirule(al, sz, nosh, color, wd), tok); addbrk(ps, 0, 0); break; @@ -3095,7 +3097,7 @@ } static Item* -newirule(int align, int size, int noshade, Dimen wspec) +newirule(int align, int size, int noshade, int color, Dimen wspec) { Irule* r; @@ -3104,6 +3106,7 @@ r->align = align; r->size = size; r->noshade = noshade; + r->color = color; r->wspec = wspec; return (Item*)r; }