mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-08 00:01:41 +03:00
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:
parent
e42afd9b32
commit
278451463f
@ -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:
|
||||
|
2245
css/hints.c
2245
css/hints.c
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user