Rewrite hints handling to be more efficient.

Now we only look for hints that are actually possible for the
given element.  This new way of doing things is made possible
by the new LibCSS API for hints.

This also makes use of the LibDOM HTMLElement tag type to avoid
lots of massive if-else-if ladders of dom_string_caseless_isequal
calls.
This commit is contained in:
Michael Drake 2016-02-02 15:42:09 +00:00
parent e42afd9b32
commit 278451463f
2 changed files with 958 additions and 1293 deletions

View File

@ -31,6 +31,7 @@
#include "utils/messages.h"
#include "css/css.h"
#include "css/hints.h"
#include "css/internal.h"
/* Define to trace import fetches */
@ -806,6 +807,7 @@ static void nscss_fini(void)
css_stylesheet_destroy(blank_import);
blank_import = NULL;
}
css_hint_fini();
}
static const content_handler css_content_handler = {
@ -832,6 +834,10 @@ nserror nscss_init(void)
if (error != NSERROR_OK)
goto error;
error = css_hint_init();
if (error != NSERROR_OK)
goto error;
return NSERROR_OK;
error:

File diff suppressed because it is too large Load Diff