New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 818137 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

"test " and "example " treated as URLs in addressbar

Project Member Reported by jole...@opera.com, Mar 2 2018

Issue description

Chrome Version: 66.0.3358.0 (Official Build) canary (64-bit)
OS: ALL

What steps will reproduce the problem?
(1) type "test " in address bar
(2) press enter
(3)

What is the expected result?
Search for "test " is performed
What happens instead?
Browser navigates to "test/"

Please use labels and text to provide additional information.


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
Components: UI>Browser>Omnibox
Labels: -Type-Bug -Pri-3 OS-Chrome OS-Linux OS-Mac OS-Windows Pri-1 Type-Bug-Regression
Owner: dschuyler@chromium.org
Status: Assigned (was: Untriaged)
Obviously fallout from  bug 782146 .

In https://chromium-review.googlesource.com/c/chromium/src/+/831214/7/components/omnibox/browser/autocomplete_input.cc , instead of checking "text is not exactly 'test' or 'example' we should probably have done something like 'canonicalized URL has more than one component'".
(canonicalized host, not canonicalized url)
Status: Started (was: Assigned)
It seems like a good idea to specifically trim the whitespace.

pkasting@ is trimming the whitespace reasonable?
That feels fragile to me, compared to relying on the canonicalizer/RCDS systems.
Ah, it felt fragile to me to rely on an indirect indicator (vs. testing explicitly).

Maybe I'm misunderstanding: "more than one component". 

(A)
Did you mean 'canonicalized URL has more than one label*'? 
If so, will I be looking in the string for a period (.) or is there something that already counts the labels*?

(B)
Or if 'component' is a url_parse.h:Component struct, does that mean that the GURL also has a password, port, path, query, or ref in addition to host(?). "foo.test" should still be treated as a URL, even if it doesn't have a path, port, etc. I'm not seeing how checking for other Components is better (it seems like it would have unintended side effects). I'm okay doing something other than trimming the string and explicitly checking for "test" or "example", (but it would be keen to learn the "why" of it).


*IIUC the pieces of a host are "labels" (which I'm sure you know, but I don't know if you're using 'component' informally -- or if ya formally mean 'A Component class instance'). 
Err, also, afaik, if we go with (A) in #7, we'd still need to check for "test" or "example", because "localhost"* should navigate to localhost (even though it has a single label).

*and maybe others, I'm not sure.
Here are inputs that also probably shouldn't navigate but does, and the whitespace test wouldn't catch: "test." (with any number of trailing periods), ".test" (with any number of leading periods).

@7: (A), and I think what you want is to check if the length of the canonicalized hostname is more than |registry_length| + 1?  That would indicate it has at least one other component.
#9 Very helpful! Thanks!
Project Member

Comment 11 by bugdroid1@chromium.org, Mar 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7b840bc911107d6e3ee0e00e127ef076340d872a

commit 7b840bc911107d6e3ee0e00e127ef076340d872a
Author: Dave Schuyler <dschuyler@chromium.org>
Date: Thu Mar 08 00:22:04 2018

[Omnibox] fix for trailing whitespace on "test" and "example"

This CL suggests that the words "test" and "example" be treated as
QUERY regardless of whether whitespace is present (e.g. "test ").

Without this CL something like "test " (with a trailing space) will be
UNKNOWN, which may be treated as a URL or QUERY (it's not explicit --
this CL makes it explicit).

Bug:  818137 
Change-Id: Iedaa4e3c06782a9d9131d3e91d3cee87c1dee7ab
Reviewed-on: https://chromium-review.googlesource.com/950235
Commit-Queue: Dave Schuyler <dschuyler@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541650}
[modify] https://crrev.com/7b840bc911107d6e3ee0e00e127ef076340d872a/components/omnibox/browser/autocomplete_input.cc
[modify] https://crrev.com/7b840bc911107d6e3ee0e00e127ef076340d872a/components/omnibox/browser/autocomplete_input_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment