Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#14614 closed enhancement (fixed)

dojo/sniff module

Reported by: bill Owned by: bill
Priority: high Milestone: 1.8
Component: Core Version: 1.7.1
Keywords: Cc:
Blocked By: Blocking:


Create new dojo/sniff module, and deprecate dojo/_base/sniff, to be removed in 2.0.

The new module will set has() flags like has("ie"), but not globals like dojo.isIE.

Change History (5)

comment:1 Changed 10 years ago by bill

Resolution: fixed
Status: newclosed

In [27547]:

Create dojo/sniff module to eventually replace dojo/_base/sniff.

dojo/sniff functions similarly to dojo/_base/sniff, but doesn't set globals in dojo like dojo.isIE. It also doesn't set dojo.locale, which was strangely being set by dojo/_base/sniff.

Other changes:

  • removed detection for safari 2, since it's been EOL for a long time
  • added has("wii") flag; previously only dojo.isWii was set
  • use has.add() rather than shortcut hasAdd() so that build tool can strip those statements for browser specific builds
  • has("khtml") was evaluating to 0 when they should have been undefined

Fixes #14614

comment:2 Changed 10 years ago by bill

In [27548]:

fix dojo.isFF, refs #14614

comment:3 Changed 10 years ago by bill

In [27550]:

Convert dojo/ modules and test files to use has("xyz") rather than dojo.isXYZ (ex: dojo.isIE --> has("ie")). Also changing dojo/ modules to require dojo/sniff instead of dojo/_base/sniff. Didn't change modules and test files that aren't yet in AMD format.

Previously, modules we referencing dojo.isQuirks rather than calling has("quirks") because quirks mode can change over time, specifically when a dojo.withDoc() call points dojo to an iframe in a different quirks mode from the main document. But in that case, the value of has("quirks") also changes, so I think it's OK to use it.

Refs #14614 !strict.

comment:4 Changed 10 years ago by bill

In [27555]:

Change dijit/ modules to require dojo/sniff instead of dojo/_base/sniff. Refs #14614 !strict.

comment:5 Changed 10 years ago by bill

In [28613]:

Removing a reference to the dojo "global", although not sure that dojo.local setting code is future proof (for IE9, IE10, etc.), probably should be using a "feature test", refs #14614 !strict

Note: See TracTickets for help on using tickets.