Open Bug 1590301 Opened 5 years ago Updated 2 years ago

window.TouchEvent should be `undefined` when touch simulation is off in RDM

Categories

(DevTools :: Responsive Design Mode, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: pbro, Unassigned)

References

(Blocks 1 open bug)

Details

STR:

  1. Make sure devtools.responsive.touchSimulation.enabled is false
  2. Open a site
  3. Open RDM
  4. Make sure the reload when touch simulation is toggled setting is off in RDM
  5. Evaluate window.TouchEvent in the console ==> undefined
  6. Click the touch simulation button
  7. Evaluate window.TouchEvent in the console ==> function
  8. Click the touch simulation button to uncheck it
  9. Evaluate window.TouchEvent again ==> still function

Seems like we should make a clear decision about desired behavior here. Should TouchEvent constructor always be available or only conditionally available? My vote is that the constructor should always be available. I don't see anything in the spec (https://www.w3.org/TR/touch-events) that indicates otherwise. I'll proceed with that intention.

Code is changing in this space. This will need a re-test after Bug 1588438 lands.

Depends on: 1588438
Priority: -- → P3

I think the TouchEvent interface should be always available, as it would be much simpler to write e instanceof TouchEvent than check that its type matches. Should I open a separate issue for this discussion?

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.