Projet

Général

Profil

Paste
Télécharger (1,95 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / libraries / flexslider-2.5.0 / bower_components / jquery / src / attributes / support.js @ 0aee3c58

1
define([
2
        "../var/support"
3
], function( support ) {
4

    
5
(function() {
6
        // Minified: var a,b,c,d,e
7
        var input, div, select, a, opt;
8

    
9
        // Setup
10
        div = document.createElement( "div" );
11
        div.setAttribute( "className", "t" );
12
        div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
13
        a = div.getElementsByTagName("a")[ 0 ];
14

    
15
        // First batch of tests.
16
        select = document.createElement("select");
17
        opt = select.appendChild( document.createElement("option") );
18
        input = div.getElementsByTagName("input")[ 0 ];
19

    
20
        a.style.cssText = "top:1px";
21

    
22
        // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
23
        support.getSetAttribute = div.className !== "t";
24

    
25
        // Get the style information from getAttribute
26
        // (IE uses .cssText instead)
27
        support.style = /top/.test( a.getAttribute("style") );
28

    
29
        // Make sure that URLs aren't manipulated
30
        // (IE normalizes it by default)
31
        support.hrefNormalized = a.getAttribute("href") === "/a";
32

    
33
        // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
34
        support.checkOn = !!input.value;
35

    
36
        // Make sure that a selected-by-default option has a working selected property.
37
        // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
38
        support.optSelected = opt.selected;
39

    
40
        // Tests for enctype support on a form (#6743)
41
        support.enctype = !!document.createElement("form").enctype;
42

    
43
        // Make sure that the options inside disabled selects aren't marked as disabled
44
        // (WebKit marks them as disabled)
45
        select.disabled = true;
46
        support.optDisabled = !opt.disabled;
47

    
48
        // Support: IE8 only
49
        // Check if we can trust getAttribute("value")
50
        input = document.createElement( "input" );
51
        input.setAttribute( "value", "" );
52
        support.input = input.getAttribute( "value" ) === "";
53

    
54
        // Check if an input maintains its value after becoming a radio
55
        input.value = "t";
56
        input.setAttribute( "type", "radio" );
57
        support.radioValue = input.value === "t";
58
})();
59

    
60
return support;
61

    
62
});