Resolve relative URLs in inline CSS relative to document's base URL, rather than its content URL.

This means passing the base URL as the URL param to LibCSS's
css_stylesheet_create, rather than the URL of the source of
the style data.
This commit is contained in:
Michael Drake 2014-09-18 18:07:52 +01:00
parent 1878bc88a9
commit 35f7f2b9f3
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ static css_select_handler selection_handler = {
* \param data Source data
* \param len Length of data in bytes
* \param charset Charset of data, or NULL if unknown
* \param url URL of document containing data
* \param url Base URL of document containing data
* \param allow_quirks True to permit CSS parsing quirks
* \return Pointer to stylesheet, or NULL on failure.
*/

View File

@ -1338,7 +1338,7 @@ css_select_results *box_get_style(html_content *c,
(const uint8_t *) dom_string_data(s),
dom_string_byte_length(s),
c->encoding,
nsurl_access(content_get_url(&c->base)),
nsurl_access(c->base_url),
c->quirks != DOM_DOCUMENT_QUIRKS_MODE_NONE);
dom_string_unref(s);