Closed Bug 856151 Opened 11 years ago Closed 11 years ago

Use of client coordinates in various modules need to be translated to browser coordinates

Categories

(Firefox for Metro Graveyard :: Input, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 23

People

(Reporter: jimm, Assigned: jimm)

References

Details

Attachments

(3 files, 7 obsolete files)

We use clientX and clientY quite a bit but this is incorrect, we should be translating these according to the position of the <browser> or the deck the browsers sit in.
Attached patch binding cleanup (obsolete) — Splinter Review
Assignee: nobody → jmathies
Attached patch binding cleanup (obsolete) — Splinter Review
Attachment #731653 - Attachment is obsolete: true
Attached patch bindings (obsolete) — Splinter Review
Attachment #731654 - Attachment is obsolete: true
Attached patch context menus (obsolete) — Splinter Review
Attached patch bindings (obsolete) — Splinter Review
I'll add more to these as I go, this is start.
Attachment #731822 - Attachment is obsolete: true
Attachment #731834 - Attachment is obsolete: true
Attachment #731877 - Flags: review?(mbrubeck)
Attached patch context menu fixSplinter Review
This fixes up context menu positioning when the browser position shifts. I've also added a test.
Attachment #731878 - Flags: review?(fyan)
Comment on attachment 731877 [details] [diff] [review]
bindings

Review of attachment 731877 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/metro/base/content/bindings/browser.xml
@@ +203,5 @@
> +
> +            return {
> +              xPos: (aBrowserX * scale - scrollX - deckX + bcr.left),
> +              yPos: (aBrowserY * scale - scrollY - deckY + bcr.top)
> +            };

Nit: I'd like to continue using {x, y} instead of {xPos, yPos}.

The main rationale is that we can then use these return values together with "Point" instances and methods from Geometry.jsm.
Attachment #731877 - Flags: review?(mbrubeck) → review+
Attached patch bindings (obsolete) — Splinter Review
updated per comments. I've also added some new helpers for converting individual points which I'm using in selection code.
Attachment #731877 - Attachment is obsolete: true
Attached patch bindingsSplinter Review
updated a couple xPos -> x type comments in the header.
Attachment #731993 - Attachment is obsolete: true
Comment on attachment 731997 [details] [diff] [review]
bindings

Review of attachment 731997 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/metro/base/content/helperui/SelectHelperUI.js
@@ +108,5 @@
>  
>      return {
>        forcePosition: true,
> +      xPos: p0.xPos,
> +      yPos: p1.yPos,

This needs to be updated to .x and .y too.
Comment on attachment 731878 [details] [diff] [review]
context menu fix

Review of attachment 731878 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!

::: browser/metro/base/content/helperui/MenuUI.js
@@ +194,3 @@
>      this._menuPopup.show(Util.extend({}, this._defaultPositionOptions, {
> +      xPos: coords.xPos,
> +      yPos: coords.yPos,

This needs to be updated to .x and .y.
Attachment #731878 - Flags: review?(fyan) → review+
Attached patch selection (obsolete) — Splinter Review
Attached patch selectionSplinter Review
This passes all of my selection tests I have in my queue (amazing!).
Attachment #732005 - Attachment is obsolete: true
Attachment #732034 - Flags: review?(mbrubeck)
Attachment #732034 - Flags: review?(mbrubeck) → review+
https://hg.mozilla.org/mozilla-central/rev/a5aa2d31e8e9
https://hg.mozilla.org/mozilla-central/rev/5722966a3126
https://hg.mozilla.org/mozilla-central/rev/d3a0bc6f68b1
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
Depends on: 859447
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: