2

The W3C CSSOM View Module draft defines offsetX and offsetY properties on the MouseEvent interface.

These seem very useful to me (and I have a current question related to them), and I want to be able to get the same value during touch events. (But this question is not asking how; that's elsewhere.)

Touch objects don't define an equivalent, as far as I can see.

Is there a reason for this?

Community
  • 1
  • 1
tremby
  • 9,541
  • 4
  • 55
  • 74
  • 1
    Maybe they forgot. You might propose this on https://github.com/w3c/touch-events/issues – Oriol Apr 03 '16 at 00:18
  • 1
    I'll do just that; thanks. (Edit: [done](https://github.com/w3c/touch-events/issues/62). I'll report back when there's an answer.) – tremby Apr 03 '16 at 00:27

1 Answers1

2

I asked the group who looks after the Touch spec.

The answer to the question is that the specification was written after the fact. It's just a reflection of the behaviour which already exists in the browsers, rather than something written with good standards and practices in mind which browsers should strive to adhere to.

In other words, Safari and the other browsers didn't add these properties (possibly an oversight, as suggested by @Oriol in his comment), and that's that.

I'm told that lobbying Apple to add new features is extremely difficult, and so since the W3C don't rate their chances of success tweaks like this are not made to these sorts of reverse-specifications.

The suggestion is to look to the future of PointerEvents, which inherit from MouseEvent and so should have these offsetX and offsetY properties.

tremby
  • 9,541
  • 4
  • 55
  • 74