Bug 20191 - [Qt] Hitting enter/return doesn't create new list items as in other WebKit ports.
Summary: [Qt] Hitting enter/return doesn't create new list items as in other WebKit po...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Tor Arne Vestbø
URL: http://rtef.info/demo.htm or http://t...
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2008-07-27 22:02 PDT by Erik L. Bunce
Modified: 2008-08-05 06:42 PDT (History)
0 users

See Also:


Attachments
Patch to change VK_RETURN handling from InsertLineBreak to InsertNewline (1.32 KB, patch)
2008-07-27 22:03 PDT, Erik L. Bunce
no flags Details | Formatted Diff | Diff
Improved patch handles Shift + Return properly. (1.44 KB, patch)
2008-07-28 10:22 PDT, Erik L. Bunce
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik L. Bunce 2008-07-27 22:02:00 PDT
This problem still exists in SVN r35406.

Creating either an ordered or unordered list in (TinyMCE, RTEF, or otherwise) doesn't work as expected using the Qt build of WebKit.  In Safari and using the Mac OS X native build, Enter/Return result in a new list item being created, however it inserts a line break.

This is caused by the VK_RETURN handling in Qt WebKit  calling the InsertLineBreak instead of InsertNewline command.
Comment 1 Erik L. Bunce 2008-07-27 22:03:04 PDT
Created attachment 22516 [details]
Patch to change VK_RETURN handling from InsertLineBreak to InsertNewline
Comment 2 Tor Arne Vestbø 2008-07-28 07:30:13 PDT
This should probably be handled in QWebPage::editorActionForKeyEvent(), but might require changes in Qt. I'm looking into it.

We also need to make sure we exec InsertLineBreak when the shift modifier is pressed (ctrl on mac).
Comment 3 Erik L. Bunce 2008-07-28 09:54:40 PDT
I agree about the Shift / CTRL modifier.  Also that long-term a lot of EditorClientQt::handleKeyboardEvent() should be refactored, and that comparison/dispatch using QKeySequence would be a better way to go. However, I'm not sure wholesale moving it to use QWebPage::editorActionForKeyEvent() is the correct solution either, unless you wish to expose most / all of the necessary commands as QWebPage::WebActions.
Comment 4 Erik L. Bunce 2008-07-28 10:22:56 PDT
Created attachment 22523 [details]
Improved patch handles Shift + Return properly.
Comment 5 Erik L. Bunce 2008-07-28 22:38:48 PDT
Looking at the sequences in question, making them QPage::WebActions might not be a bad idea.

I'd still probably separate the edit vs. 'nav' action lookups.
Comment 6 Tor Arne Vestbø 2008-07-29 04:48:17 PDT
Preliminary patch (requires a > 1. August Qt snapshot):

http://code.staikos.net/cgi-bin/gitweb.cgi?p=webkit;a=commitdiff;h=fb313a86b2565637593c8b5b497c28b9ae763b1a
Comment 7 Tor Arne Vestbø 2008-07-29 06:17:08 PDT
Updated patch. This one should build against Qt 4.4 too (by using the approach of patch 22523). Thanks for contributing!

http://code.staikos.net/cgi-bin/gitweb.cgi?p=webkit;a=commitdiff;h=7d2f6e54672ca4d0c3fd4541ad59e4f32db981cc
Comment 8 Erik L. Bunce 2008-07-29 21:55:12 PDT
Heh, the one correction I'd make is that my name is Erik with a k at the end.  ;-)
Comment 9 Tor Arne Vestbø 2008-08-05 06:42:32 PDT
Landed in r35558, with a k at the end :)

Thanks!