├── .gitattributes ├── .gitignore ├── .jshintrc ├── Gruntfile.js ├── LICENSE.md ├── README-PARALLIA.md ├── README.md ├── bin ├── css-polyfills.js ├── css-polyfills.js.map ├── css-polyfills.min.js └── css-polyfills.min.js.map ├── demo └── css-grid │ ├── basic-hover-test.html │ ├── common.css │ ├── example1.html │ ├── example10.html │ ├── example11.html │ ├── example12.html │ ├── example13.html │ ├── example14.html │ ├── example15.html │ ├── example16.html │ ├── example17.html │ ├── example18.html │ ├── example19.html │ ├── example2.html │ ├── example3.html │ ├── example4.html │ ├── example5.html │ ├── example6.html │ ├── example7.html │ ├── example8.html │ ├── example9.html │ ├── gap-col.html │ ├── gap-row.html │ ├── gap.html │ ├── ie11bug.html │ ├── layout1.html │ ├── layout2.html │ ├── layout3.html │ ├── layout4.html │ ├── layout5.html │ ├── order-property.html │ ├── sroll-preservation-test.html │ ├── tests │ ├── snapshots.js │ ├── test-runner.html │ ├── test-runner.js │ ├── test-server.js │ └── update-snapshots.js │ └── zero-unit-test.html ├── doc ├── README.md ├── README[header].md ├── core │ ├── css-box.ts │ ├── css-cascade.ts │ ├── css-sizing.ts │ ├── css-style.ts │ ├── css-syntax.ts │ ├── css-units.ts │ └── dom-events.ts └── requirements.ts ├── package.json └── src ├── core ├── css-box.js ├── css-cascade.js ├── css-sizing.js ├── css-style.js ├── css-syntax.js ├── css-units.js ├── css-virtual-stylesheet-factory.js ├── dom-events.js ├── dom-experimental-event-streams.js ├── dom-get-common-ancestor.js ├── dom-query-selector-live.js ├── polyfill-dom-classList.js ├── polyfill-dom-console.js ├── polyfill-dom-matchMedia.js ├── polyfill-dom-requestAnimationFrame.js └── polyfill-dom-uniqueID.js ├── css-grid ├── lib │ └── grid-layout.js └── polyfill.js ├── requirements.js └── todo.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ========================= 2 | # My files 3 | # ========================= 4 | 5 | doc/*.js 6 | doc/**/*.js 7 | src/css-syntax-tab.js 8 | 9 | # ========================= 10 | # Grunt files 11 | # ========================= 12 | 13 | /node_modules/ 14 | 15 | 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # Windows image file caches 22 | Thumbs.db 23 | ehthumbs.db 24 | 25 | # Folder config file 26 | Desktop.ini 27 | 28 | # Recycle Bin used on file shares 29 | $RECYCLE.BIN/ 30 | 31 | # Windows Installer files 32 | *.cab 33 | *.msi 34 | *.msm 35 | *.msp 36 | 37 | # OSX 38 | # ========================= 39 | 40 | .DS_Store 41 | .AppleDouble 42 | .LSOverride 43 | 44 | # Icon must end with two \r 45 | Icon 46 | 47 | # Thumbnails 48 | ._* 49 | 50 | # Files that might appear on external disk 51 | .Spotlight-V100 52 | .Trashes 53 | 54 | # Directories potentially created on remote AFP share 55 | .AppleDB 56 | .AppleDesktop 57 | Network Trash Folder 58 | Temporary Items 59 | .apdisk 60 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "immed": true, 5 | "latedef": true, 6 | "newcap": true, 7 | "noarg": true, 8 | "sub": true, 9 | "undef": true, 10 | "unused": true, 11 | "boss": true, 12 | "eqnull": true, 13 | "node": true 14 | } 15 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(grunt) { 4 | 5 | // Import the dependencies 6 | var url = require('url'); 7 | 8 | // Transform a require-uri into a canonical uri 9 | function resolveModuleUri(baseUri, relativeModuleUri) { 10 | 11 | // determine the url kind 12 | var indexOfSeparator = -1; 13 | if ((indexOfSeparator=relativeModuleUri.indexOf(':')) != -1) { 14 | var moduleUri = 'src/'+relativeModuleUri.substr(0,indexOfSeparator)+'/'+relativeModuleUri.substr(indexOfSeparator+1); 15 | } else { 16 | var moduleUri = url.resolve(baseUri, relativeModuleUri); 17 | } 18 | 19 | // potentially append .js 20 | if(!grunt.file.exists(moduleUri)) { moduleUri = moduleUri + '.js'; } 21 | 22 | // return the final value 23 | return moduleUri; 24 | } 25 | 26 | // Data storage 27 | var pkg = grunt.file.readJSON('package.json'); 28 | 29 | var code_wrapper_start = ( 30 | "\n"+ 31 | "!(function() { 'use strict';"+"\n"+ 32 | " var module = { exports:{} };"+"\n"+ 33 | " var require = (function() { var modules = {}; var require = function(m) { return modules[m]; }; require.define = function(m) { modules[m]=module.exports; module.exports={}; }; return require; })();" 34 | ); 35 | 36 | var code_wrapper_separator = "\n\n////////////////////////////////////////\n\n"; 37 | code_wrapper_start += code_wrapper_separator; 38 | 39 | var code_wrapper_end = ( 40 | "\n\n" + "window.cssPolyfills = { require: require };" + "\n\n" + "})();" 41 | ); 42 | 43 | 44 | // Project configuration. 45 | grunt.initConfig({ 46 | 47 | // 48 | // Metadata: 49 | // 50 | 51 | pkg: pkg, 52 | 53 | banner: 54 | '/*! <%= pkg.name.toUpperCase() %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>' + '<%= pkg.homepage ? " - " + pkg.homepage : "" %>' + ' - Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +' <%= _.pluck(pkg.licenses, "type").join("- and ") %>-Licensed !*/\n', 55 | code_wrapper_start: 56 | code_wrapper_start, 57 | code_wrapper_end: 58 | code_wrapper_end, 59 | code_wrapper_separator: 60 | code_wrapper_separator, 61 | 62 | // 63 | // Task configuration: 64 | // 65 | 66 | findreq: { 67 | root: '<%= pkg.main =>' 68 | }, 69 | 70 | concat: { 71 | bin: { 72 | src: ['<%= pkg.main %>'], 73 | dest: 'bin/<%= pkg.name %>.js', 74 | options: { 75 | banner: '<%= banner %><%= code_wrapper_start %>', 76 | footer: '<%= code_wrapper_end %>', 77 | separator: '<%= code_wrapper_separator %>', 78 | stripBanners: true, 79 | sourceMap: true, 80 | process: function(src, filepath) { 81 | 82 | return src.replace(/(?:(?:\/\/|\/\*)[-_=a-zA-Z0-9 ]*)?require\((\'.*?\'|\"".*?\"")\)/g, function(str, match) { 83 | if(str.indexOf('require')==0) { 84 | var relativeModuleUri = match.substr(1, match.length-2); 85 | var moduleUri = resolveModuleUri(filepath, relativeModuleUri); 86 | return "require('"+moduleUri+"')"; 87 | } else { 88 | return str; 89 | } 90 | })+"\nrequire.define('" + filepath + "');"; 91 | 92 | } 93 | } 94 | }, 95 | doc: { 96 | src: ['doc/**/*.ts'], 97 | dest: 'doc/README.md', 98 | options: { 99 | old_banner: '<%= ""+(function() { var source = grunt.file.read("doc/README.md"), reg = /(\\r?\\n){3}/; reg=reg.exec(source)[0]; return source.substr(0, reg.lastIndex); })() %>', 100 | banner: '<%= grunt.file.read("doc/README[header].md") %>', 101 | separator: '', 102 | stripBanners: false, 103 | sourceMap: false, 104 | process: function(src, filepath) { 105 | if(filepath == "doc/requirements.ts") { return; } 106 | try { 107 | var fileurl = filepath.replace(/^(\.\/)?doc\/?/,'./'); grunt.log.writeln(fileurl); 108 | var filename = /\/([^\/]+)\.ts/i.exec(filepath)[1]; grunt.log.writeln(filename); 109 | 110 | var firstComment = /(?: |\t)\*(?: |\t)(.*?)(\r?\n)/.exec(src)[1].trimRight(); grunt.log.writeln(firstComment); 111 | src = src.replace(/^(?:.|\r|\n)*?\/\/\/\/ EXAMPLES [\/\r\n ]+/,'/'); 112 | var extractExamples = /\/\*+ (.*?)(?:\*+\/)[\r\n]+function ?[a-zA-Z0-9_]*\([a-zA-Z0-9_, ]*\) *\{[\r\n\t ]*\r?\n((.|\r|\n)*?)([\r\n]+\})/g; 113 | var example, examples=''; while(example = extractExamples.exec(src)) { 114 | examples = examples + '\r\n### '+example[1].trim() + '\r\n\r\n```javascript\r\n\t'+example[2].trim()+'\r\n```\r\n'; 115 | } 116 | 117 | return ( 118 | "\r\n\r\n"+ 119 | "["+filename.toUpperCase()+"]("+fileurl+")\r\n"+ 120 | "===================================\r\n"+ 121 | firstComment+"\r\n"+ 122 | examples 123 | ); 124 | 125 | } catch (ex) { 126 | 127 | grunt.log.writeln('[ERROR] Generating doc for ' + filepath + ' failled with message: ' + ex.message); 128 | return ''; 129 | 130 | } 131 | } 132 | } 133 | } 134 | }, 135 | 136 | uglify: { 137 | options: { 138 | banner: '<%= banner %>', 139 | sourceMap: true 140 | }, 141 | bin: { 142 | src: '<%= concat.bin.dest %>', 143 | dest: 'bin/<%= pkg.name %>.min.js' 144 | }, 145 | }, 146 | 147 | nodeunit: { 148 | files: ['test/**/*_test.js'] 149 | }, 150 | 151 | jshint: { 152 | options: { 153 | jshintrc: '.jshintrc' 154 | }, 155 | gruntfile: { 156 | src: 'Gruntfile.js' 157 | }, 158 | src: { 159 | options: { 160 | jshintrc: '.jshintrc' 161 | }, 162 | src: ['src/**/*.js'] 163 | }, 164 | test: { 165 | src: ['test/**/*.js'] 166 | }, 167 | }, 168 | 169 | watch: { 170 | gruntfile: { 171 | files: '<%= jshint.gruntfile.src %>', 172 | tasks: ['jshint:gruntfile'] 173 | }, 174 | src: { 175 | files: '<%= jshint.src.src %>', 176 | tasks: ['jshint:src', 'nodeunit'] 177 | }, 178 | test: { 179 | files: '<%= jshint.test.src %>', 180 | tasks: ['jshint:test', 'nodeunit'] 181 | }, 182 | }, 183 | 184 | }); 185 | 186 | 187 | // These plugins provide some necessary tasks. 188 | grunt.loadNpmTasks('grunt-contrib-concat-sourcemaps'); //grunt.loadNpmTasks('grunt-contrib-concat'); 189 | grunt.loadNpmTasks('grunt-contrib-uglify'); 190 | grunt.loadNpmTasks('grunt-contrib-nodeunit'); 191 | grunt.loadNpmTasks('grunt-contrib-jshint'); 192 | grunt.loadNpmTasks('grunt-contrib-watch'); 193 | 194 | // Define the special 'findreq' task 195 | grunt.registerTask('findreq', 'Automatically determines the order in which the source files have to be concatened', function() { 196 | 197 | var modules = []; 198 | var importModule = function(rootUri, baseUri, relativeModuleUri) { 199 | 200 | // find out the canonical name of the module 201 | var moduleUri = resolveModuleUri(baseUri, relativeModuleUri); 202 | if(!grunt.file.exists(moduleUri)) { moduleUri += '.js'; } 203 | grunt.log.writeln('importing: '+moduleUri); 204 | 205 | // check that the module hasn't already been loaded before 206 | if(modules.indexOf(moduleUri) >= 0) { return; } 207 | 208 | // load the file content from the disk 209 | var fileContent = grunt.file.read(moduleUri); 210 | 211 | // find all dependencies 212 | var dependencyPattern = /(?:(?:\/\/|\/\*)[-_=a-zA-Z0-9 ]*)?require\((\'.*?\'|\"".*?\"")\)/g; 213 | var match; while(match = dependencyPattern.exec(fileContent)) { 214 | 215 | // check we are not in a comment 216 | if(match[0].indexOf('require') == 0) { 217 | 218 | // get the relative uri 219 | match = match[1]; match = match.substr(1, match.length-2); 220 | grunt.log.writeln('depencendy: '+match); 221 | 222 | // import the module 223 | importModule(rootUri, moduleUri, match); 224 | 225 | } 226 | 227 | } 228 | 229 | // mark the module as ready 230 | modules.push(moduleUri); 231 | 232 | } 233 | 234 | importModule(pkg.main, '.', pkg.main); 235 | 236 | grunt.config.merge({ 237 | concat: { 238 | bin: { 239 | src: modules 240 | } 241 | } 242 | }); 243 | }); 244 | 245 | // Default task. 246 | grunt.registerTask('default', [ /*'jshint', 'nodeunit', */'findreq', 'concat', 'uglify']); 247 | 248 | }; -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 François REMY 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README-PARALLIA.md: -------------------------------------------------------------------------------- 1 | # CSS-Polyfills-Framework (Parallia) 2 | 3 | The goal of this project is to create a central repository and a background framework for css polyfills. 4 | 5 | By using a modular approach, the Grunt setup associated to this project allows you to create customized builds by disabling the features you don't need, as we will explain later. 6 | 7 | ## Getting Started 8 | 9 | ### Including Parallia on your website 10 | If you want all features to be enabled: 11 | 12 | 1. Simply download the [production version][min] or the [development version][max]. 13 | 14 | 2. You can then reference it in your web page from your server, just before either the `````` or the ```
17 | 18 |``` tag: 15 | 16 | ```html 17 | 18 | ``` 19 | 20 | [min]: https://raw.github.com/FremyCompany/css-polyfills/master/bin/css-polyfills.min.js 21 | [max]: https://raw.github.com/FremyCompany/css-polyfills/master/bin/css-polyfills.js 22 | 23 | If you only want some features to be enabled: 24 | 25 | 1. Clone this repository on your device. 26 | 27 | 2. Modify the ```src/requirements.js``` file to fit your needs (see next chapter) 28 | 29 | 3. Run Grunt to generate the new build. 30 | 31 | 4. You can then reference it in your web page from your server, just before either the `````` or the `````` tag: 32 | 33 | ```html 34 | 35 | ``` 36 | 37 | 38 | ### Creating a custom build 39 | If you don't need all the features of this library, which I believe will be the case for most of you, I highly recommend you to modify the ```src/requirements.js``` file to only include the modules you need. 40 | 41 | Then, open your command line and execute the ```grunt``` command on the root directory of this repository (once you have NodeJS and Grunt installed). This will create a custom binary for you. 42 | 43 | Don't forget to enable GZipping on your server to make further savings on javascript transfers. 44 | 45 | 46 | 47 | ## Examples 48 | 49 | Here's a simple example adding a simple 'hidden' property to CSS: 50 | 51 | ```javascript 52 | !(function(window, document) { 53 | 54 | var cssCascade = require('core:css-cascade'), cssStyle = require('core:css-style'); 55 | var onHiddenChanged = function(element, rule) { 56 | 57 | var hiddenValue = cssCascade.getSpecifiedStyle(element, 'hidden').toString().trim(); 58 | if(hiddenValue == 'yes') { 59 | if(element.cssHiddenBackup == undefined) { 60 | element.cssHiddenBackup = cssStyle.enforceStyle(element, 'visibility', 'hidden'); 61 | } 62 | } else { 63 | if(element.cssHiddenBackup != undefined) { 64 | cssStyle.restoreStyle(element, element.cssHiddenBackup); 65 | element.cssHiddenBackup = undefined; 66 | } 67 | } 68 | 69 | }; 70 | cssCascade.startMonitoringProperties(['hidden'], { onupdate: onHiddenChanged }); 71 | 72 | })(window, document); 73 | ``` 74 | 75 | Please also have a look at the non-core directories in the src folder for more interesting examples. 76 | 77 | 78 | 79 | ## Documentation 80 | 81 | ### Use the friendly documentation 82 | Please have a look at the [friendly documentation](./doc/README.md). This documentation was specifically created to answer your questions, or point you directly to a more precise documentation of the API. 83 | 84 | ### Review the API summary 85 | _(Dense format coming soon, without any type annotations)_ 86 | 87 | ### Have a look at the code 88 | Please don't forget that if your questions weren't answered by the previously introduced documents, you may also have a look to the source code. It is usually well-documented from the inside, which may help you grasp implementation details. 89 | 90 | 91 | 92 | ## Contributing 93 | Please feel free to contribute to this project, either by fixing bugs in the core libraries or by adding new polyfills. 94 | 95 | If you work on a new polyfill, make sure it lives under its own directory in the ```src``` folder, and has a ```polyfill.js``` file that can be required in the ```src/requirements.js``` file to initialize your polyfill. We recommend putting all other files in a ```lib``` subdirectory. If you use grunt to build the ```polyfill.js``` file, please include your ```gruntfile``` in the repository, but not the downloaded ```node_modules``` (add the folder to ```.gitignore``` if necessary). 96 | 97 | In lieu of a formal styleguide, we will simply ask you to take care to maintain the existing coding style. For instance, please: 98 | * use tabs for indentation at the beginning of lines. 99 | * put opening braces on the same line as the block definition. 100 | * avoid if or else statements without braces. 101 | 102 | _Also, please don't edit files in the "bin" subdirectory as they are generated via Grunt. You'll find source code in the "src" subdirectory!_ 103 | 104 | 105 | 106 | ## Release History 107 | 108 | The aim of this section is to report the major milestones of the project: 109 | 110 | * 2014-09-21: First release of the framework, with a rough prototype css-grid polyfill. 111 | * 2014-10-11: Pushed a nearly-final v1.0 documentation of core components. 112 | 113 | 114 | 115 | ## License 116 | Copyright (c) 2014 François REMY 117 | Licensed under the MIT license. Some sections may have an Apache license applied to them. 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CSS-Grid-Polyfill 2 | 3 | > IMPORTANT NOTE: The Grid specification has undergone several major changes since this polyfill was written, and I have not had time to work on keeping the polyfill up to date. I welcome contributions and am ready to help, but I do not have time to commit on fixing issues myself at this time. 4 | 5 | Welcome to this first version of the CSS-Grid-Polyfill. The goal of this project is to provide a working implementation of css grids for current browsers, for prototyping purposes. 6 | 7 | 8 | 9 | ## What’s in for you? 10 | You are now ready to try out css grids in IE 9+ and probably most other recent browsers, with the simple addition of a script on your page – and to the condition your style sheets are located on your own server (or accessible via CORS). 11 | 12 | The polyfill’s css parser was built by following the CSS Syntax 3 specification, the polyfill should be able to process any css stylesheet. It can react to dynamic pseudo-classes like ‘:hover’, to media queries changes or window resize events. It also detects changes to the DOM that may affect the layout of your grid. 13 | 14 | Most features of the css grid spec are in. For instance, the polyfill support more features than the IE’s implementation, as well as all the features implemented in Chrome Canary under a flag today, and actually renders more accurately than Chrome in most cases. [Edit: As of May 2015, this is no longer true as bugs I reported were fixed, and Chrome added new features] 15 | 16 | Use any of the possible ways you can define a grid (rows/columns, grid lines, areas, …) and mix them as you wish, with the caveat that you align items to the right edge of the grid using negative indexes, or with fixed row/column-end and a span value as row/column-start. 17 | 18 | Automatic placement is supported with both the ‘normal’ and the ‘dense’ algorithms. Each one comes in both the ‘row’ and ‘column’ flavors (which allow you to choose the direction in which the automatic algorithm progress, from left to right or from top to bottom). 19 | 20 | Fraction sizes (the ‘fr’ unit) are also supported, and are indented to work exactly as the spec says it should. 21 | 22 | 23 | 24 | ## Show me some demos! 25 | I guess you should be somewhat impressed at this point, but wonder if things are really as beautiful as painted before, so let’s move to actual demos! 26 | 27 | * [Bootstrap 16-columns grid](https://rawgit.com/FremyCompany/css-grid-polyfill/master/demo/css-grid/layout4.html) 28 | * [Responsive blog design](https://rawgit.com/FremyCompany/css-grid-polyfill/master/demo/css-grid/layout3.html) 29 | * [Mixing cell-positioned and non-cell-positioned items](https://rawgit.com/FremyCompany/css-grid-polyfill/master/demo/css-grid/example19.html) 30 | * [Z-Index support](https://rawgit.com/FremyCompany/css-grid-polyfill/master/demo/css-grid/example17.html) 31 | * [Basic Hover Test](https://rawgit.com/FremyCompany/css-grid-polyfill/master/demo/css-grid/basic-hover-test.html) 32 | 33 | NOTE: most of those demos are coming from “[Grid By Example](http://gridbyexample.com/)”, a website from Rachel Andrew. 34 | 35 | 36 | 37 | ## What’s not working right now? 38 | As always, there has to be gotchas. 39 | 40 | Because the layout is done asynchronously, the polyfill may play badly with other libraries that expect layout to be performed synchronously. This is particularly true if you plan to animate your grid. 41 | 42 | The whole polyfill is very sensitive to changes to the “box-sizing” property (and many frameworks like Bootstrap do make use of it); again, this will be ironed out soon but you have to be aware. 43 | 44 | The polyfill doesn’t like fixed/absolutely positioned grid items. If you want to use them, just put them in a dummy wrapper, it will work fine. 45 | 46 | Like IE and Chrome, the polyfill does not support the “subgrid” feature, and (similarly) doesn’t like when a grid-item is a grid itself. I hope to solve this someday using a CSS Layout Polyfill Infrastructure but this will require some background work I don’t expect to have time to do in the immediate future. 47 | 48 | Also, I’m you’ll find other bugs I didn’t mention. Please bear with me ^_^ 49 | 50 | 51 | 52 | ## Should I use that in production? 53 | Your call. I wouldn’t say this polyfill is slow by any measure, but your mileage may vary on mobile devices. My advice would be to use the polyfill only on tablets and desktops at the moment, after you have tested the compatibility and performance extensively on a representative number of devices. 54 | 55 | To the contrary of my previous CSS Regions Polyfill, I didn’t carry such a broad compatibility and performance testing myself at the moment because I still expect to change the code significantly in the future, so that would be wasted time. That doesn’t mean you can’t do it on your own, and report any issue you did find ;-) 56 | 57 | 58 | 59 | 60 | ## Can I contribute? 61 | Sure! Please report bugs here, and feel free to make pull requests! 62 | 63 | The code is globally pretty readable, and if it isn’t you can report it as a bug! Maintaining a good code quality is a requirement for this project, and I take this very seriously. 64 | 65 | 66 | 67 | ## Contributing 68 | Please feel free to contribute to this project, either by fixing bugs in the core libraries or by fixing the css-grid polyfill. 69 | 70 | In lieu of a formal styleguide, we will simply ask you to take care to maintain the existing coding style. For instance, please: 71 | * use tabs for indentation at the beginning of lines. 72 | * put opening braces on the same line as the block definition. 73 | * avoid if or else statements without braces. 74 | 75 | _Also, please don't edit files in the "bin" subdirectory as they are generated via Grunt. You'll find source code in the "src" subdirectory!_ 76 | 77 | ### Testing 78 | Rather than have to test your changes manually, you can add an example page to the `demo/` directory and run `npm run update-snapshots`. Then you can run the test server using `npm run test` and open `localhost:4743` in your browser. 79 | 80 | `npm run update-snapshots` - this will 'snapshot' how the newest version of Chromium lays out the elements inside a `.wrapper` element 81 | 82 | `npm run test` runs a server which serves a html file on the root path that will open all the html pages in the `demo/` directory in iframes and compare how they are laid out to the snapshots taken from Chromium. You can open this page in any browser to test how your changes work cross-browser. 83 | 84 | ## Release History 85 | 86 | The aim of this section is to report the major milestones of the project: 87 | 88 | * 2015-06-19: Added 'order' property, fixed bugs, and support the updated syntax 89 | * 2014-11-01: First release of the css-grid-polyfill 90 | 91 | You can follow the release or install them using bower from there: 92 | 93 | https://github.com/FremyCompany/css-grid-polyfill-binaries. 94 | 95 | 96 | ## License 97 | Copyright (c) 2014 François REMY 98 | Licensed under the MIT license. Some sections may have an Apache license applied to them. 99 | -------------------------------------------------------------------------------- /demo/css-grid/basic-hover-test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 | 15 | 16 |
28 |