RESOLVED INVALID 44397
[Chromium] Focusing the omnibox should clear selection in Web content on Mac
https://bugs.webkit.org/show_bug.cgi?id=44397
Summary [Chromium] Focusing the omnibox should clear selection in Web content on Mac
Jeremy Moskovich
Reported 2010-08-22 07:01:59 PDT
Attachments
Clear selection when Omnibox is focused (3.54 KB, patch)
2010-08-22 07:07 PDT, Jeremy Moskovich
ojan: review-
ojan: commit-queue-
Clear selection when Omnibox is focused (2.91 KB, patch)
2010-08-24 01:50 PDT, Jeremy Moskovich
ojan: review-
ojan: commit-queue-
Jeremy Moskovich
Comment 1 2010-08-22 07:07:43 PDT
Created attachment 65058 [details] Clear selection when Omnibox is focused
Dimitri Glazkov (Google)
Comment 2 2010-08-22 07:59:08 PDT
This looks like it needs to live inside SelectionController::clear(), or SelectionController:setSelection(). Why is it Chromium-specific?
Tony Chang
Comment 3 2010-08-23 09:29:33 PDT
It looks like this will clear all selections on the page, but I think you only want to clear selections of input elements (i.e., things that grab focus). For example, if I select the copyright text on google.com, then select text in the URL bar, the text should still be selected. My guess is this works in Safari because when you focus the URL bar, it causes the previous selection to be blurred. Maybe we need to somehow tell the renderer process that we've moved focus?
Jeremy Moskovich
Comment 4 2010-08-23 10:29:44 PDT
Tony: If I try selecting all of the text on the google homepage in Safari and then focusing the Omnibox then the entire selection is cleared, not just the text input box, did you mean something different?
Tony Chang
Comment 5 2010-08-23 10:49:16 PDT
(In reply to comment #4) > Tony: If I try selecting all of the text on the google homepage in Safari and then focusing the Omnibox then the entire selection is cleared, not just the text input box, did you mean something different? That's interesting, that's not what I see in other browsers. IE8, select all then select text in urlbar: page selection not cleared IE8, select text in search box then select text in urlbar: page selection not cleared Firefox 3.6 win, select all then select text in urlbar: page selection not cleared Firefox 3.6 win, select text in search box then select text in urlbar: search box selection cleared Firefox 3.6 linux: same as firefox 3.6 win. Safari 5 win: same as IE8 It sounds like the behavior you're seeing in Safari Mac is Mac specific behavior.
Ojan Vafai
Comment 6 2010-08-23 19:11:43 PDT
Comment on attachment 65058 [details] Clear selection when Omnibox is focused Our current behavior looks correct to me. Or, at the very least, it's not wrong. Browsers are wildly inconsistent about how they handle blurred text controls. As far as I know there is no compatibility issue here. Our current behavior of showing the blurred (i.e. grey) selection seems fine unless I'm missing something.
Jeremy Moskovich
Comment 7 2010-08-24 00:53:30 PDT
Changing Platform and bug title per Ojan's comment.
Jeremy Moskovich
Comment 8 2010-08-24 01:50:02 PDT
Created attachment 65238 [details] Clear selection when Omnibox is focused Changes since last patch: * Mac only. * Removed hack to work around lack of selection cache update, will address in a separate patch.
Ojan Vafai
Comment 9 2010-08-24 10:00:27 PDT
Comment on attachment 65238 [details] Clear selection when Omnibox is focused As per my comments on the chromium bug.
Note You need to log in before you can comment on or make changes to this bug.