W3C home > Mailing lists > Public > public-pointer-events@w3.org > July to September 2014

Amazing set/releasePointerCapture

From: Maksim Lebedev <alessarik@gmail.com>
Date: Fri, 12 Sep 2014 09:49:00 +0400
Message-ID: <CAMDeA0bq64C-XpoBQTx_d2RdDd9FWKtnQyf4PmaD2NApWNWa8g@mail.gmail.com>
To: "public-pointer-events@w3.org" <public-pointer-events@w3.org>
Hi folks.

I have been confused by specification again.

I would like to propose FIRST TEST CASE to official test suite.

function TargetOnPointerDown(event) {
  listener.setPointerCapture(event.pointerId);
  listener.releasePointerCapture(event.pointerId);
}

What will happened after this function was executed? I assume that
listener will not have pointer capturing. But...
According current version of specification:
   After setPointerCapturing we will have such things:
      "pending-pcto" (pending pointer capture target override) is listener.
      "pct-override" (pointer capture target override) is empty.
   During releasePointerCapture according steps in 10.2:
      step 2: "If pointer capture is not currently set...". Question:
when is it true, then pct-override is non empty or then pending-pcto
is non-empty?
      step 3: "if the pct-override is not the element on which this
method was invoked...". But pct-override is empty, and we should
terminate other steps.
   After releasePointerCapture we will have such things:
      pending-pcto is listener (because we didn't clear it on previous algorithm
      pct-override is empty.
   And before next pointer event we should run 5.2.1. As results
listener will receive gotpointercapture event. Is it expected?

If current behavior of specification is wrong, and if anybody want to
simply change steps in 10.2, I would like to propose SECOND TEST CASE
to official test suite.

function TargetOnPointerDown(event) {
   middler.setPointerCapture(event.pointerId);
}
function MiddlerOnGotPointerCapture(event) {
   listener.setPointerCapture(event.pointerId);
   listener.releasePointerCapture(event.pointerId);
}

What will happened in this case. According current version of
specification listener will receive gotpointercapture event.
But if it is wrong, and expected result is that listener should not
receive gotpointercapture event, I would like to provide next
question:
   What should happened with middler? Should middler receive
lostpointercapture event or not?

And at the end I would like to propose THIRD TEST CASE to official test suite.

function TargetOnPointerDown(event) {
   middler.setPointerCapture(event.pointerId);
}
function MiddlerOnGotPointerCapture(event) {
   listener.setPointerCapture(event.pointerId);
   middler.releasePointerCapture(event.pointerId);  // Very important
that release capture from middler
}

What will happened in this case. According current specification
middler will receive lostpointercapture and listener will receive
gotpoointercapture.
Is it expected? Or maybe expected behavior is: middler will receive
lostpointercapture, but listener will receive nothing?

Thanks, Maksim Lebedev.
Received on Friday, 12 September 2014 05:49:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:48:10 UTC