Closed Bug 499277 Opened 15 years ago Closed 15 years ago

Once unzoom, dblClickink can thrown an error : aElement is null

Categories

(Firefox for Android Graveyard :: Panning/Zooming, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: vingtetun, Assigned: vingtetun)

Details

Attachments

(1 file, 3 obsolete files)

Attached patch Check if zoomElement is null (obsolete) — Splinter Review
1. Launch Fennec
2. Unzoom with the mouse wheel
3. dblClick somewhere on the white part
Attachment #384076 - Flags: review?(combee)
Comment on attachment 384076 [details] [diff] [review]
Check if zoomElement is null


>     let firstEvent = this._events[0].event;
>     let zoomElement = optimalElementForPoint(firstEvent.clientX, firstEvent.clientY);
> 
>-    if (zoomElement != this._zoomedTo) {
>+    if (zoomElement && zoomElement != this._zoomedTo) {
>       this._zoomedTo = zoomElement;
>       Browser.canvasBrowser.zoomToElement(zoomElement);
>-    } else {
>+    } else if (zoomElement) {
>       this._zoomedTo = null;
>       Browser.canvasBrowser.zoomFromElement(zoomElement);
>     }

How about just nesting the existing if/else in an | if (zoomElement) | so we don't need to check the "if" and the "else" tests.
Attached patch Updated patch (obsolete) — Splinter Review
Attachment #384076 - Attachment is obsolete: true
Attachment #384076 - Flags: review?(combee)
Comment on attachment 384096 [details] [diff] [review]
Updated patch

For some reason, zooming out is not working.
Attachment #384096 - Flags: review+ → review-
Attached patch Updated patch (obsolete) — Splinter Review
Correct zoomToElement/zoomFromElement error I've made. (Thanks for reporting me the error Mark)
Attachment #384096 - Attachment is obsolete: true
Comment on attachment 384106 [details] [diff] [review]
last one I hope :)

Works well, thanks
Attachment #384106 - Flags: review+
https://hg.mozilla.org/mobile-browser/rev/e751aa154122
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Component: General → Panning/Zooming
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: