Upgrade to Grunt 0.4.0 complete. Safari on OSX bug fix.

This commit is contained in:
Dan Farrelly 2013-03-22 14:57:38 -04:00
parent 2d95a761b0
commit 8623e4014b
2 changed files with 46 additions and 20 deletions

View File

@ -1,38 +1,59 @@
/*global module:false*/ /*global module:false*/
module.exports = function(grunt) { module.exports = function(grunt) {
// Project configuration. var meta = {
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/*\n <%= pkg.title || pkg.name %> <%= pkg.version %>' + banner: '/*\n <%= pkg.title || pkg.name %> <%= pkg.version %>' +
'<%= pkg.homepage ? " <" + pkg.homepage + ">\n" : "" %>' + '<%= pkg.homepage ? " <" + pkg.homepage + ">" : "" %>' + '\n' +
' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' + ' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
'\n\n Released under <%= _.pluck(pkg.licenses, "type").join(", ") %> License\n*/', '\n\n Released under <%= _.pluck(pkg.licenses, "type").join(", ") %> License\n*/',
pre: '(function(window, document, undefined){', pre: '\n(function(window, document, undefined){\n\n',
post: '})(window,document);' post: '\n})(window,document);'
}, };
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
qunit: { qunit: {
files: ['tests/qunit/index.html'] files: ['tests/qunit/index.html']
}, },
concat: { concat: {
dist: { dist: {
src: ['<banner:meta.banner>', '<banner:meta.pre>','src/*.js', 'src/renderers/Canvas.js', '<banner:meta.post>'], src: [
'src/Core.js',
'src/Font.js',
'src/Generate.js',
'src/Queue.js',
'src/Parse.js',
'src/Preload.js',
'src/Renderer.js',
'src/Support.js',
'src/Util.js',
'src/renderers/Canvas.js'
],
dest: 'build/<%= pkg.name %>.js' dest: 'build/<%= pkg.name %>.js'
},
options:{
banner: meta.banner + meta.pre,
footer: meta.post
} }
}, },
uglify: { uglify: {
dist: { dist: {
src: ['<banner:meta.banner>', '<config:concat.dist.dest>'], src: ['<%= concat.dist.dest %>'],
dest: 'build/<%= pkg.name %>.min.js' dest: 'build/<%= pkg.name %>.min.js'
},
options: {
banner: meta.banner
} }
}, },
watch: { watch: {
files: '<config:lint.files>', files: '<%= lint.files %>',
tasks: 'lint qunit' tasks: 'jshint qunit'
}, },
jshint: { jshint: {
all: ['build/<%= pkg.name %>.js'], all: ['<%= concat.dist.dest %>'],
options: { options: {
curly: true, curly: true,
eqeqeq: true, eqeqeq: true,
@ -44,12 +65,12 @@ module.exports = function(grunt) {
undef: true, undef: true,
boss: true, boss: true,
eqnull: true, eqnull: true,
browser: true browser: true,
},
globals: { globals: {
jQuery: true jQuery: true
} }
} }
}
}); });
var selenium = require("./tests/selenium.js"); var selenium = require("./tests/selenium.js");
@ -71,6 +92,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-qunit');
// Default task. // Default task.
grunt.registerTask('default', ['concat', 'jshint', 'qunit', 'uglify', 'webdriver']); grunt.registerTask('default', ['jshint', 'concat', 'qunit', 'uglify', 'webdriver']);
}; };

View File

@ -775,7 +775,12 @@ _html2canvas.Parse = function (images, options) {
elps.className = pseudoHide + "-before " + pseudoHide + "-after"; elps.className = pseudoHide + "-before " + pseudoHide + "-after";
Object.keys(elStyle).filter(indexedProperty).forEach(function(prop) { Object.keys(elStyle).filter(indexedProperty).forEach(function(prop) {
// Prevent assigning of read only CSS Rules, ex. length, parentRule
try {
elps.style[prop] = elStyle[prop]; elps.style[prop] = elStyle[prop];
} catch (e) {
h2clog(['Tried to assign readonly property ', prop, 'Error:', e]);
}
}); });
if(isImage) { if(isImage) {