mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 09:19:28 +00:00
Fix for bug 815158 (Make HTMLElement.ontouch* work with tristate dom.w3c_touch_events.enabled). r=bz.
--HG-- extra : rebase_source : 878d559d1a57ad69bdac7bea682ea344ecdea96a
This commit is contained in:
parent
fcaf160cf1
commit
ba333c8392
@ -100,6 +100,7 @@
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsHTMLDocument.h"
|
||||
#include "nsDOMTouchEvent.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@ -2906,6 +2907,24 @@ nsGenericHTMLElement::IsLabelable() const
|
||||
Tag() == nsGkAtoms::meter;
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
nsGenericHTMLElement::PrefEnabled()
|
||||
{
|
||||
// This is a bit of a hack because we don't support non-bool prefs to enable
|
||||
// properties. This function will be called every time a HTMLElement interface
|
||||
// prototype object is created. The first time this is called we set a boolean
|
||||
// pref (dom.w3c_touch_events.expose) which controls the touch event
|
||||
// properties on HTMLElement.
|
||||
static bool sDidSetPref = false;
|
||||
if (!sDidSetPref) {
|
||||
sDidSetPref = true;
|
||||
Preferences::SetBool("dom.w3c_touch_events.expose",
|
||||
nsDOMTouchEvent::PrefEnabled());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsGenericHTMLFormElement::nsGenericHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
|
@ -715,6 +715,8 @@ public:
|
||||
|
||||
virtual bool IsLabelable() const;
|
||||
|
||||
static bool PrefEnabled();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Add/remove this element to the documents name cache
|
||||
|
@ -15,6 +15,7 @@
|
||||
interface DOMStringMap;
|
||||
interface HTMLMenuElement;
|
||||
|
||||
[PrefControlled]
|
||||
interface HTMLElement : Element {
|
||||
// metadata attributes
|
||||
attribute DOMString title;
|
||||
@ -207,17 +208,17 @@ interface HTMLElement : Element {
|
||||
[SetterThrows]
|
||||
attribute EventHandler onwheel;
|
||||
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
|
||||
attribute EventHandler ontouchstart;
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
|
||||
attribute EventHandler ontouchend;
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
|
||||
attribute EventHandler ontouchmove;
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
|
||||
attribute EventHandler ontouchenter;
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
|
||||
attribute EventHandler ontouchleave;
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
|
||||
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
|
||||
attribute EventHandler ontouchcancel;
|
||||
|
||||
[SetterThrows]
|
||||
|
Loading…
x
Reference in New Issue
Block a user