Closed Bug 561979 Opened 14 years ago Closed 14 years ago

Scrolling with mouse dragging does not work when cursor is over span element with 'overflow:auto' style

Categories

(Toolkit :: UI Widgets, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: komarik, Assigned: alice0775)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.3a5pre) Gecko/20100426 Minefield/3.7a5pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a5pre) Gecko/20100426 Minefield/3.7a5pre

The page is not scrolling if you begin scrolling on span element with 'overflow:auto' style.

Reproducible: Always

Steps to Reproduce:
1. Go to http://pastehtml.com/view/5uf9kt3.html
2. Ensure there is a scrollbar on the right side of browser window.
3. Click middle mouse button anywhere on the page and drag down.
Actual Results:  
A usual 'scroll icon' with four arrows appears, but the page is not scrolling.

Expected Results:  
The page should scroll freely.
Summary: Scrolling with mouse drag does not work when cursor is over span element with 'overflow:auto' style → Scrolling with mouse dragging does not work when cursor is over span element with 'overflow:auto' style
Regression Window:

Works:
http://hg.mozilla.org/mozilla-central/rev/bfe41dab22a5
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a2pre) Gecko/20100218 Minefield/3.7a2pre ID:20100218120751

Fails:
http://hg.mozilla.org/mozilla-central/rev/78cf81cafcff
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a2pre) Gecko/20100219 Minefield/3.7a2pre ID:20100219043233

Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=bfe41dab22a5&tochange=78cf81cafcff

Candidate Bug:
Bug 545970  - Autoscroll widget doesn't appear or wrong image appears in certain cases
Blocks: 545970
Status: UNCONFIRMED → NEW
Component: General → XUL Widgets
Ever confirmed: true
Keywords: regression
Product: Core → Toolkit
QA Contact: general → xul.widgets
Version: unspecified → Trunk
The following fixes the problem.
toolkit/content/widgets/browser.xml

              // we already discarded non-multiline selects so allow vertical
              // scroll for multiline ones directly without checking for a
              // overflow property
-              var scrollVert = this._scrollable.scrollHeight > this._scrollable.clientHeight &&
+              var scrollVert = this._scrollable.clientHeight !=0 &&
                               this._scrollable.scrollHeight > this._scrollable.clientHeight &&
                               (this._scrollable instanceof HTMLSelectElement ||
                                scrollingAllowed.indexOf(overflowy) >= 0);

              // do not allow horizontal scrolling for select elements, it leads
              // to visual artifacts and is not the expected behavior anyway
              if (!(this._scrollable instanceof HTMLSelectElement) &&
+                  this._scrollable.clientWidth !=0 &&
                  this._scrollable.scrollWidth > this._scrollable.clientWidth &&
                  scrollingAllowed.indexOf(overflowx) >= 0) {
                this._autoScrollPopup.setAttribute("scrolldir", scrollVert ? "NSEW" : "EW");
                break;
              }
Care to attach this as a patch?
Please make sure to insert a space between "!=" and "0".
r+= me with that nit fixed.
(In reply to comment #3)
> Care to attach this as a patch?
> Please make sure to insert a space between "!=" and "0".
> r+= me with that nit fixed.

If it's OK, Please make a patch from source tree.
(I am not familiar with source tree)
I've credited you for the patch, r=me.
I will commit this later today.
Attachment #441744 - Flags: review+
Assignee: nobody → alice0775
Status: NEW → ASSIGNED
Attachment #441744 - Attachment description: patch → patch [pushed: comment 6]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: