dillo
3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java). Fossies Dox: dillo-3.0.5.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file. 135 if (bw->num_page_bugs)
138 "HTML warning: line %d, ",
139 getCurrLineNumber());
140 va_start(argp, format);
151 const char *url_str,
const char *base_url,
160 const char *suffix = (n_ic) > 1 ?
"s" :
"";
162 if (n_ic == n_ic_spc) {
163 BUG_MSG(
"URL has %d illegal space%s ('%s').", n_ic, suffix, url_str);
164 }
else if (n_ic_spc == 0) {
165 BUG_MSG(
"URL has %d illegal byte%s in {00-1F, 7F-FF} range ('%s').",
166 n_ic, suffix, url_str);
168 BUG_MSG(
"URL has %d illegal byte%s: " 169 "%d space%s and %d in {00-1F, 7F-FF} range ('%s').",
171 n_ic_spc, n_ic_spc > 1 ?
"s" :
"", n_ic-n_ic_spc, url_str);
188 return (
void*)html->
dw;
211 for (
int i = 0; i < html->
forms->
size(); i++) {
212 if (html->
forms->
get(i) == v_form) {
266 snprintf(data, 64,
"?%d,%d", x, y);
279 html->
links->
set(nl, (*url) ? *url : NULL);
295 BUG_MSG(
"The align attribute is obsolete in HTML5.");
310 if (charattr[0] == 0)
315 style_attrs.textAlignChar =
' ';
317 style_attrs.textAlignChar = charattr[0];
320 style_attrs.textAlignChar =
'.';
339 BUG_MSG(
"The valign attribute is obsolete in HTML5.");
366 HT2TB(html)->addWidget (textblock, html->
style ());
368 S_TOP(html)->textblock = html->
dw = textblock;
369 S_TOP(html)->hand_over_break =
true;
376 const char *content_type)
385 linkReceiver.html =
this;
386 HT2LT(
this)->connectLink (&linkReceiver);
394 _MSG(
"DilloHtml(): content type: %s\n", content_type);
395 this->content_type =
dStrdup(content_type);
402 CurrOfs = OldOfs = 0;
406 DocTypeVersion = 0.0f;
417 stack->getRef(0)->cell_text_align_set =
false;
418 stack->getRef(0)->display_none =
false;
420 stack->getRef(0)->list_number = 0;
421 stack->getRef(0)->tag_idx = -1;
422 stack->getRef(0)->textblock = NULL;
423 stack->getRef(0)->table = NULL;
424 stack->getRef(0)->ref_list_item = NULL;
425 stack->getRef(0)->hand_over_break =
false;
433 PreFirstChar =
false;
435 InVisitedLink =
false;
438 loadCssFromStash =
false;
440 Num_HTML = Num_HEAD = Num_BODY = Num_TITLE = 0;
444 non_css_link_color = -1;
445 non_css_visited_color = -1;
470 bw->num_page_bugs = 0;
479 _MSG(
"::~DilloHtml(this=%p)\n",
this);
488 for (
int i = 0; i < cssUrls->size(); i++)
492 for (
int i = 0; i < forms->size(); i++)
496 for (
int i = 0; i < inputs_outside_form->size(); i++)
498 delete(inputs_outside_form);
500 for (
int i = 0; i < links->size(); i++)
504 for (
int i = 0; i < images->size(); i++) {
522 char *buf = Buf + Start_Ofs;
523 int bufsize = BufSize - Start_Ofs;
525 _MSG(
"DilloHtml::write BufSize=%d Start_Ofs=%d\n", BufSize, Start_Ofs);
539 Start_Ofs += token_start;
549 const char *p = Start_Buf;
557 for (i = OldOfs; i < ofs; ++i)
558 if (p[i] ==
'\n' || (p[i] ==
'\r' && p[i+1] !=
'\n'))
592 while ((si = stack->size() - 1)) {
593 if (stack->getRef(si)->tag_idx != -1) {
612 bool enabled = bw->NumPendingStyleSheets == 0;
614 enc, charset, enabled);
615 int nf = forms->size ();
617 forms->set (nf, form);
618 _MSG(
"Html formNew: action=%s nform=%d\n", action, nf);
619 return forms->size();
627 return forms->get (forms->size() - 1);
632 for (
int i = 0; i < images->size(); i++) {
633 if (images->get(i)->image != NULL) {
654 const DilloUrl *requester = pattern ? NULL : this->page_url;
656 for (
int i = 0; i < images->size(); i++) {
676 int nu = cssUrls->size();
688 _MSG(
" Link LEAVE notify...\n");
691 _MSG(
" Link ENTER notify...\n");
714 linkurl = html->links->get(link);
715 const bool_t loaded_img = (html->images->get(img)->image == NULL);
717 html->page_url, linkurl);
740 if ((img != -1) && (html->images->get(img)->image)) {
744 DilloUrl *pattern = html->images->get(img)->url;
745 html->loadImages(pattern);
751 DilloUrl *url = html->links->get(link);
758 }
else if (event->
button == 2) {
771 _MSG(
" ->%s\n", w->getClassName());
773 ((
Textblock*)w)->changeLinkColor (link, html->visited_color);
799 {
"AElig",0306}, {
"Aacute",0301}, {
"Acirc",0302}, {
"Agrave",0300},
800 {
"Alpha",01621},{
"Aring",0305}, {
"Atilde",0303}, {
"Auml",0304},
801 {
"Beta",01622}, {
"Ccedil",0307}, {
"Chi",01647}, {
"Dagger",020041},
802 {
"Delta",01624},{
"ETH",0320}, {
"Eacute",0311}, {
"Ecirc",0312},
803 {
"Egrave",0310},{
"Epsilon",01625},{
"Eta",01627}, {
"Euml",0313},
804 {
"Gamma",01623},{
"Iacute",0315}, {
"Icirc",0316}, {
"Igrave",0314},
805 {
"Iota",01631}, {
"Iuml",0317}, {
"Kappa",01632}, {
"Lambda",01633},
806 {
"Mu",01634}, {
"Ntilde",0321}, {
"Nu",01635}, {
"OElig",0522},
807 {
"Oacute",0323},{
"Ocirc",0324}, {
"Ograve",0322}, {
"Omega",01651},
808 {
"Omicron",01637},{
"Oslash",0330},{
"Otilde",0325},{
"Ouml",0326},
809 {
"Phi",01646}, {
"Pi",01640}, {
"Prime",020063},{
"Psi",01650},
810 {
"Rho",01641}, {
"Scaron",0540}, {
"Sigma",01643}, {
"THORN",0336},
811 {
"Tau",01644}, {
"Theta",01630}, {
"Uacute",0332}, {
"Ucirc",0333},
812 {
"Ugrave",0331},{
"Upsilon",01645},{
"Uuml",0334}, {
"Xi",01636},
813 {
"Yacute",0335},{
"Yuml",0570}, {
"Zeta",01626}, {
"aacute",0341},
814 {
"acirc",0342}, {
"acute",0264}, {
"aelig",0346}, {
"agrave",0340},
815 {
"alefsym",020465},{
"alpha",01661},{
"amp",38}, {
"and",021047},
816 {
"ang",021040}, {
"aring",0345}, {
"asymp",021110},{
"atilde",0343},
817 {
"auml",0344}, {
"bdquo",020036},{
"beta",01662}, {
"brvbar",0246},
818 {
"bull",020042},{
"cap",021051}, {
"ccedil",0347}, {
"cedil",0270},
819 {
"cent",0242}, {
"chi",01707}, {
"circ",01306}, {
"clubs",023143},
820 {
"cong",021105},{
"copy",0251}, {
"crarr",020665},{
"cup",021052},
821 {
"curren",0244},{
"dArr",020723}, {
"dagger",020040},{
"darr",020623},
822 {
"deg",0260}, {
"delta",01664}, {
"diams",023146},{
"divide",0367},
823 {
"eacute",0351},{
"ecirc",0352}, {
"egrave",0350}, {
"empty",021005},
824 {
"emsp",020003},{
"ensp",020002}, {
"epsilon",01665},{
"equiv",021141},
825 {
"eta",01667}, {
"eth",0360}, {
"euml",0353}, {
"euro",020254},
826 {
"exist",021003},{
"fnof",0622}, {
"forall",021000},{
"frac12",0275},
827 {
"frac14",0274},{
"frac34",0276}, {
"frasl",020104},{
"gamma",01663},
828 {
"ge",021145}, {
"gt",62}, {
"hArr",020724}, {
"harr",020624},
829 {
"hearts",023145},{
"hellip",020046},{
"iacute",0355},{
"icirc",0356},
830 {
"iexcl",0241}, {
"igrave",0354}, {
"image",020421},{
"infin",021036},
831 {
"int",021053}, {
"iota",01671}, {
"iquest",0277}, {
"isin",021010},
832 {
"iuml",0357}, {
"kappa",01672}, {
"lArr",020720}, {
"lambda",01673},
833 {
"lang",021451},{
"laquo",0253}, {
"larr",020620}, {
"lceil",021410},
834 {
"ldquo",020034},{
"le",021144}, {
"lfloor",021412},{
"lowast",021027},
835 {
"loz",022712}, {
"lrm",020016}, {
"lsaquo",020071},{
"lsquo",020030},
836 {
"lt",60}, {
"macr",0257}, {
"mdash",020024},{
"micro",0265},
837 {
"middot",0267},{
"minus",021022},{
"mu",01674}, {
"nabla",021007},
838 {
"nbsp",0240}, {
"ndash",020023},{
"ne",021140}, {
"ni",021013},
839 {
"not",0254}, {
"notin",021011},{
"nsub",021204}, {
"ntilde",0361},
840 {
"nu",01675}, {
"oacute",0363}, {
"ocirc",0364}, {
"oelig",0523},
841 {
"ograve",0362},{
"oline",020076},{
"omega",01711}, {
"omicron",01677},
842 {
"oplus",021225},{
"or",021050}, {
"ordf",0252}, {
"ordm",0272},
843 {
"oslash",0370},{
"otilde",0365}, {
"otimes",021227},{
"ouml",0366},
844 {
"para",0266}, {
"part",021002}, {
"permil",020060},{
"perp",021245},
845 {
"phi",01706}, {
"pi",01700}, {
"piv",01726}, {
"plusmn",0261},
846 {
"pound",0243}, {
"prime",020062},{
"prod",021017}, {
"prop",021035},
847 {
"psi",01710}, {
"quot",34}, {
"rArr",020722}, {
"radic",021032},
848 {
"rang",021452},{
"raquo",0273}, {
"rarr",020622}, {
"rceil",021411},
849 {
"rdquo",020035},{
"real",020434},{
"reg",0256}, {
"rfloor",021413},
850 {
"rho",01701}, {
"rlm",020017}, {
"rsaquo",020072},{
"rsquo",020031},
851 {
"sbquo",020032},{
"scaron",0541},{
"sdot",021305}, {
"sect",0247},
852 {
"shy",0255}, {
"sigma",01703}, {
"sigmaf",01702},{
"sim",021074},
853 {
"spades",023140},{
"sub",021202},{
"sube",021206}, {
"sum",021021},
854 {
"sup",021203}, {
"sup1",0271}, {
"sup2",0262}, {
"sup3",0263},
855 {
"supe",021207},{
"szlig",0337}, {
"tau",01704}, {
"there4",021064},
856 {
"theta",01670},{
"thetasym",01721},{
"thinsp",020011},{
"thorn",0376},
857 {
"tilde",01334},{
"times",0327}, {
"trade",020442},{
"uArr",020721},
858 {
"uacute",0372},{
"uarr",020621}, {
"ucirc",0373}, {
"ugrave",0371},
859 {
"uml",0250}, {
"upsih",01722}, {
"upsilon",01705},{
"uuml",0374},
860 {
"weierp",020430},{
"xi",01676}, {
"yacute",0375}, {
"yen",0245},
861 {
"yuml",0377}, {
"zeta",01666}, {
"zwj",020015}, {
"zwnj",020014}
870 return strcmp(((
Ent_t *)a)->entity, ((
Ent_t *)b)->entity);
899 case 146: ret =
'\'';
break;
901 case 148: ret =
'"';
break;
902 case 149: ret = 176;
break;
904 case 151: ret =
'-';
break;
905 default: ret = isocode;
break;
919 int toksize,
int *entsize)
932 if (*++s ==
'x' || *s ==
'X') {
933 if (isxdigit(*++s)) {
935 if (*s ==
'0' && s[1] ==
'x') {
939 isocode = strtol(s, &s, 16);
942 }
else if (isdigit(*s)) {
943 isocode = strtol(s, &s, 10);
946 if (!isocode || errno || isocode > 0xffff) {
948 BUG_MSG(
"Numeric character reference \"%s\" out of range.", tok);
956 BUG_MSG(
"Numeric character reference without trailing ';'.");
959 }
else if (isalpha(*s)) {
961 while (*++s && (isalnum(*s) || strchr(
":_.-", *s))) ;
973 BUG_MSG(
"Undefined character entity '%s'.", tok);
980 BUG_MSG(
"Character entity reference without trailing ';'.");
986 if (isocode >= 145 && isocode <= 151) {
1001 const char *esc_set =
"&";
1002 char *new_str, buf[4];
1003 int i, j, k, n, s, isocode, entsize;
1005 new_str =
dStrndup(token, toksize);
1006 s = strcspn(new_str, esc_set);
1007 if (new_str[s] == 0)
1010 for (i = j = s; i < toksize; i++) {
1011 if (token[i] ==
'&' &&
1013 toksize-i, &entsize)) >= 0) {
1014 if (isocode >= 128) {
1017 for (k = 0; k < n; ++k)
1018 new_str[j++] = buf[k];
1020 new_str[j++] = (char) isocode;
1024 new_str[j++] = token[i];
1038 int i, breakCnt = 0;
1040 for (i = 0; i < spacesize; i++) {
1042 if (space[i] ==
'\r' || (space[i] ==
'\n' && !html->
PrevWasCR)) {
1049 if (breakCnt == 0) {
1064 if (
S_TOP(html)->display_none) {
1076 for (i = 0; i < spacesize; i++) {
1079 (space[i] ==
'\r' || (space[i] ==
'\n' && !html->
PrevWasCR))) {
1099 BUG_MSG(
"TAB character inside <pre>.");
1149 if (
S_TOP(html)->display_none)
1174 for (start = i = 0; Pword[i]; start = i)
1175 if (isspace(Pword[i])) {
1176 while (Pword[++i] && isspace(Pword[i])) ;
1179 while (Pword[++i] && !isspace(Pword[i])) ;
1180 HT2TB(html)->addText(Pword + start, i - start, html->
wordStyle ());
1187 const char *word2, *beyond_word2;
1190 if (!memchr(word,
'&', size)) {
1193 beyond_word2 = word + size;
1198 for (i = j = 0; (Pword[i] = Pword[j]); ++i, ++j) {
1199 if (strchr(
" \t\f\n\r", Pword[i])) {
1200 if (i == 0 || (i > 0 && Pword[i-1] !=
' '))
1203 for (--i; Pword[j+1] && strchr(
" \t\f\n\r", Pword[j+1]); ++j)
1208 beyond_word2 = word2 + strlen(word2);
1210 for (start = i = 0; word2[i]; start = i) {
1213 if (isspace(word2[i])) {
1214 while (word2[++i] && isspace(word2[i])) ;
1221 HT2TB(html)->addText(word2 + start, i - start, html->
wordStyle ());
1226 }
while (word2[i] && !isspace(word2[i]) &&
1229 HT2TB(html)->addText(word2 + start, i - start, html->
wordStyle ());
1245 for (i = 0; i < tagsize && tagstr[i] !=
'\0'; i++) {
1250 if (i < tagsize && (isspace(tag[i]) || tag[i] ==
'>' || tag[i] ==
'/'))
1261 if (html->
dw !=
S_TOP(html)->textblock) {
1262 if (hand_over_break)
1264 HT2TB(html)->flush ();
1265 html->
dw =
S_TOP(html)->textblock;
1282 html->
dw =
S_TOP(html)->textblock;
1300 bool hand_over_break;
1303 hand_over_break =
S_TOP(html)->hand_over_break;
1314 while ((s_sz = html->
stack->
size()) > idx) {
1315 int toptag_idx =
S_TOP(html)->tag_idx;
1317 if (s_sz > idx + 1 && toptag.
EndTag !=
'O')
1318 BUG_MSG(
" - forcing close of open tag: <%s>.", toptag.
name);
1319 _MSG(
"Close: %*s%s\n", size,
" ", toptag.
name);
1347 int stack_idx, tag_idx, matched = 0, expected = 0;
1352 while (--stack_idx) {
1354 if (tag_idx == new_idx) {
1358 }
else if (
Tags[tag_idx].EndTag ==
'O') {
1366 }
else if (w3c_mode ||
Tags[tag_idx].TagLevel >= new_tag.
TagLevel) {
1375 }
else if (expected) {
1376 BUG_MSG(
"Unexpected closing tag: </%s> -- expected </%s>.",
1379 BUG_MSG(
"Unexpected closing tag: </%s>.", new_tag.
name);
1394 int stack_idx, u_idx, matched = 0;
1398 new_idx == i_TEXTAREA);
1406 while (--stack_idx) {
1415 BUG_MSG(
"Attempt to nest <%s> element inside <%s> -- closing <%s>.",
1416 Tags[new_idx].name,
Tags[u_idx].name,
Tags[u_idx].name);
1419 MSG_WARN(
"Inconsistent parser state, flag is SET but no '%s' element" 1420 "was found in the stack\n",
Tags[u_idx].name);
1441 v = strtod (attr, &end);
1484 if (*end && !isspace (*end)) {
1485 BUG_MSG(
"Garbage after length: '%s'.", attr);
1499 int32_t default_color)
1505 BUG_MSG(
"Color '%s' is not in \"#RRGGBB\" format.", str);
1519 bool valid = *val && !strchr(val,
' ');
1522 BUG_MSG(
"'%s' value \"%s\" must not be empty and must not contain " 1523 "spaces.", attrname, val);
1525 return valid ? 1 : 0;
1529 for (i = 0; val[i]; ++i)
1530 if (!isascii(val[i]) || !(isalnum(val[i]) || strchr(
":_.-", val[i])))
1533 if (val[i] || !(isascii(val[0]) && isalpha(val[0])))
1534 BUG_MSG(
"%s attribute value \"%s\" is not of the form " 1535 "'[A-Za-z][A-Za-z0-9:_.-]*'.", attrname, val);
1562 static const char HTML_SGML_sig [] =
"<!DOCTYPE HTML PUBLIC ";
1563 static const char HTML20 [] =
"-//IETF//DTD HTML";
1564 static const char HTML32 [] =
"-//W3C//DTD HTML 3.2";
1565 static const char HTML40 [] =
"-//W3C//DTD HTML 4.0";
1566 static const char HTML401 [] =
"-//W3C//DTD HTML 4.01";
1567 static const char HTML401_url[] =
"http://www.w3.org/TR/html4/";
1568 static const char XHTML1 [] =
"-//W3C//DTD XHTML 1.0";
1569 static const char XHTML1_url [] =
"http://www.w3.org/TR/xhtml1/DTD/";
1570 static const char XHTML11 [] =
"-//W3C//DTD XHTML 1.1";
1571 static const char XHTML11_url[] =
"http://www.w3.org/TR/xhtml11/DTD/";
1575 char *p, *ntag =
dStrndup(tag, tagsize);
1579 for (i = 0, p = ntag; *p; ++p) {
1581 for (ntag[i++] =
' '; isspace(p[1]); ++p) ;
1582 }
else if ((quote = *p) ==
'"' || *p ==
'\'') {
1583 for (ntag[i++] = *p++; (ntag[i] = *p) && ntag[i++] != quote; ++p) {
1584 if (*p ==
'\n' || *p ==
'\r')
1586 p += (p[0] ==
'\r' && p[1] ==
'\n') ? 1 : 0;
1596 _MSG(
"New: {%s}\n", ntag);
1599 BUG_MSG(
"Multiple DOCTYPE declarations.");
1602 if (i > strlen(HTML_SGML_sig) &&
1604 p = ntag + strlen(HTML_SGML_sig) + 1;
1605 if (!strncmp(p, HTML401, strlen(HTML401)) &&
1609 }
else if (!strncmp(p, XHTML1, strlen(XHTML1)) &&
1613 }
else if (!strncmp(p, XHTML11, strlen(XHTML11)) &&
1617 }
else if (!strncmp(p, HTML40, strlen(HTML40))) {
1620 }
else if (!strncmp(p, HTML32, strlen(HTML32))) {
1623 }
else if (!strncmp(p, HTML20, strlen(HTML20))) {
1630 "<!DOCTYPE html SYSTEM \"about:legacy-compat\">") ||
1632 "<!DOCTYPE html SYSTEM 'about:legacy-compat'>")) {
1638 BUG_MSG(
"DOCTYPE not recognized: ('%s').", ntag);
1657 BUG_MSG(
"<html> was already open.");
1667 _MSG(
"Html_tag_close_html: Num_HTML=%d\n", html->
Num_HTML);
1676 BUG_MSG(
"<head> must go before the BODY section.");
1684 BUG_MSG(
"<head> was already open.");
1687 BUG_MSG(
"<head> already finished -- ignoring.");
1704 BUG_MSG(
"<head> lacks <title>.");
1734 BUG_MSG(
"Redundant <title>.");
1736 BUG_MSG(
"<title> must be inside <head> -- ignoring.");
1778 const char *attrbuf;
1784 BUG_MSG(
"<style> requires type attribute.");
1817 const char *attrbuf;
1826 _MSG(
"Html_tag_open_body Num_BODY=%d\n", html->
Num_BODY);
1833 BUG_MSG(
"<body> was already open.");
1847 BUG_MSG(
"<body> bgcolor attribute is obsolete.");
1858 BUG_MSG(
"<body> text attribute is obsolete.");
1870 BUG_MSG(
"<body> link attribute is obsolete.");
1876 BUG_MSG(
"<body> vlink attribute is obsolete.");
1883 HT2LT(html)->setBgColor(bgColor);
1886 &bgPositionX, &bgPositionY);
1888 HT2LT(html)->setBgImage(bgImage, bgRepeat, bgAttachment, bgPositionX,
1947 const char *attrbuf;
1972 const char *attrbuf;
1977 textblock =
HT2TB(html);
2016 const char *tag,
int tagsize)
2031 S_TOP(html)->parse_mode =
2048 const char *attrbuf;
2049 char *fontFamily = NULL;
2065 fontFamily =
dStrdup(attrbuf);
2078 const char *attrbuf;
2095 char *width_ptr, *height_ptr;
2096 const char *attrbuf;
2129 if (w < 0 || h < 0 ||
2134 width_ptr = height_ptr = NULL;
2135 MSG(
"a_Html_common_image_attrs: suspicious image size request %d x %d\n",
2167 const char *attrbuf;
2185 if (
HT2TB(html)->getBgColor())
2228 return ClientKey != 0;
2234 const char *attrbuf;
2240 space = strtol(attrbuf, NULL, 10);
2252 space = strtol(attrbuf, NULL, 10);
2264 border = strtol(attrbuf, NULL, 10);
2298 const char *attrbuf;
2322 _MSG(
" Html_tag_open_img: server-side map (ISMAP)\n");
2324 usemap_url == NULL) {
2342 const char *attrbuf;
2356 BUG_MSG(
"<map> requires name attribute.");
2371 for (
int i = 0; i < html->
images->
size(); i++) {
2393 const char *tail = str;
2394 char *newtail = NULL;
2398 coord = strtol(tail, &newtail, 10);
2399 if (coord == 0 && newtail == tail)
2402 coords->
set(coords->
size() - 1, coord);
2403 while (isspace(*newtail))
2407 if (*newtail !=
',') {
2408 BUG_MSG(
"<area> coords must be integers separated by commas.");
2422 enum types {UNKNOWN, RECTANGLE, CIRCLE, POLYGON, BACKGROUND};
2426 const char *attrbuf;
2428 Shape *shape = NULL;
2431 BUG_MSG(
"<area> not inside <map>.");
2447 BUG_MSG(
"<area> unknown shape: '%s'.", attrbuf);
2450 if (type == RECTANGLE || type == CIRCLE || type == POLYGON) {
2455 if (type == RECTANGLE) {
2456 if (coords->
size() != 4)
2457 BUG_MSG(
"<area> rectangle must have four coordinate values.");
2458 if (coords->
size() >= 4)
2461 coords->
get(2) - coords->
get(0),
2462 coords->
get(3) - coords->
get(1));
2463 }
else if (type == CIRCLE) {
2464 if (coords->
size() != 3)
2465 BUG_MSG(
"<area> circle must have three coordinate values.");
2466 if (coords->
size() >= 3)
2469 }
else if (type == POLYGON) {
2472 if (coords->
size() % 2)
2473 BUG_MSG(
"<area> polygon with odd number of coordinates.");
2475 for (i = 0; i < (coords->
size() / 2); i++)
2481 if (shape != NULL || type == BACKGROUND) {
2490 if (type == BACKGROUND)
2504 const char *attrbuf;
2512 URL_STR(base_url), (base_url != NULL));
2541 const char *attrbuf;
2544 MSG(
"<video> not handled when already inside a media element.\n");
2574 const char *attrbuf;
2577 MSG(
"<audio> not handled when already inside a media element.\n");
2606 const char *attrbuf;
2609 BUG_MSG(
"<source> not inside a media element.");
2613 BUG_MSG(
"<source> requires src attribute.");
2651 const char *attrbuf;
2685 i = strcspn(Buf->
str,
"'\"");
2687 if ((ch ==
'"' || ch ==
'\'') &&
2688 (p2 = strchr(Buf->
str + i + 1 , ch))) {
2690 BUG_MSG(
"Link depends on javascript().");
2703 _MSG(
"Registering ANCHOR: %s\n", name);
2704 if (!
HT2TB(html)->addAnchor (name, html->
style ()))
2705 BUG_MSG(
"Anchor names must be unique within the document (\"%s\").",
2723 const char *attrbuf;
2774 if (!
id || strcmp(nameVal,
id)) {
2776 BUG_MSG(
"In <a>, id ('%s') and name ('%s') attributes differ.",
2798 const char *tag,
int tagsize)
2812 const char *U201C =
"\xe2\x80\x9c";
2824 const char *U201D =
"\xe2\x80\x9d";
2834 const char *attrbuf;
2853 BUG_MSG(
"<ul> type attribute is obsolete.");
2857 S_TOP(html)->list_number = 0;
2858 S_TOP(html)->ref_list_item = NULL;
2871 S_TOP(html)->list_number = 0;
2872 S_TOP(html)->ref_list_item = NULL;
2875 BUG_MSG(
"Obsolete list type; use <ul> instead.");
2900 const char *attrbuf;
2906 if (*attrbuf ==
'1')
2908 else if (*attrbuf ==
'a')
2910 else if (*attrbuf ==
'A')
2912 else if (*attrbuf ==
'i')
2914 else if (*attrbuf ==
'I')
2924 (n = (
int) strtol(attrbuf, NULL, 10)) < 0) {
2925 BUG_MSG(
"Illegal '-' character in START attribute; Starting from 0.");
2928 S_TOP(html)->list_number = n;
2929 S_TOP(html)->ref_list_item = NULL;
2939 const char *attrbuf;
2942 BUG_MSG(
"<li> outside <ul> or <ol>.");
2952 (*list_number = strtol(attrbuf, NULL, 10)) < 0) {
2953 BUG_MSG(
"Illegal negative list value attribute; Starting from 0.");
2974 const char *attrbuf;
2980 BUG_MSG(
"<hr> width attribute is obsolete.");
2988 size = strtol(attrbuf, NULL, 10);
2990 BUG_MSG(
"<hr> size attribute is obsolete.");
2998 BUG_MSG(
"<hr> noshade attribute is obsolete.");
3034 hruler =
new Ruler();
3036 HT2TB(html)->addWidget (hruler, html->
style ());
3094 const char *es_set[] = {
"img",
"object",
"applet",
"big",
"small",
"sub",
3095 "sup",
"font",
"basefont", NULL};
3096 static int ei_set[10], i;
3100 for (i = 0; es_set[i]; ++i)
3103 for (i = 0; ei_set[i]; ++i)
3104 if (tag_idx == ei_set[i])
3141 const char meta_template[] =
3142 "<table width='100%%'><tr><td bgcolor='#ee0000'>Warning:</td>\n" 3143 " <td bgcolor='#8899aa' width='100%%'>\n" 3144 " This page uses the NON-STANDARD meta refresh tag.<br> The HTML 4.01 SPEC\n" 3145 " (sec 7.4.4) recommends explicitly to avoid it.</td></tr>\n" 3146 " <tr><td bgcolor='#a0a0a0' colspan='2'>The author wanted you to go\n" 3147 " <a href='%s'>here</a>%s</td></tr></table><br>\n";
3149 const char *p, *equiv, *charset, *content;
3150 char delay_str[64], *mr_url;
3161 BUG_MSG(
"This <meta> element must be inside the HEAD section.");
3171 if ((delay = strtol(content, NULL, 0))) {
3172 snprintf(delay_str, 64,
" after %d second%s.",
3173 delay, (delay > 1) ?
"s" :
"");
3175 sprintf(delay_str,
".");
3179 content = p + strlen(
"url=");
3180 else if ((p = strstr(content,
";")))
3181 content = p + strlen(
";");
3183 if (*content ==
'"' || *content ==
'\'') {
3184 if ((p = strchr(content + 1, *content)))
3185 mr_url =
dStrndup(content + 1, p - content - 1);
3187 mr_url =
dStrdup(content + 1);
3195 BUG_MSG(
"<meta> refresh: %s.",
3196 *mr_url ?
"redirection loop" :
"no target URL");
3197 }
else if (delay == 0) {
3202 "WARNING: local URL with META refresh. Aborting.");
3213 int o_InFlags = html->
InFlags;
3214 int o_TagSoup = html->
TagSoup;
3228 _MSG(
"Html_tag_open_meta: content={%s}\n", content);
3233 char *content =
dStrconcat(
"text/html; charset=", charset, NULL);
3245 _MSG(
"Html_css_load_callback: Op=%d\n", Op);
3264 _MSG(
"Html_load_stylesheet: ");
3268 if (strncmp(
"@charset \"", data, 10) == 0) {
3269 char *endq = strchr(data+10,
'"');
3271 if (endq && (endq - data <= 51)) {
3276 content_type =
dStrconcat(
"text/css; charset=", data+10, NULL);
3280 dFree(content_type);
3313 const char *attrbuf;
3329 BUG_MSG(
"This <link> element must be inside the HEAD section.");
3351 _MSG(
" Html_tag_open_link(): addCssUrl %s\n",
URL_STR(url));
3362 const char *attrbuf;
3375 BUG_MSG(
"<base> URI is relative (it MUST be absolute).");
3380 BUG_MSG(
"<base> not inside HEAD section.");
3394 const char *attrbuf;
3412 const char *attrbuf;
3598 #define NTAGS (sizeof(Tags)/sizeof(Tags[0])) 3614 return !strchr(
" >/\n\r\t", *p1);
3623 int low, high, mid, cond;
3628 while (low <= high) {
3629 mid = (low + high) / 2;
3647 static int i_P = -1, i_LI, i_TD, i_TR, i_TH, i_DD, i_DT, i_OPTION;
3665 if (old_idx == i_P || old_idx == i_DT) {
3667 return (
Tags[cur_idx].Flags & 2);
3668 }
else if (old_idx == i_LI) {
3670 return (cur_idx == i_LI);
3671 }
else if (old_idx == i_TD || old_idx == i_TH) {
3673 return (cur_idx == i_TD || cur_idx == i_TH || cur_idx == i_TR);
3674 }
else if (old_idx == i_TR) {
3676 return (cur_idx == i_TR);
3677 }
else if (old_idx == i_DD) {
3679 return (cur_idx == i_DD || cur_idx == i_DT);
3680 }
else if (old_idx == i_OPTION) {
3715 int oldtag_idx =
S_TOP(html)->tag_idx;
3717 if (
Tags[oldtag_idx].EndTag ==
'O') {
3720 }
else if (
Tags[oldtag_idx].Flags & 8) {
3725 if (
Tags[oldtag_idx].EndTag ==
'R') {
3726 BUG_MSG(
"<%s> is not allowed to contain <%s>. -- closing <%s>.",
3727 Tags[oldtag_idx].name,
Tags[new_idx].name,
3728 Tags[oldtag_idx].name);
3733 strcmp(
Tags[new_idx].name,
"hr") == 0)
3737 strcmp(
Tags[new_idx].name,
"option") == 0)
3755 BUG_MSG(
"The required DOCTYPE declaration is missing. " 3756 "Handling as HTML4.");
3761 if (tag_idx != new_idx || IsCloseTag) {
3765 Tags[tag_idx].
open (html, tag, strlen(tag));
3769 if (
Tags[new_idx].Flags & 32) {
3774 if (tag_idx != new_idx || IsCloseTag) {
3778 Tags[tag_idx].
open (html, tag, strlen(tag));
3782 }
else if (
Tags[new_idx].Flags & 16) {
3791 if (tag_idx != new_idx || IsCloseTag) {
3795 Tags[tag_idx].
open (html, tag, strlen(tag));
3805 const char *attrbuf;
3836 memset(lang, 0,
sizeof(lang));
3837 if (tagsize >= 14) {
3841 strncpy(lang, attrbuf, 2);
3843 if (!lang[0] && tagsize >= 10) {
3847 strncpy(lang, attrbuf, 2);
3859 static int indexes[9] = {-1};
3861 if (indexes[0] == -1) {
3872 for (
int i = 0; i < 9; i++) {
3873 if (indexes[i] == ni) {
3874 BUG_MSG(
"<%s> is obsolete in HTML5.",
Tags[ni].name);
3899 HT2TB(html)->addParbreak (0, wordStyle);
3902 HT2TB(html)->addWidget (list_item, style);
3903 HT2TB(html)->addParbreak (0, wordStyle);
3904 *ref_list_item = list_item;
3905 S_TOP(html)->textblock = html->
dw = list_item;
3927 char *start = tag + 1;
3928 int IsCloseTag = (*start ==
'/');
3951 ci =
S_TOP(html)->tag_idx;
3952 switch (IsCloseTag) {
3958 if (
Tags[ni].Flags & 2 || (ci != -1 &&
Tags[ci].EndTag ==
'O'))
3964 BUG_MSG(
"<pre> is not allowed to contain <%s>.",
Tags[ni].name);
3980 _MSG(
"Html_process_tag Open : %s\n",
Tags[ni].name);
3981 Tags[ni].
open (html, tag, tagsize);
3983 if (!
S_TOP(html)->display_none) {
3992 S_TOP(html)->display_none =
true;
4000 if (
Tags[ni].content && !
S_TOP(html)->display_none) {
4024 if (
Tags[ni].EndTag ==
'F')
4033 if (*start ==
'/' ||
4035 (tag[tagsize-2] ==
'/' &&
4036 (strchr(
" \"'", tag[tagsize-3]) ||
4037 (
size_t)tagsize == strlen(
Tags[ni].name) + 3))) {
4039 _MSG(
"Html_process_tag Close: %s\n",
Tags[ni].name);
4060 const char *attrname,
4061 int tag_parsing_flags)
4063 int i, isocode, entsize, Found = 0, delimiter = 0, attr_pos = 0;
4071 for (i = 1; i < tagsize; ++i) {
4074 if (isspace(tag[i]))
4076 else if (tag[i] ==
'=')
4081 if (!attrname[attr_pos] &&
4082 (tag[i] ==
'=' || isspace(tag[i]) || tag[i] ==
'>')) {
4086 }
else if (!tag[i]) {
4096 if (tag[i] ==
'=') {
4098 }
else if (!isspace(tag[i])) {
4105 if (!isspace(tag[i])) {
4106 delimiter = (tag[i] ==
'"' || tag[i] ==
'\'') ? tag[i] :
' ';
4107 i -= (delimiter ==
' ');
4113 if ((delimiter ==
' ' && isspace(tag[i])) || tag[i] == delimiter)
4117 if ((delimiter ==
' ' && (isspace(tag[i]) || tag[i] ==
'>')) ||
4118 tag[i] == delimiter) {
4120 }
else if (tag[i] ==
'&' &&
4123 tagsize-i, &entsize)) >= 0) {
4124 if (isocode >= 128) {
4127 for (k = 0; k < n; ++k)
4136 }
else if (tag[i] ==
'\r' || tag[i] ==
'\t') {
4138 }
else if (tag[i] ==
'\n') {
4152 while (isspace(Buf->
str[0]))
4155 while (Buf->
len && isspace(Buf->
str[Buf->
len - 1]))
4158 return (Found) ? Buf->
str : NULL;
4167 const char *attrname)
4181 const char *attrname,
4215 char ch = 0, *p, *text;
4216 int token_start, buf_index;
4221 token_start = buf_index;
4225 if (
S_TOP(html)->parse_mode ==
4230 buf_index += strcspn(buf + buf_index,
"<");
4231 if (buf_index + (
int)strlen(tag) + 3 >
bufsize) {
4233 }
else if (strncmp(buf + buf_index,
"</", 2) == 0 &&
4236 text =
dStrndup(buf + token_start, buf_index - token_start);
4239 token_start = buf_index;
4243 }
while (buf_index <
bufsize);
4249 if (isspace(buf[buf_index])) {
4251 while (++buf_index <
bufsize && isspace(buf[buf_index])) ;
4253 token_start = buf_index;
4255 }
else if (buf[buf_index] ==
'<' && (ch = buf[buf_index + 1]) &&
4256 (isalpha(ch) || strchr(
"/!?", ch)) ) {
4258 if (buf_index + 3 <
bufsize && !strncmp(buf + buf_index,
"<!--", 4)) {
4261 while ( (p = (
char*) memchr(buf + buf_index,
'>',
4263 buf_index = p - buf + 1;
4264 if (p[-1] ==
'-' && p[-2] ==
'-')
break;
4268 token_start = buf_index;
4275 while ( buf_index <
bufsize ) {
4277 buf_index += strcspn(buf + buf_index,
">\"'<");
4278 if ((ch = buf[buf_index]) ==
'>') {
4280 }
else if (ch ==
'"' || ch ==
'\'') {
4283 buf_index += strcspn(buf + buf_index,
4284 (ch ==
'"') ?
"\">" :
"'>");
4285 if (buf[buf_index] ==
'>') {
4288 int offset = buf_index + 1;
4289 offset += strcspn(buf + offset,
4290 (ch ==
'"') ?
"\"<" :
"'<");
4291 if (buf[offset] == ch || !buf[offset]) {
4294 BUG_MSG(
"Attribute lacks closing quote.");
4298 }
else if (ch ==
'<') {
4301 strcspn(buf+token_start+1,
" <\n\r\t"));
4302 BUG_MSG(
"<%s> lacks its closing '>'.", p);
4311 buf_index - token_start);
4312 token_start = buf_index;
4319 while (++buf_index <
bufsize) {
4320 buf_index += strcspn(buf + buf_index,
" <\n\r\t\f\v");
4321 if (buf[buf_index] ==
'<' && (ch = buf[buf_index + 1]) &&
4322 !isalpha(ch) && !strchr(
"/!?", ch))
4326 if (buf_index <
bufsize || Eof) {
4328 ch = buf[buf_index];
4331 buf_index - token_start);
4332 buf[buf_index] = ch;
4333 token_start = buf_index;
4338 HT2TB(html)->flush ();
void dStr_free(Dstr *ds, int all)
static void Html_tag_close_head(DilloHtml *html)
void(* TagOpenFunct)(DilloHtml *html, const char *tag, int tagsize)
void a_Html_common_image_attrs(DilloHtml *html, const char *tag, int tagsize)
bool press(dw::core::Widget *widget, int link, int img, int x, int y, dw::core::EventButton *event)
Called, when the user has pressed the mouse button on a link (but not yet released).
void * a_Html_text(const char *type, void *P, CA_Callback_t *Call, void **Data)
void write(char *Buf, int BufSize, int Eof)
CssLength CSS_CREATE_LENGTH(float v, CssLengthType t)
void Html_tag_open_th(DilloHtml *html, const char *tag, int tagsize)
void dStr_append_l(Dstr *ds, const char *s, int l)
static void Html_set_link_coordinates(DilloHtml *html, int link, int x, int y)
void a_Url_free(DilloUrl *url)
CssLength a_Html_parse_length(DilloHtml *html, const char *attr)
bool_t w3c_plus_heuristics
#define dReturn_if_fail(expr)
int NumPendingStyleSheets
static void Html_tag_cleanup_to_idx(DilloHtml *html, int idx)
static int Html_check_name_val(DilloHtml *html, const char *val, const char *attrname)
Widget for drawing (horizontal) rules.
static void Html_tag_content_img(DilloHtml *html, const char *tag, int tagsize)
void addPoint(int x, int y)
lout::misc::SimpleVector< DilloHtmlState > * stack
bool_t a_Utf8_ideographic(const char *s, const char *end, int *len)
void addParbreak(int space, core::style::Style *style)
static void Html_tag_close_q(DilloHtml *html)
static void Html_free(void *data)
A Widget for rendering text blocks, i.e. paragraphs or sequences of paragraphs.
void initWithText(const char *text, core::style::Style *style)
static int Html_set_new_link(DilloHtml *html, DilloUrl **url)
T get(int i) const
Return the one element, explicitly.
static void Html_tag_open_script(DilloHtml *html, const char *tag, int tagsize)
static void Html_force_push_tag(DilloHtml *html, int tag_idx)
static void Html_tag_close_title(DilloHtml *html)
static void Html_tag_open_audio(DilloHtml *html, const char *tag, int tagsize)
T * getRef(int i) const
Return the reference of one element.
void setIsMap()
Sets image as server side image map.
void inheritBackgroundColor()
Use of the background color of the parent style as default. This is only used in table code to allow ...
void setSize(int newSize)
Set the size explicitly.
char * a_Url_decode_hex_str(const char *str, size_t *p_sz)
static void Html_process_word(DilloHtml *html, const char *word, int size)
void increase()
Increase the vector size by one.
#define URL_ILLEGAL_CHARS(u)
void a_Bw_close_client(BrowserWindow *bw, int ClientKey)
void Html_tag_content_th(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_content_map(DilloHtml *html, const char *tag, int tagsize)
void a_Html_stash_init(DilloHtml *html)
DilloHtml(BrowserWindow *bw, const DilloUrl *url, const char *content_type)
dw::core::Shape implemtation for polygons.
void addSpace(core::style::Style *style)
static const char * Html_get_javascript_link(DilloHtml *html)
void dStr_append_c(Dstr *ds, int c)
static void Html_tag_close_li(DilloHtml *html)
dw::core::style::Style * wordStyle()
DilloWeb * a_Web_new(BrowserWindow *bw, const DilloUrl *url, const DilloUrl *requester)
static void Html_tag_open_html(DilloHtml *html, const char *tag, int tagsize)
int32_t non_css_visited_color
void a_History_set_title_by_url(const DilloUrl *url, const char *title)
void bugMessage(const char *format,...)
static void Html_tag_open_source(DilloHtml *html, const char *tag, int tagsize)
#define dReturn_val_if_fail(expr, val)
static int Html_ms_stupid_quotes_2ucs(int isocode)
void dStr_truncate(Dstr *ds, int len)
static void Html_display_listitem(DilloHtml *html)
static void Html_tag_open_li(DilloHtml *html, const char *tag, int tagsize)
const char * a_Html_get_attr(DilloHtml *html, const char *tag, int tagsize, const char *attrname)
void a_Html_load_images(void *v_html, DilloUrl *pattern)
void finishParsing(int ClientKey)
void setUseMap(ImageMapsList *list, Object *key)
Sets image as client side image map.
static void Html_add_anchor(DilloHtml *html, const char *name)
static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_p(DilloHtml *html, const char *tag, int tagsize)
void dStr_vsprintfa(Dstr *ds, const char *format, va_list argp)
char * dStrconcat(const char *s1,...)
void a_UIcmd_redirection0(void *vbw, const DilloUrl *url)
void a_Image_ref(DilloImage *Image)
static void Html_tag_open_embed(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_open_tr(DilloHtml *html, const char *tag, int tagsize)
DilloHtmlForm * getCurrentForm()
static void Html_tag_content_source(DilloHtml *html, const char *tag, int tagsize)
char * dStrnfill(size_t len, char c)
bool a_Html_tag_set_valign_attr(DilloHtml *html, const char *tag, int tagsize)
#define D_ASCII_TOLOWER(c)
void a_Image_unref(DilloImage *Image)
lout::misc::SimpleVector< DilloUrl * > * links
static void Html_add_textblock(DilloHtml *html, int space)
static const char * Html_get_attr2(DilloHtml *html, const char *tag, int tagsize, const char *attrname, int tag_parsing_flags)
void a_Misc_parse_content_type(const char *type, char **major, char **minor, char **charset)
static void Html_css_load_callback(int Op, CacheClient_t *Client)
bool_t contrast_visited_color
void setPseudoVisited()
set the CSS pseudo class :visited.
int a_Capi_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize)
int a_Url_cmp(const DilloUrl *A, const DilloUrl *B)
bool enter(dw::core::Widget *widget, int link, int img, int x, int y)
Called, when a link is entered, left, or the position has changed.
bool_t a_Bw_expecting(BrowserWindow *bw)
static void Html_tag_content_embed(DilloHtml *html, const char *tag, int tagsize)
bool_t parse_embedded_css
static void Html_tag_content_frame(DilloHtml *html, const char *tag, int tagsize)
int32_t non_css_link_color
dw::core::style::Style * backgroundStyle()
void a_Url_set_alt(DilloUrl *u, const char *alt)
void a_Html_form_submit(void *v_html, void *v_form)
char * a_Url_str(const DilloUrl *u)
#define dNew(type, count)
StyleEngine * styleEngine
static const Ent_t Entities[252]
char * dStrndup(const char *s, size_t sz)
void numtostr(int num, char *buf, int buflen, ListStyleType listStyleType)
Convert a number into a string, in a given list style.
void a_UIcmd_set_page_title(BrowserWindow *bw, const char *label)
void Html_tag_open_td(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_pre(DilloHtml *html, const char *tag, int tagsize)
const char * a_Capi_set_content_type(const DilloUrl *url, const char *ctype, const char *from)
void a_Html_tag_set_align_attr(DilloHtml *html, const char *tag, int tagsize)
static int Html_write_raw(DilloHtml *html, char *buf, int bufsize, int Eof)
void startElement(int tag)
static void Html_stack_cleanup_at_open(DilloHtml *html, int new_idx)
static void Html_tag_close_pre(DilloHtml *html)
#define URL_ILLEGAL_CHARS_SPC(u)
int size() const
Return the number of elements put into this vector.
static void Html_real_pop_tag(DilloHtml *html)
char * dStriAsciiStr(const char *haystack, const char *needle)
static void Html_tag_close_style(DilloHtml *html)
lout::misc::SimpleVector< DilloHtmlForm * > * forms
ListStyleType listStyleType
static void Html_tag_cleanup_nested_inputs(DilloHtml *html, int new_idx)
int32_t a_Html_color_parse(DilloHtml *html, const char *str, int32_t default_color)
Displays different kind of bullets.
static void Html_tag_open_h(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_content_tr(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_ul(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_blockquote(DilloHtml *html, const char *tag, int tagsize)
void setNonCssHint(CssPropertyName name, CssValueType type, CssPropertyValue value)
static void Html_tag_open_q(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_hr(DilloHtml *html, const char *tag, int tagsize)
void a_UIcmd_set_bug_prog(BrowserWindow *bw, int n_bug)
DilloImage * a_Html_image_new(DilloHtml *html, const char *tag, int tagsize)
Dstr * dStr_new(const char *s)
dw::core::style::Style * style()
void a_UIcmd_page_popup(void *vbw, bool_t has_bugs, void *v_cssUrls)
static int Html_tag_compare(const char *p1, const char *p2)
int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData)
void set(int i, T t)
Store an object in the vector.
void a_UIcmd_image_popup(void *vbw, const DilloUrl *url, bool_t loaded_img, DilloUrl *page_url, DilloUrl *link_url)
static void Html_tag_open_span(DilloHtml *html, const char *tag, int tagsize)
int formNew(DilloHtmlMethod method, const DilloUrl *action, DilloHtmlEnc enc, const char *charset)
static void Html_tag_content_br(DilloHtml *html, const char *tag, int tagsize)
static void Html_parse_doctype(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_dir(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_div(DilloHtml *html, const char *tag, int tagsize)
int dStrAsciiCasecmp(const char *s1, const char *s2)
static void Html_tag_open_meta(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_content_frameset(DilloHtml *html, const char *tag, int tagsize)
void setClass(const char *klass)
void endElement(int tag)
tell the styleEngine that a html element has ended.
static int Html_entity_search(char *key)
void dStr_erase(Dstr *ds, int pos_0, int len)
DilloUrl * a_Url_new(const char *url_str, const char *base_url)
static int Html_needs_optional_close(int old_idx, int cur_idx)
static void Html_tag_open_font(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_close_map(DilloHtml *html)
static void Html_tag_close_media(DilloHtml *html)
static void Html_tag_open_frame(DilloHtml *html, const char *tag, int tagsize)
void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
static void Html_tag_open_title(DilloHtml *html, const char *tag, int tagsize)
void initWithWidget(core::Widget *widget, core::style::Style *style)
Displays an instance of dw::core::Imgbuf.
bool_t show_extra_warnings
static void Html_tag_open_link(DilloHtml *html, const char *tag, int tagsize)
int a_Capi_dpi_verify_request(BrowserWindow *bw, DilloUrl *url)
dw::core::style::StyleImage * backgroundImage(dw::core::style::BackgroundRepeat *bgRepeat, dw::core::style::BackgroundAttachment *bgAttachment, dw::core::style::Length *bgPositionX, dw::core::style::Length *bgPositionY)
Dstr * dStr_sized_new(int sz)
void setStyle(const char *style)
static CssLength Html_parse_length_or_multi_length(const char *attr, char **endptr)
static int Html_parse_entity(DilloHtml *html, const char *token, int toksize, int *entsize)
Abstract interface for different shapes.
int32_t a_Color_vc(int32_t candidate, int32_t C_txt, int32_t C_lnk, int32_t C_bg)
CssLengthType CSS_LENGTH_TYPE(CssLength l)
void a_UIcmd_repush(void *vbw)
static void Html_tag_open_menu(DilloHtml *html, const char *tag, int tagsize)
void a_Capi_unref_buf(const DilloUrl *Url)
dw::core::Shape implemtation for simple rectangles.
void a_Bw_add_doc(BrowserWindow *bw, void *vdoc)
void addWidget(core::Widget *widget, core::style::Style *style)
static int Html_entity_comp(const void *a, const void *b)
void setCurrentMapDefaultLink(int link)
Set default link for current map-.
void dStr_append(Dstr *ds, const char *s)
int32_t a_Color_parse(const char *str, int32_t default_color, int *err)
void a_Bw_add_client(BrowserWindow *bw, int Key, int Root)
void setId(const char *id)
static void Html_check_html5_obsolete(DilloHtml *html, int ni)
static void Html_callback(int Op, CacheClient_t *Client)
void a_UIcmd_open_url_nt(void *vbw, const DilloUrl *url, int focus)
void addCssUrl(const DilloUrl *url)
void a_Html_load_stylesheet(DilloHtml *html, DilloUrl *url)
static void Html_tag_content_object(DilloHtml *html, const char *tag, int tagsize)
lout::misc::SimpleVector< DilloUrl * > * cssUrls
DilloUrl * a_Url_dup(const DilloUrl *ori)
void loadImages(const DilloUrl *pattern)
static void Html_tag_content_wbr(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_video(DilloHtml *html, const char *tag, int tagsize)
static bool Html_load_image(BrowserWindow *bw, DilloUrl *url, const DilloUrl *requester, DilloImage *image)
bool_t middle_click_opens_new_tab
static void Html_tag_open_style(DilloHtml *html, const char *tag, int tagsize)
void a_Url_set_ismap_coords(DilloUrl *u, char *coord_str)
void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
void dStr_sprintf(Dstr *ds, const char *format,...)
static void Html_tag_close_body(DilloHtml *html)
void a_Bw_add_url(BrowserWindow *bw, const DilloUrl *Url)
void a_Url_set_flags(DilloUrl *u, int flags)
static void Html_tag_open_base(DilloHtml *html, const char *tag, int tagsize)
void a_Html_form_reset(void *v_html, void *v_form)
int Length
Type for representing all lengths within dw::core::style.
static void Html_tag_content_hr(DilloHtml *html, const char *tag, int tagsize)
static const char utf8_zero_width_space[]
void a_Html_form_display_hiddens(void *v_html, void *v_form, bool_t display)
static void Html_process_space_pre_line(DilloHtml *html, const char *space, int spacesize)
static void Html_parse_common_attrs(DilloHtml *html, char *tag, int tagsize)
static void Html_tag_open_dl(DilloHtml *html, const char *tag, int tagsize)
static bool Html_match_tag(const char *tagstr, char *tag, int tagsize)
void Html_tag_content_td(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_img(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_close_a(DilloHtml *html)
char * a_Html_get_attr_wdef(DilloHtml *html, const char *tag, int tagsize, const char *attrname, const char *def)
static void Html_tag_open_sectioning(DilloHtml *html, const char *tag, int tagsize)
This class provides the glue between HTML parser and CSS subsystem.
static void Html_process_tag(DilloHtml *html, char *tag, int tagsize)
static void Html_push_tag(DilloHtml *html, int tag_idx)
static void Html_tag_close_script(DilloHtml *html)
static void Html_tag_content_area(DilloHtml *html, const char *tag, int tagsize)
A list of CssProperty objects.
void a_Bw_remove_doc(BrowserWindow *bw, void *vdoc)
static void Html_tag_open_object(DilloHtml *html, const char *tag, int tagsize)
void Html_tag_content_table(DilloHtml *html, const char *tag, int tagsize)
dw::core::Shape implemtation for simple circles.
static bool Html_contains_form(DilloHtml *html, void *v_form)
static void Html_tag_open_abbr(DilloHtml *html, const char *tag, int tagsize)
int a_Utf8_encode(unsigned int ucs, char *buf)
Anything related to embedded UI widgets is defined here.
int a_Capi_get_flags_with_redirection(const DilloUrl *Url)
The core of Dw is defined in this namespace.
static void Html_tag_close_par(DilloHtml *html)
void(* TagCloseFunct)(DilloHtml *html)
DilloUrl * a_Html_url_new(DilloHtml *html, const char *url_str, const char *base_url, int use_base_url)
static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag)
void(* CA_Callback_t)(int Op, CacheClient_t *Client)
static int Html_tag_pre_excludes(DilloHtml *html, int tag_idx)
static void Html_tag_close_html(DilloHtml *html)
void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url)
char * dStrdup(const char *s)
dw::core::style::Color * backgroundColor()
char * a_Html_parse_entities(DilloHtml *html, const char *token, int toksize)
void a_UIcmd_set_msg(BrowserWindow *bw, const char *format,...)
#define dReturn_val_if(expr, val)
Dw is in this namespace, or sub namespaces of this one.
void addShapeToCurrentMap(core::Shape *shape, int link)
Add a shape to the current map-.
void parse(DilloHtml *html, DilloUrl *url, const char *buf, int buflen, CssOrigin origin)
Anything related to Dillo Widget styles is defined here.
static void Html_update_content_type(DilloHtml *html, const char *content)
DilloHtmlDocumentType DocType
static void Html_tag_open_ol(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_head(DilloHtml *html, const char *tag, int tagsize)
static misc::SimpleVector< int > * Html_read_coords(DilloHtml *html, const char *str)
void dStr_sprintfa(Dstr *ds, const char *format,...)
int a_Misc_content_type_cmp(const char *ct1, const char *ct2)
int a_Html_tag_index(const char *tag)
static void Html_eventually_pop_dw(DilloHtml *html, bool hand_over_break)
void startNewMap(lout::object::Object *key)
Start a new map and make it the current one.
static void Html_display_block(DilloHtml *html)
static void Html_process_space(DilloHtml *html, const char *space, int spacesize)
int dStrnAsciiCasecmp(const char *s1, const char *s2, size_t n)
void addText(const char *text, size_t len, core::style::Style *style)
void a_UIcmd_link_popup(void *vbw, const DilloUrl *url)
DilloImage * a_Image_new(void *layout, void *img_rndr, int32_t bg_color)
void setPseudoLink()
set the CSS pseudo class :link.
float CSS_LENGTH_VALUE(CssLength l)
bool click(dw::core::Widget *widget, int link, int img, int x, int y, dw::core::EventButton *event)
Called, when the user has clicked on a link.
static void Html_tag_open_default(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_dd(DilloHtml *html, const char *tag, int tagsize)
static void Html_tag_open_dt(DilloHtml *html, const char *tag, int tagsize)
lout::misc::SimpleVector< DilloHtmlImage * > * images
static void Html_tag_cleanup_at_close(DilloHtml *html, int TagIdx)