diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2013-02-25 15:00:50 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2013-02-25 15:00:50 +0000 |
commit | 4e7b4259a44703ecc0994c922315b67df7096c90 (patch) | |
tree | 9921996510550cc8fdd55a6827427f7872591fe3 /render/html.c | |
parent | dd35da2cac223551c8041a7795eba82fa99ded87 (diff) | |
download | netsurf-4e7b4259a44703ecc0994c922315b67df7096c90.tar.gz netsurf-4e7b4259a44703ecc0994c922315b67df7096c90.tar.bz2 |
fix quirk stylesheet loading
Diffstat (limited to 'render/html.c')
-rw-r--r-- | render/html.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/render/html.c b/render/html.c index 2e4e4dd04..7414ceda0 100644 --- a/render/html.c +++ b/render/html.c @@ -287,6 +287,12 @@ dom_default_action_DOMSubtreeModified_cb(struct dom_event *evt, void *pw) * selects a callback function for libdom to call based on the type and phase. * dom_default_action_phase from events/document_event.h * + * The principle events are: + * DOMSubtreeModified + * DOMAttrModified + * DOMNodeInserted + * DOMNodeInsertedIntoDocument + * * @return callback function pointer or NULL for none */ static dom_default_action_callback @@ -1508,10 +1514,30 @@ static void html_object_refresh(void *p) static bool html_convert(struct content *c) { html_content *htmlc = (html_content *) c; + dom_exception exc; /* returned by libdom functions */ + + /* The quirk check and associated stylesheet fetch is "safe" + * once the root node has been inserted into the document + * which must have happened by this point in the parse. + * + * faliure to retrive the quirk mode or to start the + * stylesheet fetch is non fatal as this "only" affects the + * render and it would annoy the user to fail the entire + * render for want of a quirks stylesheet. + */ + exc = dom_document_get_quirks_mode(htmlc->document, &htmlc->quirks); + if (exc == DOM_NO_ERR) { + html_css_quirks_stylesheets(htmlc); + LOG(("quirks set to %d", htmlc->quirks)); + } htmlc->base.active--; /* the html fetch is no longer active */ LOG(("%d fetches active", htmlc->base.active)); + /* The parse cannot be completed here because it may be paused + * untill all the resources being fetched have completed. + */ + /* if there are no active fetches in progress no scripts are * being fetched or they completed already. */ @@ -1549,7 +1575,6 @@ html_begin_conversion(html_content *htmlc) return false; } - /* complete script execution */ html_scripts_exec(htmlc); @@ -1557,14 +1582,6 @@ html_begin_conversion(html_content *htmlc) * the Document. */ - /* quirks mode */ - exc = dom_document_get_quirks_mode(htmlc->document, &htmlc->quirks); - if (exc != DOM_NO_ERR) { - LOG(("error retrieving quirks")); - /** @todo should this be fatal to the conversion? */ - } - LOG(("quirks set to %d", htmlc->quirks)); - /* get encoding */ if (htmlc->encoding == NULL) { const char *encoding; |