Last Comment Bug 664275 - mixed CSS overflow allows user to scroll to hidden content using keyboard or mouse's scroll wheel
: mixed CSS overflow allows user to scroll to hidden content using keyboard or ...
Status: RESOLVED DUPLICATE of bug 325942
:
Product: Core
Classification: Components
Component: Layout: View Rendering (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-14 13:57 PDT by Lucas Sanders
Modified: 2011-06-14 14:20 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
simplified testcase (1.26 KB, text/plain)
2011-06-14 13:58 PDT, Lucas Sanders
no flags Details
partial workaround (1.41 KB, text/plain)
2011-06-14 14:00 PDT, Lucas Sanders
no flags Details

Description Lucas Sanders 2011-06-14 13:57:10 PDT
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0a2) Gecko/20110614 Firefox/6.0a2
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0a2) Gecko/20110614 Firefox/6.0a2

An element assigned the CSS properties overflow-x: hidden and overflow-y: scroll (or auto) is expected to prevent the user from scrolling horizontally to view clipped content.  As a result, such an element displays a vertical scroll bar but *not* a horizontal scroll bar.  Unfortunately, this constraint is not enforced when scrolling the element with the keyboard or, in certain circumstances, with a mouse's scroll wheel.

When scrolling the element with a mouse's scroll wheel, the bug only manifests itself when the user successively scrolls the element vertically, then horizontally, using the scroll wheel.  Users are particularly likely to do this when using Apple's standard mice and trackpads, since anything other than a perfectly vertical or horizontal motion results in "diagonal" scrolling, represented by successively scrolling in the horizontal and vertical directions.  If the user uses the vertical scroll bar to scroll the element, that action prevents further horizontal scrolling with their mouse's scroll wheel until they have once again used the scroll wheel to scroll the element vertically.

This issue can be partially worked around by nesting the problem element inside an absolutely-positioned element with a fixed width and overflow: hidden.  This workaround prevents the keyboard scrolling variant of this bug.  Even with the workaround, users can scroll horizontally using a mouse's scroll wheel after scrolling vertically with their scroll wheel -- although this workaround does snap the view back to the far-left horizontal scroll position when the user subsequently uses the scroll bar for vertical scrolling.

Reproducible: Always

Steps to Reproduce:
If you have a horizontal scroll wheel on your mouse (or other pointing device):

1. Visit testcase.
2. Use the scroll wheel to scroll the page vertically.
3. Use the scroll wheel to scroll the page horizontally.

Alternatively, if you have a keyboard with arrow keys:

1. Visit testcase.
2. Use the keyboard's arrow keys to scroll horizontally.

Actual Results:  
The user is able to scroll the page horizontally to view clipped content.

Expected Results:  
The user should not be able to scroll this page horizontally.

I will attach two simplified testcases:  one demonstrating the bug and the other demonstrating my partial workaround.

This bug is present in release builds of Firefox 3.x and Firefox 4, as well as the most recent Aurora build.
Comment 1 Lucas Sanders 2011-06-14 13:58:45 PDT
Created attachment 539312 [details]
simplified testcase

Attaching a simplified testcase to demonstrate this bug's behavior.
Comment 2 Lucas Sanders 2011-06-14 14:00:00 PDT
Created attachment 539314 [details]
partial workaround

Attaching a simplified demonstration of my partial workaround to mitigate this bug's behavior.
Comment 3 Lucas Sanders 2011-06-14 14:10:53 PDT
A real-world use case can be found at http://www.mainerural.org/inspireme/

This page uses my partial workaround, so is not susceptible to improper keyboard scrolling, etc.
Comment 4 David Baron :dbaron: ⌚️UTC+8 (review requests must explain patch) 2011-06-14 14:20:42 PDT

*** This bug has been marked as a duplicate of bug 325942 ***

Note You need to log in before you can comment on or make changes to this bug.