Gitweb links:

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

The branch, master has been updated
       via  9d8f37ca10c35fea81caa08369c236722ebff9d5 (commit)
      from  d54e0461adafd79ca5d56e57e7816e2b9b56878c (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=9d8f37ca10c35fea81caa08369c236722ebff9d5
commit 9d8f37ca10c35fea81caa08369c236722ebff9d5
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    HTML: Don't try to finish an HTML document's conversion twice.

diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index f721b98..62f625f 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -585,6 +585,22 @@ void html_finish_conversion(html_content *htmlc)
                return;
        }
 
+       /* If we already have a selection context, then we have already
+        * "finished" conversion.  We can get here twice if e.g. some JS
+        * adds a new stylesheet, and the stylesheet gets added after
+        * the HTML content is initially finished.
+        *
+        * If we didn't do this, the HTML content would try to rebuild the
+        * box tree for the html content when this new stylesheet is ready.
+        * NetSurf has no concept of dynamically changing documents, so this
+        * would break badly.
+        */
+       if (htmlc->select_ctx != NULL) {
+               NSLOG(netsurf, INFO,
+                               "Ignoring style change: NS layout is static.");
+               return;
+       }
+
        /* create new css selection context */
        error = html_css_new_selection_context(htmlc, &htmlc->select_ctx);
        if (error != NSERROR_OK) {


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

Summary of changes:
 content/handlers/html/html.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index f721b98..62f625f 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -585,6 +585,22 @@ void html_finish_conversion(html_content *htmlc)
                return;
        }
 
+       /* If we already have a selection context, then we have already
+        * "finished" conversion.  We can get here twice if e.g. some JS
+        * adds a new stylesheet, and the stylesheet gets added after
+        * the HTML content is initially finished.
+        *
+        * If we didn't do this, the HTML content would try to rebuild the
+        * box tree for the html content when this new stylesheet is ready.
+        * NetSurf has no concept of dynamically changing documents, so this
+        * would break badly.
+        */
+       if (htmlc->select_ctx != NULL) {
+               NSLOG(netsurf, INFO,
+                               "Ignoring style change: NS layout is static.");
+               return;
+       }
+
        /* create new css selection context */
        error = html_css_new_selection_context(htmlc, &htmlc->select_ctx);
        if (error != NSERROR_OK) {


-- 
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