Hi, FYI: I seem to have fixed the bug, expect it to be committed today. Those interested should look at the differences in the code, it is only a simple coding bug, nothing very interesting. On Fri, Jul 11, Joe Crayne wrote:
<html> <title>Selection Bug</title> <body>
<table> <tr><td><!-- empty cell --></td></tr>
<tr><td> Select beyond the end of the text and Dillo segfaults. </td></tr> <!-- missing </table> -->
</body> </html>
The reason, why the missing </table> tag matters, is that Html_close_tag_table() will insert a break after the table, which makes iterators behave different.
[...] I see 3 possible attacks on this one:
1. Add a check for NULL on the return value of a_Dw_ext_iterator_new_variant().
a_Dw_ext_iterator_new() returns NULL, if the page does not contain any non-widget contents. After it one succeeded, it should always succeed. That it does not, was a bug, and is fixed now. BTW: Actually, this is only true, as long as no contents is *removed* from the page, which does not yet happen. If it happens, the selection will anyway get more complicated, a check in this case would not make much sense.
2. Do that special empty DwExtIterator idea you mentioned.
Yes, this will probably part of 0.7.4. But in this case, you would have to compare empty with non-empty iterators ;-)
3. Make html.c clean up the <table> tag better. The missing closer probably shouldn't make a difference in this example, but the segfault only happens if the closer is missing.
Since the </table> tag is mandatory, we are not obliged to handle this. Anyway, a missing </table> tag will leave a well-defined widget tree, which the selection must be able to handle. Sebastian