On Sat, 22 May 2004, Sebastian Geerken wrote:
On Fri, May 21, Jorge Arellano Cid wrote:
[...] Actually it's not the changes to the parser, but to dw_page.c. If you pick a vanilla 0.8.1 and apply:
+ if (page->words[nw].orig_space != 0) { + /* We have already a space, add a blank word before. */ + a_Dw_page_add_text (page, g_strdup(""), style); + nw = page->num_words - 1; + }
It will render the black row, even on the splash page.
Interestingly, if you take the modifications in html.c, without the modifications in dw_page.c, everything works: the table above is rendered correctly, the other tables are centered, and even the page "underline-strike-and-spaces.html" looks like we want it to look like.
Funny! I found a render fault on the HTML-4.01 sec 9.1 page (as a test case). There was a missing space in "(calledinter-word space)" and in "user agents shouldcollapse input". I Fixed that, and uploaded to CVS. Not to say this is _the_ way to do the parsing, but as it does better than the former code, let it be. The question of how to do it properly remains open... (I'm yet to study the parser in the CSS prototype)
Actually, the modifications in html.c should make the modifications in dw_page.c obsolete, since the latters handle the case that a_Dw_page_add_space is called twice in sucsession, without any new words between them. I would have thought that the modified HTML parser should avoid exactly this, but this does not seem the case. It would be interesting to insert the line
g_return_if_fail (page->words[nw].orig_space != 0);
instead of the code, which is inserted by the patch, and start dillo in gdb with the option "--g-fatal-warnings", to see, under which circumstances the code would have been called.
I uploaded this test code to CVS: + /* todo: remove this test case */ + if (page->words[nw].orig_space != 0) { + g_warning("a_Dw_page_add_space:: already existing space!!!\n"); + } and found an interesting test case: <table> <tr> <td> <table> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> </table> </td> </tr> </table> This code triggers one warning message, from the "<td>3</td>" line. If you remove it, there's no warning anymore. The funny part is that the "offending" line is the same that the former two (as the parser is concerned), but only the last one triggers the warning. Moreover, if you add a "<td>4</td>" line, there'll be two warnings! HTH Jorge.-