Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature detection broken for embedded C# WebBrowser Control #37

Open
wkeese opened this issue Nov 25, 2015 · 0 comments
Open

feature detection broken for embedded C# WebBrowser Control #37

wkeese opened this issue Nov 25, 2015 · 0 comments

Comments

@wkeese
Copy link
Member

wkeese commented Nov 25, 2015

Similar to the discussion in dojo/dojo@17ed3d6#commitcomment-14347450, dpointer's feature detection for pointer-events and mspointer-events presumably doesn't work for embedded C# WebBrowser Controls, where pointer support can "exist" but not be "enabled".

I ended up changing the dojo code to:

// Test if pointer events are supported and enabled, with either standard names ("pointerdown" etc.) or
// IE specific names ("MSPointerDown" etc.).  Tests are designed to work on embedded C# WebBrowser Controls
// in addition to IE, Edge, and future versions of Firefox and Chrome.
// Note that on IE11, has("pointer-events") and has("MSPointer") are both true.
has.add("pointer-events", "pointerEnabled" in window.navigator ?
        window.navigator.pointerEnabled : "PointerEvent" in window);
has.add("MSPointer", window.navigator.msPointerEnabled);

(You can check the latest version of dojo/has.js to see if I needed to change it again, after writing this ticket.)

Also incidentally, the parentheses should be removed from this regex, since they aren't needed and slow it down:

has.add("touch-device", /(mobile)|(android)/i.test ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant