Closed Bug 558363 Opened 10 years ago Closed 10 years ago

Add some prefs for link tapping

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: vingtetun, Assigned: vingtetun)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
Attachment #438104 - Flags: review?(mark.finkle)
Comment on attachment 438104 [details] [diff] [review]
Patch

>diff -r fdc68b301924 app/mobile.js

>+pref("browser.ui.touch.visitedWeight", 1.2);

I think we should rename this to: browser.ui.touch.weight.visited

Since we might add other weights. More importantly, there are no floating point preferences. If we must use a float, we change it to a string and then parseFloat in JS. We could make the value an integer, 12, and divide by 10.

>+    const kTopRadius = gPrefService.getIntPref("browser.ui.touch.top"),
>+          kRightRadius = gPrefService.getIntPref("browser.ui.touch.right"),
>+          kLeftRadius = gPrefService.getIntPref("browser.ui.touch.left"),
>+          kBottomRadius = gPrefService.getIntPref("browser.ui.touch.bottom");

These aren't really "const" anymore. Switch to "let". Also, We should keep am eye on pulling preferences all the time. Might slow us down. We can time it on device.
>       // increase a little bit the weight for already visited items
>       if (current && current.mozMatchesSelector("*:visited"))
>-        distance *= 1.2;
>+        distance *= gPrefService.getIntPref("browser.ui.touch.visitedWeight");

Again, no float prefs. And you are using getIntPref anyway :)
Attachment #438104 - Flags: review?(mark.finkle) → review-
Attached patch Patch v0.2Splinter Review
Address comments.

I've also add the "*[role=button]" rule in _isElementClickable for making this works on the about:home page.
Assignee: nobody → 21
Attachment #438104 - Attachment is obsolete: true
Attachment #438256 - Flags: review?(mark.finkle)
Comment on attachment 438256 [details] [diff] [review]
Patch v0.2

Looks OK. I am going to make the visited weight work like the radius - a memoized property.
Attachment #438256 - Flags: review?(mark.finkle) → review+
pushed:
http://hg.mozilla.org/mobile-browser/rev/989040738be7
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Verified fix on Mozilla/5.0 (X11; U; Linux armv7l; en-US; rv:1.9.2.4pre)
Gecko/20100411 Namoroka/3.6.4pre Fennec/1.1a2pre

browser.ui.touch.left", 8
browser.ui.touch.right", 8
browser.ui.touch.top", 4
browser.ui.touch.bottom", 12
browser.ui.touch.weight.visited", 120
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.