~caneypuggies/reformedchurcheslocator/couchapp-backbone

« back to all changes in this revision

Viewing changes to _attachments/js/vendor/modernizr/feature-detects/css-displaytable.js

  • Committer: Tim Black
  • Date: 2013-09-16 22:50:16 UTC
  • Revision ID: tim@alwaysreformed.com-20130916225016-zk8jiba25z33ew7h
Versioned Bower vendor directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// display: table and table-cell test. (both are tested under one name "table-cell" )
 
2
// By @scottjehl
 
3
 
 
4
// all additional table display values are here: http://pastebin.com/Gk9PeVaQ though Scott has seen some IE false positives with that sort of weak detection.
 
5
// more testing neccessary perhaps.
 
6
 
 
7
Modernizr.addTest( "display-table",function(){
 
8
  
 
9
  var doc   = window.document,
 
10
      docElem = doc.documentElement,   
 
11
      parent  = doc.createElement( "div" ),
 
12
      child = doc.createElement( "div" ),
 
13
      childb  = doc.createElement( "div" ),
 
14
      ret;
 
15
  
 
16
  parent.style.cssText = "display: table";
 
17
  child.style.cssText = childb.style.cssText = "display: table-cell; padding: 10px";    
 
18
          
 
19
  parent.appendChild( child );
 
20
  parent.appendChild( childb );
 
21
  docElem.insertBefore( parent, docElem.firstChild );
 
22
  
 
23
  ret = child.offsetLeft < childb.offsetLeft;
 
24
  docElem.removeChild(parent);
 
25
  return ret; 
 
26
});
 
27