Re: Render bug

"corvid" <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <20121231195211.GA31659@local>
Alexander wrote:
> Dear Dillo developers,
> 
> sorry for not creating a proper bug report, but the "How to reproduce"
> message field is too small for the example file.  :)
> 
> The issue
> =========
> 
> After closing the "Save As" dialog, the background color of the HTML
> page is not redrawn correctly (leaving white rectangles instead of the
> background color).
> 
> How to reproduce
> ================
> 
> 1. open the appended html file (note the grey background)
> 2. click on "file" link
> 3. move the "Save As" window over the grey background
> 4. close the "Save As" window --> parts of the background are drawn
>    white, instead of grey

What if we do something like the attached? We might be able to get away
with a smaller fix, but this seemed sensible conceptually.

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
viewer_layout_appearance.diff (text/plain, 2.8 KB)
diff -r cf48458b3223 src/IO/mime.c
--- a/src/IO/mime.c	Mon Dec 31 01:26:15 2012 +0000
+++ b/src/IO/mime.c	Mon Dec 31 19:45:46 2012 +0000
@@ -116,16 +116,14 @@
 
 
 /*
- * Call the handler for the MIME type to set Call and Data as appropriate
+ * Get the handler for the MIME type.
  *
  * Return Value:
- *   On success: a new Dw (and Call and Data properly set).
- *   On failure: NULL (and Call and Data untouched).
+ *   On success: viewer
+ *   On failure: NULL
  */
-void *a_Mime_set_viewer(const char *content_type, void *Ptr,
-                        CA_Callback_t *Call, void **Data)
+Viewer_t a_Mime_get_viewer(const char *content_type)
 {
-
    Viewer_t viewer;
    uint_t MinSize, MajSize, i;
    const char *str = content_type;
@@ -137,16 +135,9 @@
    }
    MinSize = i;
 
-   /* Try minor type */
    viewer = Mime_minor_type_fetch(content_type, MinSize);
-   if (viewer)
-      return viewer(content_type, Ptr, Call, Data);
+   if (!viewer)
+      viewer = Mime_major_type_fetch(content_type, MajSize);
 
-   /* Try major type */
-   viewer = Mime_major_type_fetch(content_type, MajSize);
-   if (viewer)
-      return viewer(content_type, Ptr, Call, Data);
-
-   /* Type not handled */
-   return NULL;
+   return viewer;
 }
diff -r cf48458b3223 src/IO/mime.h
--- a/src/IO/mime.h	Mon Dec 31 01:26:15 2012 +0000
+++ b/src/IO/mime.h	Mon Dec 31 19:45:46 2012 +0000
@@ -41,8 +41,7 @@
  * Functions defined inside Mime module
  */
 void a_Mime_init(void);
-void *a_Mime_set_viewer(const char *content_type, void *Ptr,
-                        CA_Callback_t *Call, void **Data);
+Viewer_t a_Mime_get_viewer(const char *content_type);
 
 #ifdef __cplusplus
 }
diff -r cf48458b3223 src/web.cc
--- a/src/web.cc	Mon Dec 31 01:26:15 2012 +0000
+++ b/src/web.cc	Mon Dec 31 19:45:46 2012 +0000
@@ -60,6 +60,9 @@
 
    if (Web->flags & WEB_RootUrl) {
       /* We have RootUrl! */
+      Viewer_t viewer = a_Mime_get_viewer(Type);
+      if (viewer == NULL)
+         return -1;
 
       style::Color *bgColor = style::Color::create (layout, prefs.bg_color);
       Web->bgColor = bgColor->getColor ();
@@ -69,7 +72,7 @@
       StyleEngine styleEngine (layout);
       styleEngine.startElement ("body");
 
-      dw = (Widget*) a_Mime_set_viewer(Type, Web, Call, Data);
+      dw = (Widget*) viewer(Type, Web, Call, Data);
       if (dw == NULL)
          return -1;
 
@@ -96,7 +99,8 @@
    } else {
       /* A non-RootUrl. At this moment we only handle image-children */
       if (!dStrnAsciiCasecmp(Type, "image/", 6)) {
-         dw = (Widget*) a_Mime_set_viewer(Type, Web, Call, Data);
+         Viewer_t viewer = a_Mime_get_viewer(Type);
+         dw = (Widget*) viewer(Type, Web, Call, Data);
       } else {
          MSG_HTTP("'%s' cannot be displayed as image; has media type '%s'\n",
                   URL_STR(Web->url), Type);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.