Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

support.js 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. define( [
  2. "../core",
  3. "../var/document",
  4. "../var/documentElement",
  5. "../var/support"
  6. ], function( jQuery, document, documentElement, support ) {
  7. "use strict";
  8. ( function() {
  9. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  10. // so they're executed at the same time to save the second computation.
  11. function computeStyleTests() {
  12. // This is a singleton, we need to execute it only once
  13. if ( !div ) {
  14. return;
  15. }
  16. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  17. "margin-top:1px;padding:0;border:0";
  18. div.style.cssText =
  19. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  20. "margin:auto;border:1px;padding:1px;" +
  21. "width:60%;top:1%";
  22. documentElement.appendChild( container ).appendChild( div );
  23. var divStyle = window.getComputedStyle( div );
  24. pixelPositionVal = divStyle.top !== "1%";
  25. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  26. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  27. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  28. // Some styles come back with percentage values, even though they shouldn't
  29. div.style.right = "60%";
  30. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  31. // Support: IE 9 - 11 only
  32. // Detect misreporting of content dimensions for box-sizing:border-box elements
  33. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  34. // Support: IE 9 only
  35. // Detect overflow:scroll screwiness (gh-3699)
  36. // Support: Chrome <=64
  37. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  38. div.style.position = "absolute";
  39. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  40. documentElement.removeChild( container );
  41. // Nullify the div so it wouldn't be stored in the memory and
  42. // it will also be a sign that checks already performed
  43. div = null;
  44. }
  45. function roundPixelMeasures( measure ) {
  46. return Math.round( parseFloat( measure ) );
  47. }
  48. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  49. reliableMarginLeftVal,
  50. container = document.createElement( "div" ),
  51. div = document.createElement( "div" );
  52. // Finish early in limited (non-browser) environments
  53. if ( !div.style ) {
  54. return;
  55. }
  56. // Support: IE <=9 - 11 only
  57. // Style of cloned element affects source element cloned (#8908)
  58. div.style.backgroundClip = "content-box";
  59. div.cloneNode( true ).style.backgroundClip = "";
  60. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  61. jQuery.extend( support, {
  62. boxSizingReliable: function() {
  63. computeStyleTests();
  64. return boxSizingReliableVal;
  65. },
  66. pixelBoxStyles: function() {
  67. computeStyleTests();
  68. return pixelBoxStylesVal;
  69. },
  70. pixelPosition: function() {
  71. computeStyleTests();
  72. return pixelPositionVal;
  73. },
  74. reliableMarginLeft: function() {
  75. computeStyleTests();
  76. return reliableMarginLeftVal;
  77. },
  78. scrollboxSize: function() {
  79. computeStyleTests();
  80. return scrollboxSizeVal;
  81. }
  82. } );
  83. } )();
  84. return support;
  85. } );