Closed Bug 712472 Opened 13 years ago Closed 13 years ago

click-and-drag in Tilt becomes wonky after you do full-page-zoom (Ctrl +)

Categories

(DevTools :: Inspector, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 12

People

(Reporter: dholbert, Assigned: vporof)

References

()

Details

(Whiteboard: [tilt])

Attachments

(2 files, 3 obsolete files)

STR:
 1. visit http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/ (or any site, really)

 2. Right-click on the upper blob of text, hit "Q" for inspect, and then Alt-M for 3D

 3. Hold Ctrl (or Cmd on mac) and mash your "+" key a few times to do full-page-zoom
    Do this until you can't see the gray background anymore.

 4. Click the top-center of the page and drag it towards the bottom of the screen.

EXPECTED RESULTS:  Page tips forward, "bowing" to me.
ACTUAL RESULTS:    Page rotates to the right

I'm guessing that the coordinates of the click position aren't getting scaled by the fullpage zoom factor, or something, so a click at the top-center is interpreted as a click at the top-right.
Mozilla/5.0 (X11; Linux x86_64; rv:11.0a1) Gecko/20111219 Firefox/11.0a1
Attached video screencast
screencast of normal behavior followed by broken-behavior-after-fullpage-zoom
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Whiteboard: [tilt]
Funny.
Zooming shouldn't be supported yet, bug 710762 adds that functionality (without the need of using Ctrl/Cmd). Right now, Ctrl+zooming actually scales the entire canvas, instead of translating in the 3D environment. This should be avoided.
Attached patch v1 (obsolete) — Splinter Review
Attachment #583456 - Flags: review?(rcampbell)
Depends on: 712286
Attached patch v2 (obsolete) — Splinter Review
Attachment #583456 - Attachment is obsolete: true
Attachment #583456 - Flags: review?(rcampbell)
Attachment #583763 - Flags: review?(rcampbell)
Comment on attachment 583763 [details] [diff] [review]
v2

On some Linux machines:

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/tilt/test/browser_tilt_zoom.js | The renderer width wasn't set correctly.
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/tilt/test/browser_tilt_zoom.js | The renderer height wasn't set correctly.

Investigating...
Attachment #583763 - Flags: review?(rcampbell)
Attached patch v3 (obsolete) — Splinter Review
Fixed test failures. Try is green.
https://tbpl.mozilla.org/?tree=Try&rev=52a708a07be0
Attachment #583763 - Attachment is obsolete: true
Attachment #584035 - Flags: review?(rcampbell)
There seems to be one Win intermittent orange in a webconsole test. There's bug 676696 filed for that, but hasn't occurred since 2011-08-29, so I'm not sure if it's related to this patch or not.
Attached patch v4Splinter Review
The orange may (may!) be caused by resizing the browser window. Doing another test run with a new patch that reverts the size to original after the tests are finished seems to avoid causing the intermittent orange, but we'll never know. For safety, I added the "improved" patch.

For the record, I remember also triggering this orange a while ago by not doing a removeChild for a canvas added to the selectedBrowser.parentNode. This remained stuck in the xul window, and thus altered the innerWidth and innerHeight of the content document when the webconsole tests were run. Maybe this is the underlying reason for bug 676696?
Attachment #584035 - Attachment is obsolete: true
Attachment #584035 - Flags: review?(rcampbell)
Attachment #584071 - Flags: review?(rcampbell)
Comment on attachment 584071 [details] [diff] [review]
v4

+TiltUtils.getDocumentZoom = function TU_getDocumentZoom() {
+  let browserWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
+    .getService(Ci.nsIWindowMediator)
+    .getMostRecentWindow("navigator:browser");
+
+  return browserWindow.gBrowser.selectedBrowser.markupDocumentViewer.fullZoom;
+};

this feels like it should be a utility method in the InspectorUI object since we seem to keep re-implementing it. Maybe even a shared utils method.

A lot of TiltUtils.jsm looks like it could be refactored to live in shared/. We should keep that in mind.

wow, totally missed those bad indents in browser_tilt_controller.js. Thanks for fixing.
Attachment #584071 - Flags: review?(rcampbell) → review+
Whiteboard: [tilt] → [tilt][land-in-fx-team]
(In reply to Rob Campbell [:rc] (robcee) from comment #11)
> Comment on attachment 584071 [details] [diff] [review]
> v4
> 
> wow, totally missed those bad indents in browser_tilt_controller.js. Thanks
> for fixing.

What bad indents? No bad indents, I just wrapped a lot of code in function testEventCancel(cancellingEvent), to reuse that stuff a bit later in the test :)
https://hg.mozilla.org/integration/fx-team/rev/8be4e3d2105e
Whiteboard: [tilt][land-in-fx-team] → [tilt][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/8be4e3d2105e
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [tilt][fixed-in-fx-team] → [tilt]
Target Milestone: --- → Firefox 12
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: