MCPcopy Create free account
hub / github.com/dillo-browser/dillo / DilloHtml

Method DilloHtml

src/html.cc:432–517  ·  view source on GitHub ↗

* Create and initialize a new DilloHtml class */

Source from the content-addressed store, hash-verified

430 * Create and initialize a new DilloHtml class
431 */
432DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
433 const char *content_type)
434{
435 /* Init main variables */
436 bw = p_bw;
437 page_url = a_Url_dup(url);
438 base_url = a_Url_dup(url);
439 dw = NULL;
440
441 /* Init event receiver */
442 linkReceiver.html = this;
443 HT2LT(this)->connectLink (&linkReceiver);
444
445 a_Bw_add_doc(p_bw, this);
446
447 /* Init for-parsing variables */
448 Start_Buf = NULL;
449 Start_Ofs = 0;
450
451 _MSG("DilloHtml(): content type: %s\n", content_type);
452 this->content_type = dStrdup(content_type);
453
454 /* get charset */
455 a_Misc_parse_content_type(content_type, NULL, NULL, &charset);
456
457 stop_parser = false;
458
459 CurrOfs = OldOfs = 0;
460 OldLine = 1;
461
462 DocType = DT_NONE; /* assume Tag Soup 0.0! :-) */
463 DocTypeVersion = 0.0f;
464
465 styleEngine = new StyleEngine (HT2LT (this), page_url, base_url, bw->zoom);
466
467 cssUrls = new misc::SimpleVector <DilloUrl*> (1);
468
469 stack = new misc::SimpleVector <DilloHtmlState> (16);
470 stack->increase();
471 stack->getRef(0)->parse_mode = DILLO_HTML_PARSE_MODE_INIT;
472 stack->getRef(0)->table_mode = DILLO_HTML_TABLE_MODE_NONE;
473 stack->getRef(0)->table_border_mode = DILLO_HTML_TABLE_BORDER_SEPARATE;
474 stack->getRef(0)->cell_text_align_set = false;
475 stack->getRef(0)->display_none = false;
476 stack->getRef(0)->list_type = HTML_LIST_NONE;
477 stack->getRef(0)->list_number = 0;
478 stack->getRef(0)->tag_idx = -1; /* MUST not be used */
479 stack->getRef(0)->textblock = NULL;
480 stack->getRef(0)->table = NULL;
481 stack->getRef(0)->ref_list_item = NULL;
482 stack->getRef(0)->hand_over_break = false;
483
484 InFlags = IN_NONE;
485
486 Stash = dStr_new("");
487 StashSpace = false;
488
489 pre_column = 0;

Callers

nothing calls this directly

Calls 9

a_Url_dupFunction · 0.85
a_Bw_add_docFunction · 0.85
dStrdupFunction · 0.85
dStr_newFunction · 0.85
dStr_sized_newFunction · 0.85
connectLinkMethod · 0.45
increaseMethod · 0.45
getRefMethod · 0.45

Tested by

no test coverage detected