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

Method parse

src/cssparser.cc:1770–1800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1768}
1769
1770void CssParser::parse(DilloHtml *html, const DilloUrl *baseUrl,
1771 CssContext *context,
1772 const char *buf,
1773 int buflen, CssOrigin origin)
1774{
1775 CssParser parser (context, origin, baseUrl, buf, buflen);
1776 bool importsAreAllowed = true;
1777
1778 while (parser.ttype != CSS_TK_END) {
1779 if (parser.ttype == CSS_TK_CHAR &&
1780 parser.tval[0] == '@') {
1781 parser.nextToken();
1782 if (parser.ttype == CSS_TK_SYMBOL) {
1783 if (dStrAsciiCasecmp(parser.tval, "import") == 0 &&
1784 html != NULL &&
1785 importsAreAllowed) {
1786 parser.parseImport(html);
1787 } else if (dStrAsciiCasecmp(parser.tval, "media") == 0) {
1788 parser.parseMedia();
1789 } else {
1790 parser.ignoreStatement();
1791 }
1792 } else {
1793 parser.ignoreStatement();
1794 }
1795 } else {
1796 importsAreAllowed = false;
1797 parser.parseRuleset();
1798 }
1799 }
1800}
1801
1802void CssParser::parseDeclarationBlock(const DilloUrl *baseUrl,
1803 const char *buf, int buflen,

Callers

nothing calls this directly

Calls 6

dStrAsciiCasecmpFunction · 0.85
nextTokenMethod · 0.80
parseImportMethod · 0.80
parseMediaMethod · 0.80
ignoreStatementMethod · 0.80
parseRulesetMethod · 0.80

Tested by

no test coverage detected