Closed
Bug 1014113
Opened 11 years ago
Closed 4 years ago
Find in page zoom is zooms too much
Categories
(Firefox for Android Graveyard :: General, defect, P5)
Tracking
(firefox29 unaffected, firefox30 affected, firefox31 affected, firefox32 affected, firefox38 fixed, fennec+)
RESOLVED
INCOMPLETE
Firefox 38
People
(Reporter: Margaret, Assigned: rricard)
References
Details
Attachments
(2 files, 5 obsolete files)
There are some recent comments in bug 958111 complaining that the behavior added there is too aggressive. I think we should try to polish that interaction.
This feature is on beta now, but disabling it would just consist of removing one line in FindHelper.js, so maybe we should consider doing that if we don't think this is good enough to ship.
Assignee | ||
Comment 1•11 years ago
|
||
I think I'll take that one too, it's related to a part I'm used to work on.
Assignee | ||
Comment 2•11 years ago
|
||
But before going further into this bug I'd like to finish with 994724
Assignee | ||
Comment 3•11 years ago
|
||
Sorry for the mess here !
Updated•11 years ago
|
tracking-fennec: ? → 32+
Updated•11 years ago
|
Assignee: nobody → ricard.robin
tracking-fennec: 32+ → +
Reporter | ||
Comment 4•11 years ago
|
||
Robin, FYI, I'm disabling this feature in bug 1014708, but we can re-enable it when we're ready to land a patch for this bug.
Assignee | ||
Comment 5•11 years ago
|
||
Okay, no problem for me ! I want to get all of that right.
Reporter | ||
Comment 6•11 years ago
|
||
Let's also make sure to keep an eye out for bug 973909 as we work on this.
Blocks: 973909
Assignee | ||
Comment 8•10 years ago
|
||
Wow ! forgot about this one, working on it right now !
Assignee | ||
Comment 9•10 years ago
|
||
Defines a viewport factor around the highlighted word
May need more testing (See bug 1015395)
Attachment #8527183 -
Flags: feedback?(margaret.leibovic)
Assignee | ||
Comment 10•10 years ago
|
||
From my manual tests it seems to work. I'll try to see if I can do the same thing with Robocop. After that I'll fire up some tries !
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Comment 11•10 years ago
|
||
Comment on attachment 8527183 [details] [diff] [review]
Find in page zoom is zooms too much
Review of attachment 8527183 [details] [diff] [review]:
-----------------------------------------------------------------
Looking good! I just have a few comments/questions.
::: mobile/android/chrome/content/FindHelper.js
@@ +130,5 @@
> this._targetTab.setViewport(JSON.parse(this._initialViewport));
> this._targetTab.sendViewportUpdate();
> }
> } else {
> + const zoomFactor = 1/2;
I think it would be more intuitive to make the zoomFactor an integer, instead of inverting it where you're using it down below.
@@ +133,5 @@
> } else {
> + const zoomFactor = 1/2;
> +
> + // we replace the start of the zoom rect to keep the highlighted word in the middle
> + let x = aData.rect.x + (aData.rect.width * (1 - 1 / zoomFactor)) / 2;
Can you elaborate on the logic that went into this calculation? Where does the 2 come from? If you make the zoomFactor an integer like I suggested above, I think it would be more intutitive to write this as:
let x = aData.rect.x - (aData.rect.width * zoomFactor) / 2;
@@ +136,5 @@
> + // we replace the start of the zoom rect to keep the highlighted word in the middle
> + let x = aData.rect.x + (aData.rect.width * (1 - 1 / zoomFactor)) / 2;
> + let y = aData.rect.y + (aData.rect.height * (1 - 1 / zoomFactor)) / 2;
> +
> + let rect = new Rect(x > 0 ? x : 0,
You can just do Math.max(x, 0) here.
Attachment #8527183 -
Flags: feedback?(margaret.leibovic) → feedback+
Assignee | ||
Comment 12•10 years ago
|
||
Defines a viewport factor around the highlighted word
May need more testing (See bug 1015395)
Attachment #8527183 -
Attachment is obsolete: true
Attachment #8530538 -
Flags: review?(margaret.leibovic)
Reporter | ||
Comment 13•10 years ago
|
||
Comment on attachment 8530538 [details] [diff] [review]
Find in page zoom is zooms too much
Review of attachment 8530538 [details] [diff] [review]:
-----------------------------------------------------------------
This looks fine to me, but let's make sure we fix up the tests before we land this.
::: mobile/android/chrome/content/FindHelper.js
@@ +130,5 @@
> this._targetTab.setViewport(JSON.parse(this._initialViewport));
> this._targetTab.sendViewportUpdate();
> }
> } else {
> + const spacingFactor = 2;
I think you should add a comment explaining what this factor means, and how changing it would affect the zoom behavior.
@@ +132,5 @@
> }
> } else {
> + const spacingFactor = 2;
> +
> + // we replace the start of the zoom rect to keep the highlighted word in the middle
Nit: Use sentence capitalization and punctuation in comments.
Attachment #8530538 -
Flags: review?(margaret.leibovic) → review+
Assignee | ||
Comment 14•10 years ago
|
||
Defines a viewport factor around the highlighted word
May need more testing (See bug 1015395)
Attachment #8531288 -
Flags: review?(margaret.leibovic)
Assignee | ||
Updated•10 years ago
|
Attachment #8530538 -
Attachment is obsolete: true
Reporter | ||
Comment 15•10 years ago
|
||
Comment on attachment 8531288 [details] [diff] [review]
Find in page zoom is zooms too much
This is looking good, but as I mentioned before, I want to see us update the tests before landing this.
Attachment #8531288 -
Flags: review?(margaret.leibovic) → review+
Comment 16•10 years ago
|
||
For shorter search strings we zoom in quite a bit and lose surrounding context. I wonder if we can consider using a larger spacingFactor of say 6?
Example compare spacingFactor 2 vs. 6
https://www.dropbox.com/s/s5aw76x2cu6yhd2/bug1014113_sf_compare.png?dl=0
Comment 17•10 years ago
|
||
Also, (sorry to jump in), with this patch there's an odd regression that should be looked into.
If you open the FindInPageBar view after visiting a page, and search for / type 'e' for example, then hit the backspace arrow to clear the search string, you wind up with a blank rendered page
https://www.dropbox.com/s/hjmru68drjmb7zx/bug1014113_blank.png?dl=0
And some messages in logcat like:
W/GeckoConsole(31782): [JavaScript Error: "SyntaxError: JSON.parse: unexpected character at line 1 column 179 of the JSON data" {file: "chrome://browser/content/browser.js" line: 1710}]
W/GeckoConsole(31782): [JavaScript Error: "SyntaxError: JSON.parse: unexpected character at line 1 column 9 of the JSON data" {file: "chrome://browser/content/browser.js" line: 1710}]
Assignee | ||
Comment 18•10 years ago
|
||
Hi ! Long time no see ! Sorry for that, I'm quite under lots of work/pressure/whatever right now but I'll try to finish this patch one day !
First of all, thanks for your feedback mark, I'll look into it (I agree 6 is better and this bug, well I'll try to figure out what's wrong there ... !)
Secondly, I'll see what's happening on the side of 1015395. We need better tests !
Assignee | ||
Comment 19•10 years ago
|
||
Defines a viewport factor around the highlighted word
May need more testing (See bug 1015395)
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f4a299390d38
Attachment #8531288 -
Attachment is obsolete: true
Assignee | ||
Comment 20•10 years ago
|
||
Think I found what was wrong mark, thanks to WebIDE. It was sending NaNs to java. Of course, the viewport wasn't parsable in JSON (NaNs are not authorized there) so I had to check for the rect's size in the ZoomHelper. Now I abort the zoom if the rect has a null dimensions (or negative dimensions).
Assignee | ||
Comment 21•10 years ago
|
||
Attachment #8553800 -
Flags: feedback?(markcapella)
Assignee | ||
Updated•10 years ago
|
Attachment #8553717 -
Attachment is obsolete: true
Comment 22•10 years ago
|
||
Comment on attachment 8553800 [details] [diff] [review]
Here's the patch with the fix !
Review of attachment 8553800 [details] [diff] [review]:
-----------------------------------------------------------------
Oh, that was pretty much my feedback :p I trust you've tested it, and you're reviewer will catch the rest.
::: mobile/android/chrome/content/ZoomHelper.js
@@ +124,5 @@
> */
> zoomToRect: function(aRect, aClickY = -1) {
> + if(aRect.width < 1 || aRect.height < 1) {
> + // Protect from empty or negative-sized rects & potentials NaN in following calculations
> + return;
Rect() has an isEmpty() function that might be prettier:
http://mxr.mozilla.org/mozilla-central/source/toolkit/modules/Geometry.jsm?mark=116-118#79
Attachment #8553800 -
Flags: feedback?(markcapella) → feedback+
Assignee | ||
Comment 23•10 years ago
|
||
Yup ! Thanks, that'll be much better ! Updating it right away !
Assignee | ||
Comment 24•10 years ago
|
||
Attachment #8553800 -
Attachment is obsolete: true
Attachment #8553815 -
Flags: feedback?(markcapella)
Assignee | ||
Comment 25•10 years ago
|
||
Firing up a try to be sure I'm not breaking anything...
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1c0f4d59ce99
Comment 26•10 years ago
|
||
Comment on attachment 8553815 [details] [diff] [review]
Refactored with .isEmpty(). Thanks !
Review of attachment 8553815 [details] [diff] [review]:
-----------------------------------------------------------------
lgtm :)
Attachment #8553815 -
Flags: feedback?(markcapella) → feedback+
Assignee | ||
Updated•10 years ago
|
Attachment #8553815 -
Flags: review?(margaret.leibovic)
Reporter | ||
Comment 27•10 years ago
|
||
Can you upload a build and needinfo antlam for UX feedback? I think capella's suggestion to change the zoom factor is good, but we should make sure our UX team approves this change before we land it.
Assignee | ||
Comment 28•10 years ago
|
||
Ok, I'm on it !
Assignee | ||
Comment 29•10 years ago
|
||
Comment on attachment 8553815 [details] [diff] [review]
Refactored with .isEmpty(). Thanks !
Restarted a try on this: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c4732445ad51
Assignee | ||
Updated•10 years ago
|
Attachment #8553815 -
Flags: feedback?(alam)
Assignee | ||
Comment 30•10 years ago
|
||
Here's a screenshot. Factor is set to 6.
Comment 31•10 years ago
|
||
Comment on attachment 8553815 [details] [diff] [review]
Refactored with .isEmpty(). Thanks !
Hey Robin!
I'm not seeing a zoom right now on Nightly (Find in Page just seems to keep whatever zoom % the user was using).
Could you upload a build (.APK) so I can do a compare more easily? I tried following the comments but this would be more thorough.
Also, is this just for Tablets or Mobile as well?
Thanks!
Flags: needinfo?(ricard.robin)
Attachment #8553815 -
Flags: feedback?(alam)
Assignee | ||
Comment 32•10 years ago
|
||
Hey !
Yep it has not landed yet but you can use the following build (from the try: https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/ricard.robin@gmail.com-c4732445ad51/try-android-api-11/fennec-38.0a1.en-US.android-arm.apk)
It works on every screen size !
Flags: needinfo?(ricard.robin)
Comment 33•10 years ago
|
||
I'm having trouble installing it (probably name clash), can we change the build name so I don't have to delete the Nightly I'm currently using?
Thanks!
Assignee | ||
Comment 34•10 years ago
|
||
Here is a build from my computer: https://dl.dropboxusercontent.com/u/99291843/Bugzilla%20Attachments/fennec-38.0a1.en-US.android-arm.apk
Flags: needinfo?(alam)
Reporter | ||
Comment 35•10 years ago
|
||
Comment on attachment 8553815 [details] [diff] [review]
Refactored with .isEmpty(). Thanks !
Review of attachment 8553815 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good to me. Once we get approval from antlam we can check this in. And we should also fix bug 1128287.
Attachment #8553815 -
Flags: review?(margaret.leibovic) → review+
Comment 36•10 years ago
|
||
(In reply to Robin Ricard [rricard] from comment #34)
> Here is a build from my computer:
> https://dl.dropboxusercontent.com/u/99291843/Bugzilla%20Attachments/fennec-
> 38.0a1.en-US.android-arm.apk
Hey Riccard, this works pretty well. I tested it on the Nexus 9 and the 6.
Thanks!
Flags: needinfo?(alam)
Reporter | ||
Comment 37•10 years ago
|
||
Comment 38•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox38:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
Comment 39•10 years ago
|
||
backed this out since this caused a perma-failure rc2 like https://treeherder.mozilla.org/logviewer.html#?job_id=1998606&repo=fx-team
Status: RESOLVED → REOPENED
Flags: needinfo?(ricard.robin)
Resolution: FIXED → ---
Assignee | ||
Comment 40•10 years ago
|
||
Oh ! I didn't expected this patch to create the problem so I wasn't testing the right thing locally ... I will investigate on this side ! Thanks for catching this !
Flags: needinfo?(ricard.robin)
Comment 41•4 years ago
|
||
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: REOPENED → RESOLVED
Closed: 10 years ago → 4 years ago
Resolution: --- → INCOMPLETE
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•