Skip to content

feature detection broken for embedded C# WebBrowser Control #37

Open
@wkeese

Description

@wkeese

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 ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions