diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-11 16:34:23 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-11 16:34:23 +0000 |
commit | 7577e2a1e6a2b1c3b61cc01b3f3f18476afa05fb (patch) | |
tree | 11753f94abe304fb64b2dddc9bf566af87f0bcff | |
parent | ad89d5b263ca86c5c55366fc7412cfc1529b13c3 (diff) | |
download | netsurf-7577e2a1e6a2b1c3b61cc01b3f3f18476afa05fb.tar.gz netsurf-7577e2a1e6a2b1c3b61cc01b3f3f18476afa05fb.tar.bz2 |
Ensure quirks mode matches when retrieving contents from cache
svn path=/trunk/netsurf/; revision=10360
-rw-r--r-- | content/content.c | 16 | ||||
-rw-r--r-- | content/content.h | 1 | ||||
-rw-r--r-- | content/hlcache.c | 6 |
3 files changed, 22 insertions, 1 deletions
diff --git a/content/content.c b/content/content.c index 397c645e4..ba4db702c 100644 --- a/content/content.c +++ b/content/content.c @@ -973,6 +973,22 @@ uint32_t content_count_users(struct content *c) } /** + * Determine if quirks mode matches + * + * \param c Content to consider + * \param quirks Quirks mode to match + * \return True if quirks match, false otherwise + */ +bool content_matches_quirks(struct content *c, bool quirks) +{ + /* If the content isn't CSS, we don't care about quirks */ + if (c->type != CONTENT_CSS) + return true; + + return c->quirks == quirks; +} + +/** * Send a message to all users. */ diff --git a/content/content.h b/content/content.h index 8a24e712f..f8838de2a 100644 --- a/content/content.h +++ b/content/content.h @@ -103,6 +103,7 @@ void content_remove_user(struct content *c, void *pw); uint32_t content_count_users(struct content *c); +bool content_matches_quirks(struct content *c, bool quirks); const struct llcache_handle *content_get_llcache_handle(struct content *c); diff --git a/content/hlcache.c b/content/hlcache.c index baadf0c3c..3627343ad 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -427,7 +427,6 @@ nserror hlcache_find_content(hlcache_retrieval_ctx *ctx) hlcache_handle entry_handle = { entry, NULL, NULL }; const llcache_handle *entry_llcache; - /** \todo Need to ensure that quirks mode matches */ /** \todo Need to ensure that content is shareable */ /** \todo Need to ensure that content can be reused */ if (entry->content == NULL) @@ -437,6 +436,11 @@ nserror hlcache_find_content(hlcache_retrieval_ctx *ctx) if (content_get_status(&entry_handle) == CONTENT_STATUS_ERROR) continue; + /* Ensure that quirks mode is acceptable */ + if (content_matches_quirks(entry->content, + ctx->child.quirks) == false) + continue; + /* Ensure that content uses same low-level object as * low-level handle */ entry_llcache = content_get_llcache_handle(entry->content); |