Closed
Bug 164249
Opened 23 years ago
Closed 21 years ago
button attribute on handler element not filtering properly
Categories
(Core :: XBL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jwatt, Assigned: hyatt)
Details
Attachments
(1 file, 2 obsolete files)
6.82 KB,
patch
|
janv
:
review+
bryner
:
superreview+
|
Details | Diff | Splinter Review |
For handler tags with the event attribute set to 'mousedown' or 'mouseup', when
I place a button attribute on the tag the event is never matched if there are no
other attribute set on the tag - even if the button depressed is the button
specified in the button attribute. However, add say modifiers="alt" and, as long
as the alt key is depressed, the button attribute suddenly starts filtering
properly and the event is matched.
Additionally, if the event attribute is set to 'mousemove' then even with the
modifiers attribute set to something the event is never matched.
![]() |
||
Comment 1•22 years ago
|
||
Jonathan, could you possibly create a testcase that could be used to reproduce
this bug?
Comment 2•22 years ago
|
||
bz: no testcase needed, just try dragging tree column headers with any modifier
pressed.
Comment 3•22 years ago
|
||
Per draft spec, attributes on <handler> that are not present should not be
checked. So if modifier="" is not present then any modifier should be allowed.
http://www.hixie.ch/specs/xbl/xbl
Comment 4•22 years ago
|
||
OK, so by making mKeyMask signed I can put -1 in it to indicate that modifiers
should not be tested. I also optimized the key event test - mMisc can't be set
unless mDetail is set.
Updated•22 years ago
|
Attachment #137110 -
Flags: superreview?(bz-vacation)
Attachment #137110 -
Flags: review?(bryner)
Comment 5•22 years ago
|
||
Comment on attachment 137110 [details] [diff] [review]
Proposed patch
I've just discovered a large issue with this patch: most of our current key
bindings omit modifiers expecting them to default to none :-(
![]() |
||
Comment 6•22 years ago
|
||
Comment on attachment 137110 [details] [diff] [review]
Proposed patch
in that case... (just to get this out of my queue)
Attachment #137110 -
Flags: review?(bryner) → review-
Comment 7•22 years ago
|
||
OK, this version makes mouse events follow the spec. However key events still
work in two modes: 1) no key or code specified, match any key 2) key or code
specified, match key/code and modifiers, even when no modifiers are specified.
Updated•22 years ago
|
Attachment #137110 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 8•22 years ago
|
||
The intent of the spec has always been that if any filter is imposed on an event, you must match what is
specified exactly.
That means, for example, that if the author specifies a button but no modifiers, that the event will only
be matched if no modifiers were pressed and if the precises button was pressed.
For key events, if the user specifies a key code but no modifiers, the event should only be matched if no
modifiers are pressed.
Comment 9•22 years ago
|
||
would probably be useful to have a modifiers="any", then.
Comment 10•22 years ago
|
||
Most native widgets ignore modifiers on mouse events... does this means we need
to fix up all our mouse xbl to test for event.button in script?
![]() |
||
Updated•22 years ago
|
Attachment #137110 -
Flags: superreview?(bz-vacation)
Comment 11•22 years ago
|
||
neil: no, it means you would have
button="1" modifiers="any"
...or some such. I'm thinking maybe modifiers should be a comma separated list
of space separated lists, so you could say:
button="1" modifiers="ctrl, alt ctrl, shift ctrl"
...to match when either ctrl is down, alt and ctrl are down, or shift and ctrl
are down. Or maybe:
button="1" modifiers="ctrl any, alt any"
...to mean when ctrl is down or alt is down (and any other modifiers, they don't
matter) but not when neither is down.
I don't know how useful that would be though. Maybe simpler is better.
Comment 12•21 years ago
|
||
OK, so this version supports the keyword "any" in the modifiers which indicates
that the state of the preceeding modifiers is irrelevent, thus if you specify
modifiers="control any, shift" it requires shift but not alt or meta.
Attachment #137459 -
Attachment is obsolete: true
Comment 13•21 years ago
|
||
Comment on attachment 147720 [details] [diff] [review]
Another go
The reason I'm doing this is I want to be able to tweak tree.xml to say (e.g.)
<handler event="keypress" keycode="vk_down" modifiers="control any, shift"> ...
this.view.selection.rangedSelect(-1, c + 1, event.ctrlKey); [subject to changes
to syntax of modifiers attribute]
Attachment #147720 -
Flags: review?(varga)
Comment 14•21 years ago
|
||
Comment on attachment 147720 [details] [diff] [review]
Another go
what a nice enhancement!
r=varga
Attachment #147720 -
Flags: review?(varga) → review+
Updated•21 years ago
|
Attachment #147720 -
Flags: superreview?(bryner)
![]() |
||
Comment 15•21 years ago
|
||
Comment on attachment 147720 [details] [diff] [review]
Another go
Just wanted to make sure you tested shift+space, which I think is the main
reason for the special handling of shift. Looks fine otherwise.
Attachment #147720 -
Flags: superreview?(bryner) → superreview+
Comment 16•21 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
![]() |
Reporter | |
Comment 17•21 years ago
|
||
Neil, I think your changes are great, but I'm not sure about the word "any" for
what it does, or that the ignored modifiers should come first. How about putting
the required modifiers first and using the word "ignore"? E.g. modifiers="shift,
ignore control". That seems more intuative, and it leaves the use of "any" for
what hixie describes in c11 if it turns out to be desirable to add that
functionality in the future.
Comment 18•21 years ago
|
||
*** Bug 164252 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•