nnnjjj123
2020-11-17 1b2c1edb61190eeb19f465ff031eaa3b2a1b8dbc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
define([
    'dojo/has'
], function (has) {
    // This module defines feature tests for CSS3 features such as transitions.
    // The css-transitions, css-transforms, and css-transforms3d has-features
    // can report either boolean or string:
    // * false indicates no support
    // * true indicates prefix-less support
    // * string indicates the vendor prefix under which the feature is supported
 
    var cssPrefixes = ['ms', 'O', 'Moz', 'Webkit'];
 
    function testStyle(element, property) {
        var style = element.style,
            i;
 
        if (property in style) {
            // Standard, no prefix
            return true;
        }
        property = property.slice(0, 1).toUpperCase() + property.slice(1);
        for (i = cssPrefixes.length; i--;) {
            if ((cssPrefixes[i] + property) in style) {
                // Vendor-specific css property prefix
                return cssPrefixes[i];
            }
        }
 
        // Otherwise, not supported
        return false;
    }
 
    has.add('css-transitions', function (global, doc, element) {
        return testStyle(element, 'transitionProperty');
    });
 
    has.add('css-transforms', function (global, doc, element) {
        return testStyle(element, 'transform');
    });
 
    has.add('css-transforms3d', function (global, doc, element) {
        return testStyle(element, 'perspective');
    });
 
    has.add('transitionend', function () {
        // Infer transitionend event name based on CSS transitions has-feature.
        var tpfx = has('css-transitions');
        if (!tpfx) {
            return false;
        }
        if (tpfx === true) {
            return 'transitionend';
        }
        return {
            ms: 'MSTransitionEnd',
            O: 'oTransitionEnd',
            Moz: 'transitionend',
            Webkit: 'webkitTransitionEnd'
        }[tpfx];
    });
 
    return has;
});