Hi Jeremy, On Wed, Mar 26, 2008 at 10:23:48PM +0000, Jeremy Henty wrote:
OK, I've figured out the problem and (as usual) my first thoughts were completely wrong. I'm not sure what the fix is, though.
If the page contains a meta tag that changes the Content-Type then Dillo re-opens the URL. This calls Layout::removeWidget(), which in turn calls Layout::setAnchor(NULL). Ouch! If the URL contained a fragment then the anchor is lost. Worse, the anchor doesn't get restored because the URL is flagged as "just reloading" before it is reopened. The result is that the anchor mysteriously stops working.
Commenting out the call to Layout::setAnchor(NULL) in Layout::removeWidget() fixes the bug and doesn't seem to break anything else, but I'm not convinced it's the right thing to do. If it's not then I don't know what is: I already tried tweaking things so that the reload goes down the same code path as the initial load, but that just caused crashes everywhere.
I'd really like to fix this as it regularly breaks pages for me, but I don't know the code well enough to sure I've got it right.
Thanks for all the information. In fact, repush is an after thought, and some parts of nav also need some re-work. The API, IIRC pushing #fragment URLs to the stack has some anomalies too. It'd be good to find/design a single path to handle it (experience shows multiple paths is asking for trouble :). I've looked at it and it seems like deep analysis is required. I'm reviewing a few patches now. I'll work on it again when I find some time. -- Cheers Jorge.-