Closed
Bug 859126
Opened 12 years ago
Closed 11 years ago
Mouse scrolling of long menus breaks if the last item is hidden via display:none
Categories
(Toolkit :: UI Widgets, defect)
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: mozilla, Assigned: alice0775)
References
Details
Attachments
(2 files)
2.79 KB,
application/vnd.mozilla.xul+xml
|
Details | |
966 bytes,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20100101 Firefox/17.0
Build ID: 20130107124423
Steps to reproduce:
1. Hide the last item of the bookmarks menu (eg: set menu_unsortedBookmarks to display: none in CSS).
2. Add enough bookmarks that scroll arrows appear on the menu.
3. Open bookmarks menu and twirl the mouse wheel.
Actual results:
1. Nothing.
Expected results:
1. The menu should scroll to show items which didn't fit on the screen.
Seems like this applies to all scrollboxes but I tested it with the bookmarks menu. Adding non-blank items to the end of the menu makes scrolling work again, even invisible ones such as a zero-size spacer or a collapsed item.
Scrolling by hovering on the arrows works, this is scrollByPixel() rather than scrollByItem(). Should they both be the same?
Updated•12 years ago
|
Component: Untriaged → Bookmarks & History
Assignee | ||
Comment 1•12 years ago
|
||
you should use visibility:collapse instead of display:none.
Assignee | ||
Updated•12 years ago
|
Component: Bookmarks & History → XUL
OS: Linux → All
Product: Firefox → Core
Version: 17 Branch → 1.9.2 Branch
Assignee | ||
Comment 2•12 years ago
|
||
Regression window:
Good:
http://hg.mozilla.org/mozilla-central/rev/68cfe7fb9f31
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2a1pre) Gecko/20090413 Minefield/3.6a1pre ID:20090413045916
Bad:
http://hg.mozilla.org/mozilla-central/rev/68d9acc70491
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2a1pre) Gecko/20090414 Minefield/3.6a1pre ID:20090414100052
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=68cfe7fb9f31&tochange=68d9acc70491
Suspected: Bug 487946
Blocks: 487946
Assignee | ||
Comment 3•12 years ago
|
||
This triggered by
10528984d5fd Dão Gottwald — Bug 487982 - arrowscrollbox.scrollByIndex fails if there are gaps between the elements. r=enn
Updated•12 years ago
|
Component: XUL → XUL Widgets
Product: Core → Toolkit
Reporter | ||
Comment 4•12 years ago
|
||
(In reply to Alice0775 White from comment #1)
> you should use visibility:collapse instead of display:none.
"visibility:collapse" is not a suitable alternative to "display: none" in this case. Menuitems with "visibility: collapse" can still be tabbed to and can still be activated using the keyboard, causing much confusion since they are invisible.
Assignee | ||
Comment 5•12 years ago
|
||
cannot scroll to 'display:none' element
Assignee | ||
Updated•12 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 6•12 years ago
|
||
Comment on attachment 734579 [details] [diff] [review]
possible fix
_canScrollToElement is called pretty frequently, so if we want to take this patch we need to make sure it doesn't perform significantly worse.
Assignee | ||
Updated•11 years ago
|
Attachment #734579 -
Attachment is obsolete: true
Comment 7•11 years ago
|
||
Comment on attachment 734579 [details] [diff] [review]
possible fix
I think this is probably ok performance-wise, as the code calling _canScrollToElement flushes layout anyway and layout shouldn't get dirty again between successive _canScrollToElement calls.
> <method name="_canScrollToElement">
> <parameter name="element"/>
>- <body>
>- return !element.hidden;
>- </body>
>+ <body><![CDATA[
>+ return !element.hidden &&
>+ window.getComputedStyle(element, null).getPropertyValue("display") != "none";
>+ ]]></body>
> </method>
The !element.hidden check can be dropped.
Attachment #734579 -
Attachment is obsolete: false
Attachment #734579 -
Flags: review+
Updated•11 years ago
|
Assignee: nobody → alice0775
Comment 8•11 years ago
|
||
Summary: Mouse scrolling of long menus breaks if the last item is hidden → Mouse scrolling of long menus breaks if the last item is hidden via display:none
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•