Bug 48937

Summary: Spatial Navigation: Add support for <select> element in single selection mode
Product: WebKit Reporter: Chang Shu <cshu>
Component: FormsAssignee: Chang Shu <cshu>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, mrobinson, rniwa, tonikitoo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 47094    
Attachments:
Description Flags
fix patch
tonikitoo: review-
fix patch 2
tonikitoo: review+, tonikitoo: commit-queue-
fix patch 3 commit-queue: commit-queue-

Chang Shu
Reported 2010-11-03 11:34:58 PDT
This case handles the single selection mode only.
Attachments
fix patch (8.16 KB, patch)
2010-11-03 11:49 PDT, Chang Shu
tonikitoo: review-
fix patch 2 (7.75 KB, patch)
2010-11-04 07:32 PDT, Chang Shu
tonikitoo: review+
tonikitoo: commit-queue-
fix patch 3 (7.73 KB, patch)
2010-11-05 11:45 PDT, Chang Shu
commit-queue: commit-queue-
Chang Shu
Comment 1 2010-11-03 11:49:57 PDT
Created attachment 72847 [details] fix patch
Antonio Gomes
Comment 2 2010-11-03 12:04:03 PDT
Comment on attachment 72847 [details] fix patch View in context: https://bugs.webkit.org/attachment.cgi?id=72847&action=review Looks generally good. Comments below. > WebCore/dom/SelectElement.cpp:236 > +bool SelectElement::isSpatialNavigation(const Element* element) Should not be a class method, but a static helper. Name is also not so good. > WebCore/dom/SelectElement.cpp:655 > + } else if (keyCode == ' ' && isSpatialNavigation(element)) { What about ENTER? > LayoutTests/fast/events/spatial-navigation/resources/spatial-navigation-utils.js:58 > - return; > + direction = gExpectedResults[gIndex][0]; > } Lets also do "case " ":" and keep the default no-op. otherwise anything could get here.
Chang Shu
Comment 3 2010-11-04 07:32:05 PDT
Created attachment 72941 [details] fix patch 2
Antonio Gomes
Comment 4 2010-11-05 09:23:50 PDT
Comment on attachment 72941 [details] fix patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=72941&action=review Looks good. r=me with my comments addressed. > WebCore/dom/SelectElement.cpp:572 > + if (isSpatialNavigationEnabled(element)) lets do it as if (isSpatialNavigationEnabled(frame->settings())) then in the function you do: bool isSpatialNavigationenabled(Settings* settings) { if (!setting) return false; return settings->isSpatialNavigationEnabled(); } > WebCore/dom/SelectElement.cpp:777 > - if (Frame* frame = element->document()->frame()) { > - if (frame->settings() && frame->settings()->isSpatialNavigationEnabled()) { > - // Check if the selection moves to the boundary. > - if (keyIdentifier == "Left" || keyIdentifier == "Right" || ((keyIdentifier == "Down" || keyIdentifier == "Up") && endIndex == data.activeSelectionEndIndex())) > - return; > - } > - } > + if (isSpatialNavigationEnabled(element)) same here: id (Frame* frame = element->document()->frame()) if (isSpatialNavigationEnabled(frame->settings())) so we would change only only of code here. > LayoutTests/fast/events/spatial-navigation/resources/spatial-navigation-utils.js:63 > + if (window.layoutTestController && direction != null) only "&& direction" does not work?
Chang Shu
Comment 5 2010-11-05 11:45:08 PDT
Created attachment 73092 [details] fix patch 3
Antonio Gomes
Comment 6 2010-11-05 12:01:01 PDT
Comment on attachment 73092 [details] fix patch 3 View in context: https://bugs.webkit.org/attachment.cgi?id=73092&action=review > WebCore/dom/SelectElement.cpp:75 > +static bool isSpatialNavigationEnabled(const Frame* frame) > +{ Could you please file a bug to add a "static bool SpatialNavigation::isEnabled(Settings*)" method in spatialNavigation.h they each file that touches it will have to have its own copy of this method. It is in /editing already. If we do that, it should probably take a Settings* and that we should do the early return logic even for such small function, as I described in the previous comment.
Chang Shu
Comment 7 2010-11-05 12:03:41 PDT
(In reply to comment #6) > (From update of attachment 73092 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=73092&action=review > > > WebCore/dom/SelectElement.cpp:75 > > +static bool isSpatialNavigationEnabled(const Frame* frame) > > +{ > > Could you please file a bug to add a "static bool SpatialNavigation::isEnabled(Settings*)" method in spatialNavigation.h > > they each file that touches it will have to have its own copy of this method. It is in /editing already. > > If we do that, it should probably take a Settings* and that we should do the early return logic even for such small function, as I described in the previous comment. Makes sense, will do.
Antonio Gomes
Comment 8 2010-11-05 12:05:15 PDT
> they each file that touches it will have to have its own copy of this method. It is in /editing already. in english now: "then files that want to know about spatial navigation status do not need to have their own copy of this method. e.g. this method is also in /editing"
WebKit Commit Bot
Comment 9 2010-11-05 12:22:24 PDT
Comment on attachment 73092 [details] fix patch 3 Clearing flags on attachment: 73092 Committed r71442: <http://trac.webkit.org/changeset/71442>
WebKit Commit Bot
Comment 10 2010-11-05 12:22:31 PDT
Comment on attachment 73092 [details] fix patch 3 Rejecting patch 73092 from commit-queue. Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sl', 'land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 73092]" exit_code: 1 Last 500 characters of output: ts/CommitQueue/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_html.py", line 546, in __getattr__ self.forms() File "/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_html.py", line 559, in forms self._forms_factory.forms()) File "/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_html.py", line 228, in forms raise ParseError(exc) webkitpy.thirdparty.autoinstalled.mechanize._html.ParseError Full output: http://queues.webkit.org/results/5252020
Chang Shu
Comment 11 2010-11-05 12:43:05 PDT
(In reply to comment #10) > (From update of attachment 73092 [details]) > Rejecting patch 73092 from commit-queue. > > Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sl', 'land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 73092]" exit_code: 1 > Last 500 characters of output: > ts/CommitQueue/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_html.py", line 546, in __getattr__ > self.forms() > File "/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_html.py", line 559, in forms > self._forms_factory.forms()) > File "/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_html.py", line 228, in forms > raise ParseError(exc) > webkitpy.thirdparty.autoinstalled.mechanize._html.ParseError > > Full output: http://queues.webkit.org/results/5252020 I guess the script is broken. can anyone take a look?
Ryosuke Niwa
Comment 12 2010-11-06 14:26:07 PDT
This test has been failing on gtk. Please fix.
Note You need to log in before you can comment on or make changes to this bug.