Closed Bug 898650 Opened 7 years ago Closed 7 years ago

Ensure CrossSlide direction is perpendicular to the container's scroll orientation


(Firefox for Metro Graveyard :: Firefox Start, defect)

Windows 8
Not set


(Not tracked)

Firefox 26


(Reporter: sfoster, Assigned: sfoster)




(1 file, 1 obsolete file)

According to the Windows styleguide, the cross-slide gesture should be on the opposite axis to the scroll axis. So, grids in horizontally oriented containers (i.e. you would pan or scroll side-side) should swipe up/down to select tiles. For a vertically oriented container, you should swipe side-side to select tiles. 

Currently, the tiles in snapped-view still cross-slide on the y-axis, so either the getScrollAxisFromElement implementation in CrossSlide.jsm is buggy, or there's an unexpected horizonal-oriented container in there producing the unexpected result.
Blocks 8.1 support - the start UI and grids are not really scrollable or easily selectable because of scroll-axis errors.
Blocks: 891056
CrossSlide's getScrollDirection was trying to be accommodating of the possibility of an element being inside a scrollable div or something that might disagree with the document's own scroll direction. That's kind of an anti-pattern as far as Metro is concerned I think. Furthermore, the overflow CSS property checks weren't returning the right result in snapped view. I /think/ this new logic gets us the result we want - wide documents scroll left-right, tall documents top-bottom. We could also check scrollMaxX/Y. Or maybe there's a better method I'm missing? It seems like we must know the scroll direction already in order to handle panning, but I didn't spot it yet if so.

We only currently use CrossSlide in the start UI, but if its cheap/easy it would be good to keep it reusable elsewhere.
Assignee: nobody → sfoster
Attachment #796380 - Flags: feedback?(mbrubeck)
Comment on attachment 796380 [details] [diff] [review]
Use document aspect ratio check to determine scroll direction

Review of attachment 796380 [details] [diff] [review]:

Looks good to me.
Attachment #796380 - Flags: review+
Attachment #796380 - Flags: feedback?(mbrubeck)
Attachment #796380 - Flags: feedback+
Added an early return when we have non-zero scrollMaxX or scrollMaxY. Tests out well for me using snapped, full, landscape and portrait, and should work for split view
Attachment #796380 - Attachment is obsolete: true
Attachment #799131 - Flags: review?(mbrubeck)
Attachment #799131 - Flags: review?(mbrubeck) → review+
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
You need to log in before you can comment on or make changes to this bug.