Opened 6 years ago

Closed 6 years ago

#16658 closed defect (fixed)

dojox/mobile: improved iOS6 full-screen support to avoid unnecessary calls of resize()

Reported by: Adrian Vasiliu Owned by: Eric Durocher
Priority: undecided Milestone: 1.8.4
Component: DojoX Mobile Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

Since the introduction of ios6 full-screen support (#16066), dojox/mobile/common listens to global "resize" events on ios6 and performs a "resizeAll" in order to adjust the display. Heuristics are used to determine whether the "resize" event is likely to be due to the user switching on/off the new iOS6 full-screen mode. These heuristics help skipping most, but not all the resize events which don't correspond to switching on/off the full-screen mode. In most apps, these "false positive" resize events are harmless, but they have been found to be harmful in some cases (for instance when they indirectly trigger a page scroll, due to the address bar hidding). Hence, the heuristics have been enriched to cover more particular cases (#16361, #16202). But... yet another harmful case has been found:

How to reproduce:

  1. Launch demos/mobileGauges/demo-iphone.html under ios6
  2. Go to any gauge.
  3. Back
  4. Go to a second gauge (any other), scroll to bottom enough to produce a "bounce back" (no need to touch a gauge)
  5. Back
  6. Go to the first gauge

==> KO: the gauge view is empty

And a second failing scenario, still with dojox/dgauges:

  1. Launch demos/mobileGauges/demo-iphone.html under ios6 in portrait orientation.
  2. Go to any gauge.
  3. Turn back and forth between portrait and landscape orientations.

=> After some (variable) number of orientation changes, you get either the header, or the gauge, or both not centered anymore. (Workaround: turn the device again.)

Both cases appear to be side-effects of the extra calls of common.resizeAll(). The resizeAll ends with calls of resize() on the gauges at bad moments... (when their marginBox is empty).

To avoid these troubles and others that might be discovered in the future, a new, simpler and safer way to detect the full-screen switching has been implemented (see attached patch). This replaces all the previous heuristics (instead of adding to the existing ones). According to various tests it appears so far to be 100% reliable, that is dojox/mobile/common now calls common.resizeAll if and only if the full-screen is turned on/off.

Attachments (1)

patch16658.patch (5.6 KB) - added by Adrian Vasiliu 6 years ago.
iOS6: improved full-screen support - Adrian Vasiliu (IBM, CCLA)

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Adrian Vasiliu

Attachment: patch16658.patch added

iOS6: improved full-screen support - Adrian Vasiliu (IBM, CCLA)

comment:1 Changed 6 years ago by cjolif

Milestone: tbd1.8.4

comment:2 Changed 6 years ago by cjolif

In [30550]:

refs #16658. improve iOS6 full-screen support by simplifying the detection mechanism. Thanks Adrian Vasiliu (IBM, CCLA). !strict.

comment:3 Changed 6 years ago by cjolif

Resolution: fixed
Status: newclosed

In [30551]:

fixes #16658. improve iOS6 full-screen support by simplifying the detection mechanism. Thanks Adrian Vasiliu (IBM, CCLA). !strict.

Note: See TracTickets for help on using tickets.