Bug 50536

Summary: [Qt] Fix caret browsing navigation mode
Product: WebKit Reporter: Antonio Gomes <tonikitoo>
Component: AccessibilityAssignee: Antonio Gomes <tonikitoo>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, hausmann, kenneth, kling, mario, rniwa, webkit-ews, webkit.review.bot, yael
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on: 51235    
Bug Blocks: 50942, 47271    
Attachments:
Description Flags
patch v1
ossy: review-
(committed r74229, r=ariya) patch v2 - it builds and has no style issues. none

Description Antonio Gomes 2010-12-05 07:12:25 PST
After bug 47426 got broken in Qt and no regression test catch it because the tests are not actually test caret browsing mode.

Patch coming ...
Comment 1 Antonio Gomes 2010-12-05 07:18:45 PST
(In reply to comment #0)
> After bug 47426 got broken in Qt

"After bug 47426, caret browsing got broken in Qt..."
Comment 2 Antonio Gomes 2010-12-05 07:43:27 PST
Created attachment 75629 [details]
patch v1
Comment 3 WebKit Review Bot 2010-12-05 07:45:05 PST
Attachment 75629 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/platform/mac/Skipped', u'LayoutTests/platform/win/Skipped', u'WebKit/qt/ChangeLog', u'WebKit/qt/WebCoreSupport/EditorClientQt.cpp']" exit_code: 1
WebKit/qt/WebCoreSupport/EditorClientQt.cpp:471:  A case label should not be indented, but line up with its switch statement.  [whitespace/indent] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Early Warning System Bot 2010-12-06 02:06:36 PST
Attachment 75629 [details] did not build on qt:
Build output: http://queues.webkit.org/results/6771071
Comment 5 Csaba Osztrogonác 2010-12-06 02:51:28 PST
Comment on attachment 75629 [details]
patch v1

r- to fix the build. I can't find any occurance of isCaretBrowsingEnabled() in WebKit trunk.
Comment 6 Antonio Gomes 2010-12-06 05:06:59 PST
Created attachment 75677 [details]
(committed r74229, r=ariya) patch v2 - it builds and has no style issues.
Comment 7 Yael 2010-12-06 06:49:35 PST
Comment on attachment 75677 [details]
(committed r74229, r=ariya) patch v2 - it builds and has no style issues.

Looks good to me, sorry for the regression bug 42476 caused.
Comment 8 Antonio Gomes 2010-12-08 08:07:59 PST
Just to make reviewing simpler, patch is simple. Summary:

- it makes an already existing gtk-specific test to be a generic test, but skips it for Mac and Win, since these DRTs do not support testing caret browsing.

- It reintroduces some of the code removed in bug 47426, since in that bug we missed the caret browsing mode tests.

I am actually fixing this because it blocks fixing a conflicts between Spatial Navigation and Caret Browsing features.

Easier now anyone? :)
Comment 9 Ryosuke Niwa 2010-12-08 16:35:51 PST
Comment on attachment 75677 [details]
(committed r74229, r=ariya) patch v2 - it builds and has no style issues.

View in context: https://bugs.webkit.org/attachment.cgi?id=75677&action=review

> WebKit/qt/WebCoreSupport/EditorClientQt.cpp:479
> +                if (kevent->shiftKey() && kevent->ctrlKey())
> +                    frame->editor()->command("MoveWordBackwardAndModifySelection").execute();
> +                else if (kevent->shiftKey())
> +                    frame->editor()->command("MoveLeftAndModifySelection").execute();
> +                else if (kevent->ctrlKey())
> +                    frame->editor()->command("MoveWordBackward").execute();
> +                else
> +                    frame->editor()->command("MoveLeft").execute();

Isn't better to directly call selection controller's modify?
Comment 10 Antonio Gomes 2010-12-12 12:19:23 PST
(In reply to comment #9)
> (From update of attachment 75677 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=75677&action=review
> 
> > WebKit/qt/WebCoreSupport/EditorClientQt.cpp:479
> > +                if (kevent->shiftKey() && kevent->ctrlKey())
> > +                    frame->editor()->command("MoveWordBackwardAndModifySelection").execute();
> > +                else if (kevent->shiftKey())
> > +                    frame->editor()->command("MoveLeftAndModifySelection").execute();
> > +                else if (kevent->ctrlKey())
> > +                    frame->editor()->command("MoveWordBackward").execute();
> > +                else
> > +                    frame->editor()->command("MoveLeft").execute();
> 
> Isn't better to directly call selection controller's modify?

In fact, it could be better. However, since the whole method is already full on frame->editor->command calls, I left these like that too.

I actually also plan to fix it to work like Gtk and EFL ports: a map table of actions and commands. I will be a follow up.

ps: please comment #8 should make it an easy review :)
Comment 11 Antonio Gomes 2010-12-13 22:48:05 PST
@Ryosuke / Yael: any other issues, you guys see here?

I would really like to move one here, since it bo
Comment 12 Antonio Gomes 2010-12-13 22:48:58 PST
[Hit ENTER by accident]

> I would really like to move one here, since it bo

... blocks some other bugs.
Comment 13 Ariya Hidayat 2010-12-16 17:49:37 PST
Comment on attachment 75677 [details]
(committed r74229, r=ariya) patch v2 - it builds and has no style issues.

View in context: https://bugs.webkit.org/attachment.cgi?id=75677&action=review

LGTM.

> LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt:1
> +This tests that arrow keys navigatie through a paragraph as expected when in caret browsing mode, also with shift and ctrl modifiers.

"navigate"
Comment 14 Antonio Gomes 2010-12-16 19:45:51 PST
Comment on attachment 75677 [details]
(committed r74229, r=ariya) patch v2 - it builds and has no style issues.

Clearing flags on attachment: 75677

Committed r74229: <http://trac.webkit.org/changeset/74229>
Comment 15 Eric Seidel (no email) 2010-12-17 00:24:08 PST
Reverted r74229 for reason:

Broken on Snow Leopard and possibly other platforms

Committed r74235: <http://trac.webkit.org/changeset/74235>
Comment 16 Antonio Gomes 2010-12-17 07:31:41 PST
(In reply to comment #15)
> Reverted r74229 for reason:
> 
> Broken on Snow Leopard and possibly other platforms
> 
> Committed r74235: <http://trac.webkit.org/changeset/74235>

Eric, thanks for taking care of it. Actually I realized my mistake seconds after the initial checkin, and created a patch to fix it. See bug 51232 ... Since it was > 1:00am I CQ+'ed it, but it seems the CQ got stuck and your rollout came first.

I am re land it with the proper fix.
Comment 17 WebKit Review Bot 2010-12-17 08:55:50 PST
http://trac.webkit.org/changeset/74270 might have broken GTK Linux 64-bit Debug
Comment 18 Antonio Gomes 2010-12-17 09:15:04 PST
(In reply to comment #17)
> http://trac.webkit.org/changeset/74270 might have broken GTK Linux 64-bit Debug

Fake alarm.

> I am re land it with the proper fix.

http://trac.webkit.org/changeset/74270