Closed Bug 1250366 Opened 8 years ago Closed 8 years ago

Urlbar incorrectly highlights domain name if there's whitespace at the end

Categories

(Firefox :: Address Bar, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 47
Tracking Status
firefox44 --- wontfix
firefox45 --- wontfix
firefox46 --- wontfix
firefox47 --- verified
firefox-esr38 --- unaffected

People

(Reporter: arni2033, Assigned: Gijs)

References

Details

(Keywords: regression)

Attachments

(1 file)

>>>   My Info:   Win7_64, Nightly 47, 32bit, ID 20160222030212
STR:
1. Copy string  "example.org   "  in clipboard
2. Press Ctrl+T to open new tab
3. Paste the string copied in Step 1 in urlbar (Ctrl+V)
4.A) Click in searchbar
4.B) Click on the free place on page
4.C) Press Enter, then Escape to cancel loading (try this scenario with string "examexample.org   ")

AR:  "exa" in urlbar is gray, "mple.org" is black
ER:  The whole string in urlbar ("example.org") should be black
This is also reproducible with links like "example.org?asdf", "example.org#asdf".
I originally encountered this with "?asdf" type, but those STR were very specific.

This is regression from bug 1199289. Regression range:
> https://hg.mozilla.org/integration/fx-team/pushloghtml?fromchange=30d61283668592adfaec7a00aeeabc9d32a688c2&tochange=417e00a78107e0e97f35a3e4df4819cd91f4781d
Blocks: 1199289
Keywords: regression
Summary: Urlbar incorrectly highlights domain name if there's whitespace at the end → Urlbar incorrectly highlights domain name if there's hash, "?", or whitespace at the end
(In reply to arni2033 from comment #1)
> This is also reproducible with links like "example.org?asdf",
> "example.org#asdf".
> I originally encountered this with "?asdf" type, but those STR were very
> specific.

I cannot reproduce these two issues on current Nightly, and believe they were fixed already. Can you provide more detail?
Flags: needinfo?(arni2033)
(In reply to :Gijs Kruitbosch from comment #2)
> (In reply to arni2033 from comment #1)
> > This is also reproducible with links like "example.org?asdf",
> > "example.org#asdf".
> > I originally encountered this with "?asdf" type, but those STR were very
> > specific.
> 
> I cannot reproduce these two issues on current Nightly, and believe they
> were fixed already. Can you provide more detail?

Specifically, I think I fixed this in bug 1199601.
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
(In reply to :Gijs Kruitbosch from comment #2)
> > This is also reproducible with links like "example.org?asdf", "example.org#asdf".
> 
> I cannot reproduce these two issues on current Nightly, and believe they were fixed already.
Oh, that's correct. Those 2 cases were indeed fixed between DE 45 and Nightly 47.
I forgot to test them on Nightly.
Flags: needinfo?(arni2033)
Summary: Urlbar incorrectly highlights domain name if there's hash, "?", or whitespace at the end → Urlbar incorrectly highlights domain name if there's whitespace at the end
Can you give an explanation as to how this change to the regex fixes the problem (for me and for posterity's sake)?
Flags: needinfo?(gijskruitbosch+bugs)
(In reply to Jared Wein [:jaws] (please needinfo? me) from comment #6)
> Can you give an explanation as to how this change to the regex fixes the
> problem (for me and for posterity's sake)?

Replacing the '.' with \S ensures that we don't match whitespace characters as part of the domain/host (because whitespace can't be part of a domain). We need the \s* afterwards because otherwise the "$" 'end of string' marker doesn't match right after the domain (which now no longer includes the trailing whitespace) and we end up not highlighting the input at all.
Flags: needinfo?(gijskruitbosch+bugs)
Comment on attachment 8722442 [details]
MozReview Request: Bug 1250366 - fix whitespace issues with URL highlight code, r?jaws

https://reviewboard.mozilla.org/r/36033/#review32735

Thanks for the explanation and increased test coverage.
Attachment #8722442 - Flags: review?(jaws) → review+
See Also: → 1250662
https://hg.mozilla.org/mozilla-central/rev/e02bcc28e90d
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
I have reproduced this bug on Nightly 47.0a1 (2016-02-22) on ubuntu 14.04 LTS, 32 bit!

The bug's fix is now verified on Latest Developer Edition 47.0a2!

Build ID: 20160414004009
User Agent: Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0
QA Whiteboard: [testday-20160415]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: