summaryrefslogtreecommitdiff
path: root/minionlivesmatter/templates/assets/jquery/src/css/defaultDisplay.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-24 17:12:23 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-24 17:12:23 +0100
commit54b8482223288a4d5df41267f3c9235bab06c15e (patch)
tree2df9f4e43168ab4fcda02e67740bf9772985eb5a /minionlivesmatter/templates/assets/jquery/src/css/defaultDisplay.js
parenta2d5335f18e053c14e8f88efa5f97368777341be (diff)
downloadmeta-54b8482223288a4d5df41267f3c9235bab06c15e.tar.gz
meta-54b8482223288a4d5df41267f3c9235bab06c15e.zip
add minionlivesmatter
Diffstat (limited to 'minionlivesmatter/templates/assets/jquery/src/css/defaultDisplay.js')
-rw-r--r--minionlivesmatter/templates/assets/jquery/src/css/defaultDisplay.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/minionlivesmatter/templates/assets/jquery/src/css/defaultDisplay.js b/minionlivesmatter/templates/assets/jquery/src/css/defaultDisplay.js
new file mode 100644
index 0000000..b1fb577
--- /dev/null
+++ b/minionlivesmatter/templates/assets/jquery/src/css/defaultDisplay.js
@@ -0,0 +1,72 @@
+define( [
+ "../core",
+ "../var/document",
+ "../manipulation" // appendTo
+], function( jQuery, document ) {
+
+var iframe,
+ elemdisplay = {
+
+ // Support: Firefox
+ // We have to pre-define these values for FF (#10227)
+ HTML: "block",
+ BODY: "block"
+ };
+
+/**
+ * Retrieve the actual display of a element
+ * @param {String} name nodeName of the element
+ * @param {Object} doc Document object
+ */
+
+// Called only from within defaultDisplay
+function actualDisplay( name, doc ) {
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+
+ display = jQuery.css( elem[ 0 ], "display" );
+
+ // We don't have any data stored on the element,
+ // so use "detach" method as fast way to get rid of the element
+ elem.detach();
+
+ return display;
+}
+
+/**
+ * Try to determine the default display value of an element
+ * @param {String} nodeName
+ */
+function defaultDisplay( nodeName ) {
+ var doc = document,
+ display = elemdisplay[ nodeName ];
+
+ if ( !display ) {
+ display = actualDisplay( nodeName, doc );
+
+ // If the simple way fails, read from inside an iframe
+ if ( display === "none" || !display ) {
+
+ // Use the already-created iframe if possible
+ iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
+ .appendTo( doc.documentElement );
+
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+ doc = iframe[ 0 ].contentDocument;
+
+ // Support: IE
+ doc.write();
+ doc.close();
+
+ display = actualDisplay( nodeName, doc );
+ iframe.detach();
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return display;
+}
+
+return defaultDisplay;
+} );