Bug 5911 - REGRESSION: Page scroll position jumps when clicking on word in editable div
Summary: REGRESSION: Page scroll position jumps when clicking on word in editable div
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Adele Peterson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-01 17:15 PST by Dan Wood
Modified: 2005-12-26 14:08 PST (History)
3 users (show)

See Also:


Attachments
Reduced Test Case: HTML, stylesheets, javascript needed to reproduce (6.17 KB, text/html)
2005-12-01 17:16 PST, Dan Wood
no flags Details
patch (26.48 KB, patch)
2005-12-21 00:17 PST, Adele Peterson
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Wood 2005-12-01 17:15:58 PST
Steps:
* Take the attached reduced test case, and open in a TOT browser with the window short enough to 
have a vertical scrollbar.
* Click (or double-click) on a word somewhere in the body text (which is marked as contentEditable)

What should happen:
* You should enter editing mode without having the scroll position jump.  Very disconcerting, especially 
if it was a double-click and you expected to select a word!)

What actually happens:
* Scroll position jumps so that the top of the editable div is at the top of the webview.

Analysis:

Somebody was probably trying to be helpful by maximizing the amount of text you can see when you 
begin editing.  But the jump is annoying, and more confusing.

The scroll jump does not happen when you are scrolled way down in the text and the entire webview is 
filled with the editable div.
Comment 1 Dan Wood 2005-12-01 17:16:31 PST
Created attachment 4899 [details]
Reduced Test Case: HTML, stylesheets, javascript needed to reproduce
Comment 2 Alexey Proskuryakov 2005-12-02 14:16:29 PST
Bumping priority to P1 (regression from the latest released version).

Goes via this code path: <http://www.opendarwin.org/pipermail/webkit-changes/2005-October/
001356.html>
Comment 3 Adele Peterson 2005-12-02 14:37:42 PST
I'll take this one.

Right now the scrolling code is getting triggered by setFocusNode when you click on the div.  I think we 
need to move the call to scrollRectToVisible so we can be more precise about what kind of scrolling 
behavior we want depending on what caused the node to be focused.
Comment 4 Adele Peterson 2005-12-02 17:11:50 PST
<rdar://problem/4363794> REGRESSION: Page scroll position jumps when clicking on word in editable 
div (5911)
Comment 5 Adele Peterson 2005-12-08 20:11:11 PST
I have a TOT fix for this in my tree- but I'm still working out a few kinks.
Comment 6 Adele Peterson 2005-12-21 00:17:31 PST
Created attachment 5198 [details]
patch
Comment 7 Darin Adler 2005-12-21 01:37:00 PST
Comment on attachment 5198 [details]
patch

Nice simplification, too. Looks great. r=me