Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/a03b4a3c14768b262547ebc64b12b12f09910eef
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/a03b4a3c14768b262547ebc64b12b12f09910eef
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/a03b4a3c14768b262547ebc64b12b12f09910eef

The branch, master has been updated
       via  a03b4a3c14768b262547ebc64b12b12f09910eef (commit)
       via  920d6fa23dcf954a280812feeae4baf02fcaeb57 (commit)
       via  637b4e5fc0ddb5db17b09778567cbad373d36beb (commit)
      from  19b45fb494358838be8b3175fde9e3ab55ef5bfa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=a03b4a3c14768b262547ebc64b12b12f09910eef
commit a03b4a3c14768b262547ebc64b12b12f09910eef
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    CSS: Update for change to libcss append sheet API.
    
    When appending stylesheets to the selection context, it now
    takes the media query string associated with the sheet, rather
    than the type bitfield.
    
    TODO:
    
    We need to pass all the sheets in, with their full media
    query string, rather than filtering it ourselves and setting
    the ones we pass in to "screen".
    
    Signed-off-by: Michael Drake <[email protected]>

diff --git a/content/handlers/html/html_css.c b/content/handlers/html/html_css.c
index 7b2d469..2a2fde6 100644
--- a/content/handlers/html/html_css.c
+++ b/content/handlers/html/html_css.c
@@ -631,6 +631,9 @@ html_css_new_selection_context(html_content *c, 
css_select_ctx **ret_select_ctx)
                css_origin origin = CSS_ORIGIN_AUTHOR;
 
                /* Filter out stylesheets for non-screen media. */
+               /* TODO: We should probably pass the sheet in anyway, and let
+                *       libcss handle the filtering.
+                */
                if (hsheet->unused) {
                        continue;
                }
@@ -646,10 +649,13 @@ html_css_new_selection_context(html_content *c, 
css_select_ctx **ret_select_ctx)
                }
 
                if (sheet != NULL) {
+                       /* TODO: Pass the sheet's full media query, instead of
+                        *       "screen".
+                        */
                        css_ret = css_select_ctx_append_sheet(select_ctx,
                                                              sheet,
                                                              origin,
-                                                             CSS_MEDIA_SCREEN);
+                                                             "screen");
                        if (css_ret != CSS_OK) {
                                css_select_ctx_destroy(select_ctx);
                                return css_error_to_nserror(css_ret);


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=920d6fa23dcf954a280812feeae4baf02fcaeb57
commit 920d6fa23dcf954a280812feeae4baf02fcaeb57
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    CSS: Update for change to libcss select style API.
    
    LibCSS now takes the client media spec, rather than just the
    media type we're selecting for.
    
    Signed-off-by: Michael Drake <[email protected]>

diff --git a/content/handlers/css/select.c b/content/handlers/css/select.c
index ee79eb3..99840e9 100644
--- a/content/handlers/css/select.c
+++ b/content/handlers/css/select.c
@@ -255,7 +255,7 @@ static void nscss_dom_user_data_handler(dom_node_operation 
operation,
  *         or NULL on failure
  */
 css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n,
-               uint64_t media, const css_stylesheet *inline_style)
+               const css_media *media, const css_stylesheet *inline_style)
 {
        css_computed_style *composed;
        css_select_results *styles;
diff --git a/content/handlers/css/select.h b/content/handlers/css/select.h
index 9fa6d3a..b45d1ed 100644
--- a/content/handlers/css/select.h
+++ b/content/handlers/css/select.h
@@ -45,7 +45,7 @@ css_stylesheet *nscss_create_inline_style(const uint8_t 
*data, size_t len,
                const char *charset, const char *url, bool allow_quirks);
 
 css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n,
-               uint64_t media, const css_stylesheet *inline_style);
+               const css_media *media, const css_stylesheet *inline_style);
 
 css_computed_style *nscss_get_blank_style(nscss_select_ctx *ctx,
                const css_computed_style *parent);
diff --git a/content/handlers/html/box_construct.c 
b/content/handlers/html/box_construct.c
index e7ac811..eb3bba7 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -1373,7 +1373,7 @@ css_select_results *box_get_style(html_content *c,
        ctx.parent_style = parent_style;
 
        /* Select style for element */
-       styles = nscss_get_style(&ctx, n, CSS_MEDIA_SCREEN, inline_style);
+       styles = nscss_get_style(&ctx, n, &c->media, inline_style);
 
        /* No longer need inline style */
        if (inline_style != NULL)
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 30af90f..9c60c7b 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -950,6 +950,7 @@ html_create_html_data(html_content *c, const http_parameter 
*params)
        c->stylesheet_count = 0;
        c->stylesheets = NULL;
        c->select_ctx = NULL;
+       c->media.type = CSS_MEDIA_SCREEN;
        c->universal = NULL;
        c->num_objects = 0;
        c->object_list = NULL;
diff --git a/content/handlers/html/html_internal.h 
b/content/handlers/html/html_internal.h
index a4ae1da..2ba96f0 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -156,6 +156,8 @@ typedef struct html_content {
        struct html_stylesheet *stylesheets;
        /**< Style selection context */
        css_select_ctx *select_ctx;
+       /**< Style selection media specification */
+       css_media media;
        /**< Universal selector */
        lwc_string *universal;
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=637b4e5fc0ddb5db17b09778567cbad373d36beb
commit 637b4e5fc0ddb5db17b09778567cbad373d36beb
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    CSS: Update for change to libcss imported sheet API.
    
    The media is not exposed and sent back into libcss now.
    
    Signed-off-by: Michael Drake <[email protected]>

diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c
index 93efd6a..dda044d 100644
--- a/content/handlers/css/css.c
+++ b/content/handlers/css/css.c
@@ -98,7 +98,7 @@ static void nscss_destroy_css_data(struct content_css_data 
*c);
 
 static void nscss_content_done(struct content_css_data *css, void *pw);
 static css_error nscss_handle_import(void *pw, css_stylesheet *parent,
-               lwc_string *url, uint64_t media);
+               lwc_string *url);
 static nserror nscss_import(hlcache_handle *handle,
                const hlcache_event *event, void *pw);
 static css_error nscss_import_complete(nscss_import_ctx *ctx);
@@ -512,11 +512,10 @@ void nscss_content_done(struct content_css_data *css, 
void *pw)
  * \param pw      CSS object requesting the import
  * \param parent  Stylesheet requesting the import
  * \param url     URL of the imported sheet
- * \param media   Applicable media for the imported sheet
  * \return CSS_OK on success, appropriate error otherwise
  */
 css_error nscss_handle_import(void *pw, css_stylesheet *parent,
-               lwc_string *url, uint64_t media)
+               lwc_string *url)
 {
        content_type accept = CONTENT_CSS;
        struct content_css_data *c = pw;
@@ -562,7 +561,6 @@ css_error nscss_handle_import(void *pw, css_stylesheet 
*parent,
        }
 
        /* Create content */
-       c->imports[c->import_count].media = media;
 
        /** \todo Why aren't we getting a relative url part, to join? */
        nerror = nsurl_create(lwc_string_data(url), &ns_url);
diff --git a/content/handlers/css/css.h b/content/handlers/css/css.h
index 4b38829..5e2b64a 100644
--- a/content/handlers/css/css.h
+++ b/content/handlers/css/css.h
@@ -32,7 +32,6 @@ struct hlcache_handle;
  */
 struct nscss_import {
        struct hlcache_handle *c;       /**< Content containing sheet */
-       uint64_t media;         /**< Media types that sheet applies to */
 };
 
 /**


-----------------------------------------------------------------------

Summary of changes:
 content/handlers/css/css.c            |    6 ++----
 content/handlers/css/css.h            |    1 -
 content/handlers/css/select.c         |    2 +-
 content/handlers/css/select.h         |    2 +-
 content/handlers/html/box_construct.c |    2 +-
 content/handlers/html/html.c          |    1 +
 content/handlers/html/html_css.c      |    8 +++++++-
 content/handlers/html/html_internal.h |    2 ++
 8 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c
index 93efd6a..dda044d 100644
--- a/content/handlers/css/css.c
+++ b/content/handlers/css/css.c
@@ -98,7 +98,7 @@ static void nscss_destroy_css_data(struct content_css_data 
*c);
 
 static void nscss_content_done(struct content_css_data *css, void *pw);
 static css_error nscss_handle_import(void *pw, css_stylesheet *parent,
-               lwc_string *url, uint64_t media);
+               lwc_string *url);
 static nserror nscss_import(hlcache_handle *handle,
                const hlcache_event *event, void *pw);
 static css_error nscss_import_complete(nscss_import_ctx *ctx);
@@ -512,11 +512,10 @@ void nscss_content_done(struct content_css_data *css, 
void *pw)
  * \param pw      CSS object requesting the import
  * \param parent  Stylesheet requesting the import
  * \param url     URL of the imported sheet
- * \param media   Applicable media for the imported sheet
  * \return CSS_OK on success, appropriate error otherwise
  */
 css_error nscss_handle_import(void *pw, css_stylesheet *parent,
-               lwc_string *url, uint64_t media)
+               lwc_string *url)
 {
        content_type accept = CONTENT_CSS;
        struct content_css_data *c = pw;
@@ -562,7 +561,6 @@ css_error nscss_handle_import(void *pw, css_stylesheet 
*parent,
        }
 
        /* Create content */
-       c->imports[c->import_count].media = media;
 
        /** \todo Why aren't we getting a relative url part, to join? */
        nerror = nsurl_create(lwc_string_data(url), &ns_url);
diff --git a/content/handlers/css/css.h b/content/handlers/css/css.h
index 4b38829..5e2b64a 100644
--- a/content/handlers/css/css.h
+++ b/content/handlers/css/css.h
@@ -32,7 +32,6 @@ struct hlcache_handle;
  */
 struct nscss_import {
        struct hlcache_handle *c;       /**< Content containing sheet */
-       uint64_t media;         /**< Media types that sheet applies to */
 };
 
 /**
diff --git a/content/handlers/css/select.c b/content/handlers/css/select.c
index ee79eb3..99840e9 100644
--- a/content/handlers/css/select.c
+++ b/content/handlers/css/select.c
@@ -255,7 +255,7 @@ static void nscss_dom_user_data_handler(dom_node_operation 
operation,
  *         or NULL on failure
  */
 css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n,
-               uint64_t media, const css_stylesheet *inline_style)
+               const css_media *media, const css_stylesheet *inline_style)
 {
        css_computed_style *composed;
        css_select_results *styles;
diff --git a/content/handlers/css/select.h b/content/handlers/css/select.h
index 9fa6d3a..b45d1ed 100644
--- a/content/handlers/css/select.h
+++ b/content/handlers/css/select.h
@@ -45,7 +45,7 @@ css_stylesheet *nscss_create_inline_style(const uint8_t 
*data, size_t len,
                const char *charset, const char *url, bool allow_quirks);
 
 css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n,
-               uint64_t media, const css_stylesheet *inline_style);
+               const css_media *media, const css_stylesheet *inline_style);
 
 css_computed_style *nscss_get_blank_style(nscss_select_ctx *ctx,
                const css_computed_style *parent);
diff --git a/content/handlers/html/box_construct.c 
b/content/handlers/html/box_construct.c
index e7ac811..eb3bba7 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -1373,7 +1373,7 @@ css_select_results *box_get_style(html_content *c,
        ctx.parent_style = parent_style;
 
        /* Select style for element */
-       styles = nscss_get_style(&ctx, n, CSS_MEDIA_SCREEN, inline_style);
+       styles = nscss_get_style(&ctx, n, &c->media, inline_style);
 
        /* No longer need inline style */
        if (inline_style != NULL)
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 30af90f..9c60c7b 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -950,6 +950,7 @@ html_create_html_data(html_content *c, const http_parameter 
*params)
        c->stylesheet_count = 0;
        c->stylesheets = NULL;
        c->select_ctx = NULL;
+       c->media.type = CSS_MEDIA_SCREEN;
        c->universal = NULL;
        c->num_objects = 0;
        c->object_list = NULL;
diff --git a/content/handlers/html/html_css.c b/content/handlers/html/html_css.c
index 7b2d469..2a2fde6 100644
--- a/content/handlers/html/html_css.c
+++ b/content/handlers/html/html_css.c
@@ -631,6 +631,9 @@ html_css_new_selection_context(html_content *c, 
css_select_ctx **ret_select_ctx)
                css_origin origin = CSS_ORIGIN_AUTHOR;
 
                /* Filter out stylesheets for non-screen media. */
+               /* TODO: We should probably pass the sheet in anyway, and let
+                *       libcss handle the filtering.
+                */
                if (hsheet->unused) {
                        continue;
                }
@@ -646,10 +649,13 @@ html_css_new_selection_context(html_content *c, 
css_select_ctx **ret_select_ctx)
                }
 
                if (sheet != NULL) {
+                       /* TODO: Pass the sheet's full media query, instead of
+                        *       "screen".
+                        */
                        css_ret = css_select_ctx_append_sheet(select_ctx,
                                                              sheet,
                                                              origin,
-                                                             CSS_MEDIA_SCREEN);
+                                                             "screen");
                        if (css_ret != CSS_OK) {
                                css_select_ctx_destroy(select_ctx);
                                return css_error_to_nserror(css_ret);
diff --git a/content/handlers/html/html_internal.h 
b/content/handlers/html/html_internal.h
index a4ae1da..2ba96f0 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -156,6 +156,8 @@ typedef struct html_content {
        struct html_stylesheet *stylesheets;
        /**< Style selection context */
        css_select_ctx *select_ctx;
+       /**< Style selection media specification */
+       css_media media;
        /**< Universal selector */
        lwc_string *universal;
 


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to