| 1768 | } |
| 1769 | |
| 1770 | void 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 | |
| 1802 | void CssParser::parseDeclarationBlock(const DilloUrl *baseUrl, |
| 1803 | const char *buf, int buflen, |
nothing calls this directly
no test coverage detected