Re: Strange performance behaviour related to <span>

"Sebastian Geerken" <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
On Mo, Jun 06, 2016, Jorge Arellano Cid wrote:
> On Sun, Jun 05, 2016 at 11:34:13PM +0200, Sebastian Geerken wrote:
> > Hi!
> > 
> > I've stripped down one testcase to a sequence of simple HTML snippets.
> > Try
> > 
> > (for i in $(seq 1 20); do echo '<div style="float:left"><div></div><div style="display:table"><span></div></div>'; done) > tmp.html; dillo tmp.html
> > 
> > and the development version of dillo hangs for a while. You may vary
> > the number (second argument of seq).
> > 
> > If you look at the file tmp.html, you'll notice that it is incorrect
> > HTML. Interrestinly, leaving the <span> away still results in
> > incorrect and deeply nested HTML, but dillo is much faster:
> > 
> > (for i in $(seq 1 20); do echo '<div style="float:left"><div></div><div style="display:table"></div></div>'; done) > tmp.html; dillo tmp.html
> > 
> > Dillo 3.0.5 is fast in both cases.
> > 
> > Does anyone have an idea what effect the <span> has?
> > 
> > I've already run gprof, but the result does not look very meaningful
> > at a first glance.
> 
>   OK, after some experiments I see what happens.
> 
>   If you close the SPAN element, it's fast again.
> 
>   The problem lies in how the parser handles bad HTML, and how
> the rendering deals with it afterwards.
> 
>   In this case the span is left open, and so we end with an anomalous
> tree where an inline container has 20 levels of block containers
> inside inline containers.

I thought something like this.
 
>   You can surely imagine the mess textblock and OOFM get trapped-in
> when trying to make sense of it all! :)

Still, Dw should handle this. Look at this example:

(for i in $(seq 1 20); do echo '<div style="float:left"><div></div><div style="display:table"></div>'; done) > tmp.html; src/dillo tmp.html

Here, only some <div>s at the end are open (and it is simple to make
the snippet correct HTML), but it still takes much time. This looks
still like a Dw problem, especially since it is much faster if you
leave the float definition away.

>   Good news, I already have a working patch.
> 
>   It needs some testing because it constitutes a big change in how
> we deal with bad-formed HTML, but so far it makes more sense than what
> we have now.
> 
>   If you need the patch quick just drop me a note.

Take your time.

Sebastian

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev
signature.asc (application/pgp-signature, 473 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJXVdlbAAoJEAw7+YHB+ZL6Pb0H/iGUeYWw4LPryRw6qorctpbi
HFztAqJWcP1MFuDJveEgIFeCmX4Ba+vmsRdZdl2ZG+K7SO9SeTCAV/7x3pJMeZSm
byNb6T9ZOUf14W4s0wJtTP4U22uTEcnSAJ2O4j/1yy0CxzzKn+OV5XJhaewpwFlx
OLnLJGQ4t0jLpu4BMNAdvzHDL2xOz6BIyUGCNP7LBS665vtB83UMvmk+XLLJQpkk
MKPKaxlL4xq6hOGtf2vdEmAtxiOyxMAp21bF0r4fhdpqV8ww0NaV1YGkAp9t2AtI
UqTONypAOMRwQQoUVfdZE09q42HF7glTlp8pLyICCGU6jFnObXiZjGgc1XinxEU=
=rgQP
-----END PGP SIGNATURE-----
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.