Closed
Bug 1031942
Opened 11 years ago
Closed 11 years ago
Newtab thumbnails missing if URL contains unusual characters
Categories
(Firefox :: New Tab Page, defect)
Tracking
()
VERIFIED
FIXED
Firefox 33
People
(Reporter: marc, Assigned: marc)
Details
Attachments
(2 files, 2 obsolete files)
|
366.66 KB,
image/png
|
Details | |
|
1.16 KB,
patch
|
adw
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140611060256
Steps to reproduce:
The newtab thumbnail for the following URL is not displayed:
http://en.wikipedia.org/wiki/Tool_(band)#Hiatus_and_fifth_studio_album_.282008.E2.80.93present.29
The thumbnail image is present in the cache folder. I've tracked the bug down to the "refreshThumbnail" function in browser/base/content/newtab/sites.js. The uri needs to be wrapped in an "encodeURIComponent" call to produce a valid thumbnail URL from the URL above.
Actual results:
Thumbnail is not displayed.
Message "Error in parsing value for 'background-image'. Declaration dropped." in the error console.
Thumbnails for other pages (with simpler URLs) are shown correctly.
Comment 1•11 years ago
|
||
Can you still reproduce this in a more recent version of Firefox? I don't see this behaviour in Nightly or Aurora (http://nightly.mozilla.org/ , http://aurora.mozilla.org/ ) - do you?
Component: Untriaged → New Tab Page
Flags: needinfo?(marc)
| Assignee | ||
Comment 2•11 years ago
|
||
(In reply to :Gijs Kruitbosch from comment #1)
> Can you still reproduce this in a more recent version of Firefox? I don't
> see this behaviour in Nightly or Aurora (http://nightly.mozilla.org/ ,
> http://aurora.mozilla.org/ ) - do you?
Yes, reproduced with the latest nightly.
Flags: needinfo?(marc)
| Assignee | ||
Comment 3•11 years ago
|
||
Screenshot of the bug in the latest nightly (note the blank tile).
| Assignee | ||
Comment 4•11 years ago
|
||
Fiddling with the developer console a little more, it turns out that the problem are the parenthesis in the URL together with the fact that encodeURIComponent does not escape them.
It seems that all that is actually needed is enclosing the URL in extra quotation marks so that the url() syntax is not confused by the parens.
| Assignee | ||
Comment 5•11 years ago
|
||
Proposed change in sites.js.
Comment 6•11 years ago
|
||
Hm, I can reproduce now. Don't know why I couldn't before.
It's somewhat odd because in one of the paths called from sites.js (the PageThumbs one) we do encodeURIComponent the URL... Drew, can you look into this in more detail, and/or review the patch? :-)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(adw)
OS: Linux → All
Hardware: x86 → All
Comment 7•11 years ago
|
||
Thanks for the patch. I think we should flip the single and double quotes, like:
thumbnail.style.backgroundImage = 'url("' + uri + '")';
encodeURIComponent escapes double quotes but not single quotes, so if we use single quote delimeters, we'll still be tripped up by URLs with single quotes in them.
Could you please attach a new patch?
I actually didn't know there was a difference between quoted and unquoted URIs, but it makes sense. For reference: http://dev.w3.org/csswg/css-values/#urls
Flags: needinfo?(adw)
| Assignee | ||
Comment 8•11 years ago
|
||
New patch with flipped quotes as suggested in comment #7.
Attachment #8448128 -
Attachment is obsolete: true
Comment 9•11 years ago
|
||
Comment on attachment 8448884 [details] [diff] [review]
sites.js.diff
Great, thank you.
Attachment #8448884 -
Flags: review+
Updated•11 years ago
|
| Assignee | ||
Comment 10•11 years ago
|
||
Proper patch, change is identical to the previous one.
Attachment #8448884 -
Attachment is obsolete: true
Updated•11 years ago
|
Attachment #8448949 -
Flags: review+
Comment 11•11 years ago
|
||
Hi,
could you provide a Try link. Suggestions for what to run if you haven't
yet can be found here:
https://wiki.mozilla.org/Sheriffing/How:To:Recommended_Try_Practices
Keywords: checkin-needed
Comment 12•11 years ago
|
||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 13•11 years ago
|
||
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Comment 14•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 33
| Assignee | ||
Comment 15•11 years ago
|
||
Thanks for getting this committed so quickly!
I have tried getting bugs fixed/patches approved in other projects before, and I have to say it's awesome how responsive you guys are.
Updated•11 years ago
|
QA Whiteboard: [good first verify]
Comment 16•11 years ago
|
||
I could try it, after release of beta 33, if it will be ok.
Flags: needinfo?(lars.gusowski+bugzilla)
Comment 17•11 years ago
|
||
Lars, if you want you can also use the first Beta build of Firefox 33 (ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/33.0b1-candidates/build1/).
Comment 18•11 years ago
|
||
for me it is fixed:
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Status change is not possible for me as i see.
Flags: needinfo?(lars.gusowski+bugzilla)
You need to log in
before you can comment on or make changes to this bug.
Description
•