On Sun, Sep 28, 2008 at 09:20:17PM +0200, Johannes Hofmann wrote:
On Sun, Sep 28, 2008 at 02:54:56PM -0400, Jorge Arellano Cid wrote:
On Sun, Sep 28, 2008 at 05:55:10PM +0000, corvid wrote:
Encouraged by the idea that I am going in the right direction, I have made a new one with spaceStyle:
Funny how we were working on the same patch a the same time!
I had an ancient version, and gave it a review. The link search is linear inside textblock. A linux gazette page showed more than 33000 words to color a link. On bigger pages it may be worst. It depends on the structure. For instance our bookmarks uses tables and the link is usually found in less than 10 words.
The patch in CVS reduce the 35000 steps to 1500 or so (the sorted link list is sparse, so there's a penalty for looking for an actual link to compare to).
Not sure I understand this optimization. It is assuming that link numbers are always increasing, right?
Right.
Can we assume this in dw/*?
I checked html.cc and x_link is crescent. Not sure about the rest.
src/html.cc seems to be implemented currently in way that this is true. But perhaps we could/should reuse link numbers for equal destination urls in the future?
In that case it'd need a revision.
Or someone might just choose hashes of the url string as link number.
BTW. with both implementations I now see issues with this example:
<html> <body> <a href="http://www.dillo.org">dillo</a> <a href="http://slashdot.org">slashdot</a> <a href="http://www.dillo.org">dillo</a> </body> </html>
When opening the first link in a new window, it doesn't change color in the original one. When opening it in a tab, the first one changes color. After a reload also the second one changes color. Am I missing something?
Yes, the link color change is meant as a visual cue for the user to know the click is being processed. We could leave the link alone and change the mouse cursor instead. The link not changing color when openning it with the menu is IMO a bug, I'm looking for... BTW, the linear search patch is much simpler and as link clicking is not a performance critical task it could be left implemented in O(n). -- Cheers Jorge.-