summaryrefslogtreecommitdiff
path: root/content/handlers/css/css.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/handlers/css/css.c')
-rw-r--r--content/handlers/css/css.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c
index 0dcbe9907..f9197ddfe 100644
--- a/content/handlers/css/css.c
+++ b/content/handlers/css/css.c
@@ -16,19 +16,22 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <string.h>
#include <assert.h>
#include <libwapcaplet/libwapcaplet.h>
#include <dom/dom.h>
-#include "content/content_protected.h"
-#include "content/fetch.h"
-#include "content/hlcache.h"
-#include "desktop/system_colour.h"
+#include "utils/errors.h"
#include "utils/corestrings.h"
#include "utils/utils.h"
#include "utils/http.h"
#include "utils/log.h"
#include "utils/messages.h"
+#include "content/content_protected.h"
+#include "content/content_factory.h"
+#include "content/fetch.h"
+#include "content/hlcache.h"
+#include "desktop/system_colour.h"
#include "css/css.h"
#include "css/hints.h"
@@ -37,6 +40,9 @@
/* Define to trace import fetches */
#undef NSCSS_IMPORT_TRACE
+/** Screen DPI in fixed point units: defaults to 90, which RISC OS uses */
+css_fixed nscss_screen_dpi = F_90;
+
struct content_css_data;
/**
@@ -168,7 +174,7 @@ nscss_create(const content_handler *handler,
xnsbase, charset, result->base.quirks,
nscss_content_done, result);
if (error != NSERROR_OK) {
- content_broadcast_errorcode(&result->base, NSERROR_NOMEM);
+ content_broadcast_error(&result->base, NSERROR_NOMEM, NULL);
if (charset_value != NULL)
lwc_string_unref(charset_value);
free(result);
@@ -251,7 +257,7 @@ nscss_process_data(struct content *c, const char *data, unsigned int size)
error = nscss_process_css_data(&css->data, data, size);
if (error != CSS_OK && error != CSS_NEEDDATA) {
- content_broadcast_errorcode(c, NSERROR_CSS);
+ content_broadcast_error(c, NSERROR_CSS, NULL);
}
return (error == CSS_OK || error == CSS_NEEDDATA);
@@ -285,7 +291,7 @@ bool nscss_convert(struct content *c)
error = nscss_convert_css_data(&css->data);
if (error != CSS_OK) {
- content_broadcast_errorcode(c, NSERROR_CSS);
+ content_broadcast_error(c, NSERROR_CSS, NULL);
return false;
}
@@ -480,7 +486,7 @@ void nscss_content_done(struct content_css_data *css, void *pw)
/* Retrieve the size of this sheet */
error = css_stylesheet_size(css->sheet, &size);
if (error != CSS_OK) {
- content_broadcast_errorcode(c, NSERROR_CSS);
+ content_broadcast_error(c, NSERROR_CSS, NULL);
content_set_error(c);
return;
}
@@ -634,7 +640,6 @@ nserror nscss_import(hlcache_handle *handle,
error = nscss_import_complete(ctx);
break;
- case CONTENT_MSG_ERRORCODE:
case CONTENT_MSG_ERROR:
hlcache_handle_release(handle);
ctx->css->imports[ctx->index].c = NULL;
@@ -642,7 +647,6 @@ nserror nscss_import(hlcache_handle *handle,
error = nscss_import_complete(ctx);
/* Already released handle */
break;
-
default:
break;
}