Auto merge of #6773 - dzbarsky:which, r=Ms2ger

Fix MouseEvent.which to not throw



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6773)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-07-27 05:57:09 -06:00
commit 5b90cfd57d
2 changed files with 3 additions and 4 deletions

View file

@ -160,11 +160,11 @@ impl<'a> MouseEventMethods for &'a MouseEvent {
// - https://github.com/servo/servo/issues/6643 // - https://github.com/servo/servo/issues/6643
// - https://bugzilla.mozilla.org/show_bug.cgi?id=1186125 // - https://bugzilla.mozilla.org/show_bug.cgi?id=1186125
// This returns the same result as current gecko. // This returns the same result as current gecko.
fn GetWhich(self) -> Fallible<i32> { fn Which(self) -> i32 {
if opts::experimental_enabled() { if opts::experimental_enabled() {
Ok((self.button.get() + 1) as i32) (self.button.get() + 1) as i32
} else { } else {
Err(NotSupported) 0
} }
} }

View file

@ -20,7 +20,6 @@ interface MouseEvent : UIEvent {
//readonly attribute unsigned short buttons; //readonly attribute unsigned short buttons;
//boolean getModifierState (DOMString keyArg); //boolean getModifierState (DOMString keyArg);
[Throws]
readonly attribute long which; readonly attribute long which;
}; };