Re: WebKit and saving position through a reload
Re: WebKit and saving position through a reload
- Subject: Re: WebKit and saving position through a reload
- From: "Jonathan 'Wolf' Rentzsch" <email@hidden>
- Date: Tue, 6 Jul 2004 18:36:57 -0500
Lawrence Cabusora, email@hidden, wrote:
>
My problem is this: Because the WebView/WebFrame/whatever loads a new
>
string every time there is a change, the view defaults to the top of
>
the page with every keypress. This is not the same behavior as, say,
>
hitting the "Reload" button in Safari; there, Safari appears to
>
(usually) try to retain the same approximate view position in the
>
webpage, instead of going back to the top. This behavior is what I
>
would like to emulate, but I am not well-versed in the vagaries of
>
WebKit, and I really have no idea how I would go about doing that.
from
<
http://rescomp.stanford.edu/~ejalbert/mt/mt-comments.cgi?entry_id=1198>:
>
Have a look at SubEthaEdit. Here we faced the same problem and came up
>
with a simple solution.
>
>
In fact it's very easy with the WebKit. When you reload:
>
- Search for the correct ScrollView in the WebView
>
- remember its documentVisibleRect
>
- reload webview
>
>
on callback of the didFinishLoad:
>
- go to the correct ScrollView
>
- scrollRectToVisible
>
>
Voila. We never would have thought of shipping SubEthaEdit with the
>
WebPreview without this, because it's quite unusable if you really want to
>
work with it. It's a shame BBEdit does not get it right, but well, this on
>
of the reasons why we did SubEthaEdit in the first place.
| Jonathan 'Wolf' Rentzsch
http://rentzsch.com
| Red Shed Software
http://redshed.net
| "better" necessarily means "different"
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.