html2canvas-0.5.0-beta4/000077500000000000000000000000001265076030100147335ustar00rootroot00000000000000html2canvas-0.5.0-beta4/.editorconfig000066400000000000000000000005361265076030100174140ustar00rootroot00000000000000# http://editorconfig.org root = true [*] charset = utf-8 end_of_line = lf trim_trailing_whitespace = true insert_final_newline = true indent_style = space indent_size = 4 [{.travis.yml,package.json}] # The indent size used in the `package.json` file cannot be changed # https://github.com/npm/npm/pull/3180#issuecomment-16336516 indent_size = 2 html2canvas-0.5.0-beta4/.gitignore000066400000000000000000000002051265076030100167200ustar00rootroot00000000000000/nbproject/ image.jpg /.project /.settings/ node_modules/ .envrc *.sublime-workspace *.baseline *.iml .idea/ .DS_Store npm-debug.log html2canvas-0.5.0-beta4/.gitmodules000066400000000000000000000001331265076030100171050ustar00rootroot00000000000000[submodule "src/fabric"] path = src/fabric url = https://github.com/kangax/fabric.js.git html2canvas-0.5.0-beta4/.jshintrc000066400000000000000000000005161265076030100165620ustar00rootroot00000000000000{ "curly": true, "eqeqeq": true, "immed": true, "latedef": false, "newcap": true, "noarg": true, "sub": true, "undef": true, "boss": true, "eqnull": true, "browser": true, "node": true, "indent": 4, "globals": { "jQuery": true }, "predef": ["Promise", "define"] } html2canvas-0.5.0-beta4/.npmignore000066400000000000000000000001341265076030100167300ustar00rootroot00000000000000tests/ examples/ Gruntfile.js bower.json src/ *.iml .idea/ .npmignore .jshintrc .travis.yml html2canvas-0.5.0-beta4/.travis.yml000066400000000000000000000022561265076030100170510ustar00rootroot00000000000000language: node_js node_js: - '4.0' env: global: - secure: eW41gIqOizwO4pTgWnAAbW75AP7F+CK9qfSed/fSh4sJ9HWMIY1YRIaY8gjr+6jV/f7XVHcXuym6ZxgINYSkVKbF1JKxBJNLOXtSgNbVHSic58pYFvUjwxIBI9aPig9uux1+DbnpWqXFDTcACJSevQZE0xwmjdrSkDLgB0G34v8= - secure: Y2Av+Gd3z9uQEB36GwdOOuGka0hx0/HeitASEo59z934O8RxnmN9eNTXS7dDT3XtKtwxIyLTOEpS7qlRdWahH28hr/dS4xJj6ao58C+1xMcDs6NAPGmDxUlcJWpcGEsnjmXjQCc3fBioSTdpIBrK/gdvgpNh77UKG74Sk7Z+YGk= - secure: YI+YbTOGf2x4fPMKW+KhJiZWswoXT6xOKGwLfsQsVwmFX1LerJouil5D5iYOQuL4FE3pNaoJSNakIsokJQuGKJMmnPc8rdhMZuBJBk6MRghurE2Xe9qBHfuUBPlfD61nARESm4WDcyMwM0QVYaOKeY6aIpZ91qbUbyc60EEx3C4= addons: sauce_connect: true before_script: - npm install -g grunt-cli - npm install -g uglify-js notifications: webhooks: urls: - https://webhooks.gitter.im/e/2b007d4f86de89588804 on_success: always on_failure: always on_start: false deploy: - provider: npm email: niklasvh@gmail.com api_key: secure: G/Szpr8q4/D6hp+H/Z9yyluUXtHAwf7LLa1Y07X59/Enlj1h7V5fQ7AW4/iAVM3XbIsrCPWR3dJU9g/ZxpxFg4OovIHVpS2Jr/mahtPYWdHR3pWuSmMW8QD+Twnq2VAFwSgg5Oumq3QxhX3YbCOnZox6+6Uviqk8FO7Z5B0RwW4= on: tags: true branch: master repo: niklasvh/html2canvas html2canvas-0.5.0-beta4/CHANGELOG.md000066400000000000000000000100351265076030100165430ustar00rootroot00000000000000### Changelog ### v0.5.0-beta4 - 23.1.2016 * Fix logger requiring access to window object * Derequire browserify build * Fix rendering of specific elements when window is scrolled and `type` isn't set to `view` v0.5.0-beta3 - 6.12.2015 * Handle color names in linear gradients v0.5.0-beta2 - 20.10.2015 * Remove Promise polyfill (use native or provide it yourself) v0.5.0-beta1 - 19.10.2015 * Fix bug with unmatched color stops in gradients * Fix scrolling issues with iOS * Correctly handle named colors in gradients * Accept matrix3d transforms * Fix transparent colors breaking gradients * Preserve scrolling positions on render v0.5.0-alpha2 - 3.2.2015 * Switch to using browserify for building * Fix (#517) Chrome stretches background images with 'auto' or single attributes v0.5.0-alpha - 19.1.2015 * Complete rewrite of library * Switched interface to return Promise * Uses hidden iframe window to perform rendering, allowing async rendering and doesn't force the viewport to be scrolled to the top anymore. * Better support for unicode * Checkbox/radio button rendering * SVG rendering * iframe rendering * Changed format for proxy requests, permitting binary responses with CORS headers as well * Fixed many layering issues (see z-index tests) v0.4.1 - 7.9.2013 * Added support for bower * Improved z-index ordering * Basic implementation for CSS transformations * Fixed inline text in top element * Basic implementation for text-shadow v0.4.0 - 30.1.2013 * Added rendering tests with webdriver * Switched to using grunt for building * Removed support for IE<9, including any FlashCanvas bits * Support for border-radius * Support for multiple background images, size, and clipping * Support for :before and :after pseudo elements * Support for placeholder rendering * Reformatted all tests to small units to test specific features v0.3.4 - 26.6.2012 * Removed (last?) jQuery dependencies (niklasvh) * SVG-powered rendering (niklasvh) * Radial gradients (SunboX) * Split renderers to their own objects (niklasvh) * Simplified API, cleaned up code (niklasvh) v0.3.3 - 2.3.2012 * SVG taint fix, and additional taint testing options for rendering (niklasvh) * Added support for CORS images and option to create canvas as tainted (niklasvh) * Improved minification saved ~1K! (cobexer) * Added integrated support for Flashcanvas (niklasvh) * Fixed a variety of legacy IE bugs (niklasvh) v0.3.2 - 20.2.2012 * Added changelog! * Added bookmarklet (cobexer) * Option to select single element to render (niklasvh) * Fixed closure compiler warnings (cobexer) * Enable profiling in FF (cobexer) html2canvas-0.5.0-beta4/Gruntfile.js000066400000000000000000000163051265076030100172350ustar00rootroot00000000000000/*global module:false*/ var _ = require('lodash'), path = require('path'); var proxy = require('html2canvas-proxy'); module.exports = function(grunt) { var meta = { banner: '/*\n <%= pkg.title || pkg.name %> <%= pkg.version %>' + '<%= pkg.homepage ? " <" + pkg.homepage + ">" : "" %>' + '\n' + ' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' + '\n\n Released under <%= _.pluck(pkg.licenses, "type").join(", ") %> License\n*/\n' }; var browsers = { chrome: { browserName: "chrome", platform: "Windows 7", version: "39" }, firefox: { browserName: "firefox", version: "15", platform: "Windows 7" }, ie9: { browserName: "internet explorer", version: "9", platform: "Windows 7" }, ie10: { browserName: "internet explorer", version: "10", platform: "Windows 8" }, ie11: { browserName: "internet explorer", version: "11", platform: "Windows 8.1" }, chromeOSX:{ browserName: "chrome", platform: "OS X 10.8", version: "39" } }; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), browserify: { dist: { src: ['src/core.js'], dest: 'dist/<%= pkg.name %>.js', options: { browserifyOptions: { standalone: 'html2canvas' }, banner: meta.banner, plugin: [ [ "browserify-derequire" ] ] } }, svg: { src: [ 'src/fabric/dist/fabric.js' ], dest: 'dist/<%= pkg.name %>.svg.js', options:{ browserifyOptions: { standalone: 'html2canvas.svg' }, banner: meta.banner, plugin: [ [ "browserify-derequire" ] ] } } }, connect: { server: { options: { port: 8080, base: './', keepalive: true } }, altServer: { options: { port: 8083, base: './' } }, cors: { options: { port: 8081, base: './', middleware: function(connect, options) { return [ function(req, res, next) { if (req.url !== '/tests/assets/image2.jpg') { next(); return; } res.setHeader("Access-Control-Allow-Origin", "*"); res.end(require("fs").readFileSync('tests/assets/image2.jpg')); } ]; } } }, proxy: { options: { port: 8082, middleware: function(connect, options) { return [ function(req, res, next) { res.jsonp = function(content) { res.end(req.query.callback + "(" + JSON.stringify(content) + ")"); }; next(); }, proxy() ]; } } }, ci: { options: { port: 8080, base: './' } } }, execute: { fabric: { options: { args: ['modules=' + ['text','serialization', 'parser', 'gradient', 'pattern', 'shadow', 'freedrawing', 'image_filters', 'serialization'].join(","), 'no-es5-compat', 'dest=' + path.resolve(__dirname, 'src/fabric/dist/') + '/'] }, src: ['src/fabric/build.js'] } }, uglify: { dist: { src: ['<%= browserify.dist.dest %>'], dest: 'dist/<%= pkg.name %>.min.js' }, svg: { src: ['<%= browserify.svg.dest %>'], dest: 'dist/<%= pkg.name %>.svg.min.js' }, options: { banner: meta.banner } }, watch: { files: ['src/**/*', '!src/fabric/**/*'], tasks: ['jshint', 'build'] }, jshint: { all: ['src/*.js', 'src/renderers/*.js'], options: grunt.file.readJSON('./.jshintrc') }, mochacli: { options: { reporter: 'spec' }, all: ['tests/node/*.js'] }, mocha_phantomjs: { all: ['tests/mocha/**/*.html'] }, mocha_webdriver: browsers, webdriver: browsers }); grunt.registerTask('webdriver', 'Browser render tests', function(browser, test) { var selenium = require("./tests/selenium.js"); var done = this.async(); var browsers = (browser) ? [grunt.config.get(this.name + "." + browser)] : _.values(grunt.config.get(this.name)); selenium.tests(browsers, test).catch(function() { done(false); }).finally(function() { console.log("Done"); done(); }); }); grunt.registerTask('mocha_webdriver', 'Browser mocha tests', function(browser, test) { var selenium = require("./tests/mocha/selenium.js"); var done = this.async(); var browsers = (browser) ? [grunt.config.get(this.name + "." + browser)] : _.values(grunt.config.get(this.name)); selenium.tests(browsers, test).catch(function() { done(false); }).finally(function() { done(); }); }); grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-mocha-phantomjs'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-execute'); grunt.loadNpmTasks('grunt-mocha-cli'); grunt.registerTask('server', ['connect:cors', 'connect:proxy', 'connect:altServer', 'connect:server']); grunt.registerTask('build', ['execute', 'browserify', 'uglify']); grunt.registerTask('default', ['jshint', 'build', 'mochacli', 'connect:altServer', 'mocha_phantomjs']); grunt.registerTask('travis', ['jshint', 'build', 'connect:altServer', 'connect:ci', 'connect:proxy', 'connect:cors', 'mocha_phantomjs', 'webdriver']); }; html2canvas-0.5.0-beta4/LICENSE000066400000000000000000000020451265076030100157410ustar00rootroot00000000000000Copyright (c) 2012 Niklas von Hertzen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.html2canvas-0.5.0-beta4/bower.json000066400000000000000000000002611265076030100167430ustar00rootroot00000000000000{ "name": "html2canvas", "description": "Screenshots with JavaScript", "main": "dist/html2canvas.js", "ignore": [ "tests", ".travis.yml" ] } html2canvas-0.5.0-beta4/examples/000077500000000000000000000000001265076030100165515ustar00rootroot00000000000000html2canvas-0.5.0-beta4/examples/demo.html000066400000000000000000000101321265076030100203600ustar00rootroot00000000000000 display/box/float/clear test
toggle
bar maids,

sing to me, erbarme dich

This is a nonsensical document, but syntactically valid HTML 4.0. All 100% conformant CSS1 agents should be able to render the document elements above this paragraph indistinguishably (to the pixel) from this reference rendering, (except font rasterization and form widgets). All discrepancies should be traceable to CSS1 implementation shortcomings. Once you have finished evaluating this test, you can return to the parent page.

html2canvas-0.5.0-beta4/examples/demo2.html000066400000000000000000000031071265076030100204460ustar00rootroot00000000000000

Heading

Text that isn't wrapped in anything.

Followed by some text wrapped in a <p> paragraph.

Maybe add a link or a different style of link with a highlight.

More content

a
html2canvas-0.5.0-beta4/examples/existing_canvas.html000066400000000000000000000027741265076030100226360ustar00rootroot00000000000000 Using an existing canvas to draw on

HTML content to render:

Render the content in this element only onto the existing canvas element

Existing canvas:

html2canvas-0.5.0-beta4/package.json000066400000000000000000000025351265076030100172260ustar00rootroot00000000000000{ "title": "html2canvas", "name": "html2canvas", "description": "Screenshots with JavaScript", "main": "dist/html2canvas.js", "version": "0.5.0-beta4", "author": { "name": "Niklas von Hertzen", "email": "niklasvh@gmail.com", "url": "http://hertzen.com" }, "engines": { "node": ">=4.0.0" }, "repository": { "type": "git", "url": "git@github.com:niklasvh/html2canvas.git" }, "bugs": { "url": "https://github.com/niklasvh/html2canvas/issues" }, "devDependencies": { "base64-arraybuffer": "^0.1.5", "bluebird": "^3.0.6", "browserify-derequire": "^0.9.4", "grunt": "^0.4.5", "grunt-browserify": "^4.0.1", "grunt-cli": "^0.1.13", "grunt-contrib-connect": "^0.11.2", "grunt-contrib-jshint": "^0.11.3", "grunt-contrib-uglify": "^0.11.0", "grunt-contrib-watch": "^0.6.1", "grunt-execute": "^0.2.2", "grunt-mocha-cli": "^1.12.0", "grunt-mocha-phantomjs": "^2.0.0", "html2canvas-proxy": "0.0.5", "humanize-duration": "^2.0.1", "lodash": "^3.10.1", "pngjs": "^2.2.0", "requirejs": "^2.1.20", "sauce-connect-launcher": "^0.13.0", "wd": "^0.4.0" }, "scripts": { "test": "grunt travis --verbose", "start": "grunt server", "sauceconnect": "tests/sauceconnect.js" }, "homepage": "http://html2canvas.hertzen.com", "license": "MIT" } html2canvas-0.5.0-beta4/readme.md000066400000000000000000000117271265076030100165220ustar00rootroot00000000000000html2canvas =========== [Homepage](http://html2canvas.hertzen.com) | [Downloads](https://github.com/niklasvh/html2canvas/releases) | [Questions](http://stackoverflow.com/questions/tagged/html2canvas?sort=newest) | [Donate](https://www.gittip.com/niklasvh/) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/niklasvh/html2canvas?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Build Status](https://travis-ci.org/niklasvh/html2canvas.png)](https://travis-ci.org/niklasvh/html2canvas) #### JavaScript HTML renderer #### The script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page. ###How does it work?### The script renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements. It does **not require any rendering from the server**, as the whole image is created on the **clients browser**. However, as it is heavily dependent on the browser, this library is *not suitable* to be used in nodejs. It doesn't magically circumvent any browser content policy restrictions either, so rendering cross-origin content will require a [proxy](https://github.com/niklasvh/html2canvas/wiki/Proxies) to get the content to the [same origin](http://en.wikipedia.org/wiki/Same_origin_policy). The script is still in a **very experimental state**, so I don't recommend using it in a production environment nor start building applications with it yet, as there will be still major changes made. ###Browser compatibility### The library should work fine on the following browsers (with `Promise` polyfill): * Firefox 3.5+ * Google Chrome * Opera 12+ * IE9+ * Safari 6+ As each CSS property needs to be manually built to be supported, there are a number of properties that are not yet supported. ### Usage ### The html2canvas library utilizes `Promise`s and expects them to be available in the global context. If you wish to support [older browsers](http://caniuse.com/#search=promise) that do not natively support `Promise`s, please include a polyfill such as [es6-promise](https://github.com/jakearchibald/es6-promise) before including `html2canvas`. **Note!** These instructions are for using the current dev version of 0.5, for the latest release version (0.4.1), checkout the [old readme](https://github.com/niklasvh/html2canvas/blob/v0.4/readme.md). To render an `element` with html2canvas, simply call: ` html2canvas(element[, options]);` The function returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) containing the `` element. Simply add a promise fullfillment handler to the promise using `then`: html2canvas(document.body).then(function(canvas) { document.body.appendChild(canvas); }); ### Building ### The library uses [grunt](http://gruntjs.com/) for building. Alternatively, you can download the latest build from [here](https://github.com/niklasvh/html2canvas/blob/master/dist/html2canvas.js). Clone git repository with submodules: $ git clone --recursive git://github.com/niklasvh/html2canvas.git Install Grunt and uglifyjs: $ npm install -g grunt-cli uglify-js Run the full build process (including lint, qunit and webdriver tests): $ grunt Skip lint and tests and simply build from source: $ grunt build ### Running tests ### The library has two sets of tests. The first set is a number of qunit tests that check that different values parsed by browsers are correctly converted in html2canvas. To run these tests with grunt you'll need [phantomjs](http://phantomjs.org/). The other set of tests run Firefox, Chrome and Internet Explorer with [webdriver](https://github.com/niklasvh/webdriver.js). The selenium standalone server (runs on Java) is required for these tests and can be downloaded from [here](http://code.google.com/p/selenium/downloads/list). They capture an actual screenshot from the test pages and compare the image to the screenshot created by html2canvas and calculate the percentage differences. These tests generally aren't expected to provide 100% matches, but while commiting changes, these should generally not go decrease from the baseline values. Start by downloading the dependencies: $ npm install Run qunit tests: $ grunt test ### Examples ### For more information and examples, please visit the [homepage](http://html2canvas.hertzen.com) or try the [test console](http://html2canvas.hertzen.com/screenshots.html). ### Contributing ### If you wish to contribute to the project, please send the pull requests to the develop branch. Before submitting any changes, try and test that the changes work with all the support browsers. If some CSS property isn't supported or is incomplete, please create appropriate tests for it as well before submitting any code changes. html2canvas-0.5.0-beta4/src/000077500000000000000000000000001265076030100155225ustar00rootroot00000000000000html2canvas-0.5.0-beta4/src/clone.js000066400000000000000000000100571265076030100171630ustar00rootroot00000000000000var log = require('./log'); function restoreOwnerScroll(ownerDocument, x, y) { if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) { ownerDocument.defaultView.scrollTo(x, y); } } function cloneCanvasContents(canvas, clonedCanvas) { try { if (clonedCanvas) { clonedCanvas.width = canvas.width; clonedCanvas.height = canvas.height; clonedCanvas.getContext("2d").putImageData(canvas.getContext("2d").getImageData(0, 0, canvas.width, canvas.height), 0, 0); } } catch(e) { log("Unable to copy canvas content from", canvas, e); } } function cloneNode(node, javascriptEnabled) { var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false); var child = node.firstChild; while(child) { if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') { clone.appendChild(cloneNode(child, javascriptEnabled)); } child = child.nextSibling; } if (node.nodeType === 1) { clone._scrollTop = node.scrollTop; clone._scrollLeft = node.scrollLeft; if (node.nodeName === "CANVAS") { cloneCanvasContents(node, clone); } else if (node.nodeName === "TEXTAREA" || node.nodeName === "SELECT") { clone.value = node.value; } } return clone; } function initNode(node) { if (node.nodeType === 1) { node.scrollTop = node._scrollTop; node.scrollLeft = node._scrollLeft; var child = node.firstChild; while(child) { initNode(child); child = child.nextSibling; } } } module.exports = function(ownerDocument, containerDocument, width, height, options, x ,y) { var documentElement = cloneNode(ownerDocument.documentElement, options.javascriptEnabled); var container = containerDocument.createElement("iframe"); container.className = "html2canvas-container"; container.style.visibility = "hidden"; container.style.position = "fixed"; container.style.left = "-10000px"; container.style.top = "0px"; container.style.border = "0"; container.width = width; container.height = height; container.scrolling = "no"; // ios won't scroll without it containerDocument.body.appendChild(container); return new Promise(function(resolve) { var documentClone = container.contentWindow.document; /* Chrome doesn't detect relative background-images assigned in inline this is the content of frame1 html2canvas-0.5.0-beta4/tests/assets/image.jpg000066400000000000000000000056101265076030100211650ustar00rootroot00000000000000ÿØÿàJFIFHHÿÛC     ÿÛC   ÿÀKKÿÄ ÿÄ7!1"AQaq2‘±Á#BRrÑáðb¢ñÿÄÿÄ3!1A"Qaq‘¡±Ñ#BRÁáð2¢ñÿÚ ?Å"­·Ê–þ«cóѦš=ž¢j¬²¦TÉM[¤n¹°q|tš’’æŸÈjæœS]4V‚ŸWAíâYCѿŋ!jViÕŠ?(Æ‘#æÐ“!·JÈþÇ÷ÇKt%2m-9IkAR?}~Gý Æòs4CÛ hG8'*"8 ´Bç dtËh`¤R«¯m lR;-ïfÝSWr÷f”ô ”ÔÒŸ½EÞ»cÜñÆRµØ“Î<ÁuuªÛQ[x ÍÙž[V ĦžkÿR‚qU§ìN>÷¹qW/&8á–8åEíûuÆ©s2íí°ØÒºS+Î( ‘U$PáÊõÆ,êŒJÛ'$ËWfT¯CF¤4–ä‹ôÿ–uE¡µkB÷Tö{Y–DõǾ4²­ïõúbêqÝáb–ÅaˆãÀùÇ 2ÝŽ%Òþì\±…¿™ûâ‚X{¹›¨·Ë„›#¼´“FÙm‘Щ;SÛú°ÜTT“SùýI·¸_Ãê4rŸ§tÌàùžŠϺ’§òÄn ^ãâÈRx©É÷š=Djó=²9iúžžÃØbéI·âgÜV0=´®L– EïcÝ4Œ†Ã…óŽ~ÿ»”MÅ"¶Øq1ù‘æ°×S-\ôë|Y©d¯qÃ$fpOO&à¤XÜ"m%¸¸'“'ꊓ繅{™™T?]·ºŸÀŒU5†YtLà‚.0@Avó˜P“$Òåq55é¶Ôí=ðyn»¯Æß‹uÅíí<=Ýqìö–äȲmÆÂ8Eøå¿Æwx±îé£ZgÒY+Fg£jˆ D†FfII(êHaƱKÖ³ÏÞBìª%y Ý=§áš±dS±Ô‡q1³(½Û¯Kzâö1íYK3ª{¨í“4Ë^-WU¥š÷ðJIª%—jí ½-Ôž9àúZT‘olÐÍÙþ«Ë©i©tF«¤jŒµãj˜3j#7‹Œ(=Òº°*X^Í͸ë‰\äGrMn4rø«ä¤_¦•ÖÖ"çÿ¸$ÚÜu4¹CöÕy®qÚÆxrÍC˜åù};ŠHâ¦ØˆLck5ö’IkòMþà1Kv¢Q±Æ<‘{E0ôiÎ9lWÉ[¨T³>­Îäö -¿Ã^³7°ú¢µùA“VgFF?òŒõ~ÒŸç‚ö<|ò^´fUS”–EC,œ´Š¥n=8rª½ßvFÔjòÏ%ÜZrº”®³í!ÚÉê%Åd„Þù^M%udh¢ç~Ãe¸Ž~¸‘e¹$†«~ÎI¨éé ÇK:Õ“I%=l{‘€Ùø ßô%¥ËR‹ÃŽ£œd²†ßg½Ši­¦Þ®\¾Zšx©áܱGe'w&å‰IàXaèT£Úžìfv·Ù#3çÚ+8ÔÙƒfYžxµ™…HI版ée ¡ž‚ëeÇe‰·àËh}£Mqà…m/4¨ì’µ‘Bfô{È7Nà-¾ó|#î¹ôš÷1zWÖÞŠÎ}¢gÉ£¨Y¦Þ:†ƒy´k#(¶;›†SÀ°­ñY~šTå·×ûŽ¿±kV¢6ã ¦½ \šj}í·»Û~<ã²ÉYE1ª¬AµÔz{ãIƒ/ÈfiJ‰3>“¼F+–°¿ÚõR[¾ó¼‚Y¢Ô±ÆDsz€Æ¸™=‡n“¡O’8e­¸!Ÿ›zN‚"ÊF†ÒZŽŸ$¡„×Vbc½Læ?ÂvŽI&ÖãõÄÔÒ[‘wo`†§Õ11™T)&£(‘·S»ËÏㆥ<€BÆB…›·Òä[ äÒJJLÉqXžl¼‚‰«²¡ñsÃE=Z–¢`»ãad‘¹ XpnyóqéŠ}UPVqÉ%ž½¾<ÍŽéÊ¥ÛÆØéÞ¿ç!OS¦_$Æã°T8Y¿B>:c:öäÍñO¤€:’—»XzcMƒ+œŽ=)UG˜eôqÓ¬ž #•#s{ÔÚýz\úáÔV~õ:;=¦­« 4U!ZMÆÑ†6óü<ÜŸK㢜dsk´ìNk$‚iU^9N Òþø±¨g2ÙÛòÖ­œ\¦8¦:‡”¬Îc6m*n ôôÁµgŒ¸^å8gÙ„ù2eóÇ P…”1spo`l8¾I…É>@Y"'¼Qr‘Ç^ŸçNO°4OLìKMŒ9õ??ï¦ {Ž–û•½ußœ›¾ˆXÀáe´q¸ ÚÛƒ‚ àsÉëˆzÈæ¾%ÓÁ=Ÿ™c¡’V8>¾|×±—/†G rúW%AÜ©2ƒÀæÊJ¸‘íŠ VÓÇÿeòÊ÷HØšÿ'ð"Ôöa4èV0¬OVëLjÆE[‚6U¢5~ž¨WÉâŽxã}Ëî|IàM½Îjšé£ÔjgÙUn¹ÐùÖGQ‘ÁC=jˆ¼M]Lnê,·u ~I 9úâGÀ˱{  ÕªåµÝÅewîf@ìEÁ‡Ú¿^zZØ„¢Y,ÌÿQM©e§š}¨±®ÈÐØ[““‡ZɰÑoRöýýpœ’+D|IÇq¼ÈŒ #˽€t¸·¹¿ìC®§jØ*i$Z¨Ú%$âæö Ô|&Pã‹xåràš—pˆ©je¨XcmÄ”’vFÖêUloð1™âÆÙKÚ¿‘¬áO}þ?ÈÆË˜•‰‰óXüãXc™aÝõ%ÏÉ-ŽAÀM¥jXehŽÓÞ„é.ë[ðÇ!=™DŒ³æ,Ý@Qð8ãuùèÝš(É$ÿ¿€Ç ³ªg,ŠI¹5¥í‚wV µAÍjxþ_Ïs;¡GoH7=XVç¨ýßžPuuD´¹¦Z"s3l}7 "[4ɉMsS%µÏ©éÜÃUóªFœC`1•Ô_d.œböMüͶš¨NˆJKv‘ÿÙhtml2canvas-0.5.0-beta4/tests/assets/image.svg000066400000000000000000000220061265076030100212020ustar00rootroot00000000000000 SVG html2canvas-0.5.0-beta4/tests/assets/image2.jpg000066400000000000000000000070301265076030100212450ustar00rootroot00000000000000ÿØÿàJFIFHHÿÛC     ÿÛC   ÿÀKKÿÄÿÄ9!1A"Qaq2‘ÁBb±Ñð¡#3R’²ÂñÿÄÿÄ6!1AQ"aq‘¡±ð#2BbÑá$RrÁñÿÚ ?“í»„wJ(*áB‘L½h§¸ê @Üg‹DÉ Õ6QH¼q¡'£´ˆ sùk—JîZp=4…(+äcÓLO Šx-6SʤŽt„®Aj£ïÇä¨-\yÉÆtàš–êîÓÔýC j¡U T|0}í Ô¹/)ç@ºF÷£Zé ¦SXÈÝ%âpPñžý±÷Õ}n")’duÓùRh\$˜T­‹p§ÜR hÕ’¨.LG˜8Ñ-ïéÜ îˆUmLI9#ûŶ ûôsÆŒp²$E•ÐçRkWsp0™J‘©øJWªÞ¶Ô8Hë$'ÐDþÚ€oÙ°*`´P€Ôx‡I$¦8(ª¥–TßC?ˆœsómi©[ScC]=Vz­jŽv! "´Ößü ZÈ«jéŠjGpb§¿ØãçæÓ‡ºLâ>f°Fo>ìwz/ßo6Û‚ÅÎþµtýA,ˆâÈÊtpqœ œµ¥Wa©=ÄŽžÈ´ª´vØï”Ÿq´Ð^©¾ÝOÓBeë§bN;u)>œg.›E•]Ê•¢³£ss†“Z\ó°×øóÉ.J¶ºØáHéýê@È%g=2°ÇR‚x-Èãûj++RÙº-“¾✎qsAÿ2<â=üÖ–ð‡ÙvÅs ·î]Á]O~Š¡‘ÑÛ˜U#<£™xÊŽç:ÜØðê 6»Ètæ#O]×”ß\×£UöÎac›‘AôùçeY¿mhi#­ÐGOd—d+”ǧ×WäFŠ™§ª‰øÓÍ¿WMÑÿ†|™%ø²ØÊöì2¢Ü4U¤æÔŠ.,¨² –§•Ë=$=g¾c'Ÿ¿N¼ôöL8Z°gDÙ÷n[«®r\«fšª®†AäQ( b¹3[ (’OVµ !±®ètYˆL­%¶6¢Öcš×g¥£žyN…!½ËŸRyÆ Ò¼¬× '$z–ìp!Ûî™wÇ„”·±U£¯iîÅ‘¸‘ÞÄÝDž!öÕÍÝ€|Ü5ý“ŸYúèªh\Å9„lx ¼7eæ;­âüµ´4*&ZbÓ<˜øWfêuÉa„yÑ(š÷Í"˜Â#Rýµ«ÛÎ3žÚÆýÞ^èÙ[ª‚¢Z½Áo¯F£ ½1Ä£Ó!<~ƒ¾{k7wÃ/éöê7ƒ?/Ù{¿ãüÑdöÒÄg $ùäOšHÜõqUÚ'¥©•f£–& æÀ!׃ÇíßUT±7Y[W†Ak²WO³÷/nÔÐUšš»è\i9@致ª0˜§¸#]kvm+~C¨1Þ=לqþÎ1h¥f~ûé>Ç1¼í çâ-º%ÖŠ®:Ëuz¤”õPœ## ‚3Î{ðyyÚóZ ‚¾{u½J5F«p¹¦;õÿVhÜÛÄ\ëê< Â0ùlNxïƒþ|µEq}N“ËJ±¥jç¶TΣl#Ï#¤„+1`08ÉÏÏY q2¯BOem±WWh¼^Zµ<õ+;ˆ¾&(§ÌÃcðò‹Œã úêg8œ64¶ã dî´•¢Ù= 3I4~T`(Çrqþÿ–« y#¼‡‘*zù ¨ÏNT7IXÆ8²^ÍgÄm¸•?´[¾Aõž„lUgïÊ»†Å‚ÀÕX©kZxÀ9èG\•ú|y8þc«[*®4M# 9yÿ?5å¿ÚS§{N庽¹ø´À>„$åâÛn¦Ý$© Øó™r:Ï$gžu[vÂê¥ÍY‹xå‰F¯R´¨^†—§ Œݵ]ŸU'²š½œá»mÝ™†ém{|”¤Ç­g¹‘]c T¯pÈsßG¯T:¡s ƒÿ‹˜ÞÌiXZ²º:™ƒçà##‘õùg@ÍÙ¤$¼Òí«œŠA§ø˜7â•9ûÿ¾»’éÉ;˜Õò®ºëáýšy=ߨJÙ- ù cÈ^Àœ úh¬. F›õ™T×”¹ÕÚ°_;îõ¿wŒµ"¢ºÞ´÷)3<ª!êŠô²ô.[°“[[Õ$¸óßÁE¯BC3ˆËoyðOÚFáq¤–)ÅB@ $òGPR™ËâSÏ×0V4ÞZJ%J!Ìk‡Eù{Qî;VêÚ¶‘š¦÷qŽ’’0æIÄþ!‚nå—#B»p¨ÆÁí¬øV«¨W«Œ}Ùl¸hzuò•-¸Ü!ðÉÖÅšëÇ““ýJ%t²{_Âä…Ï®¢–Š2ÑP8…ëø­Á¬ÞæÏÌê}ܱÔÞZ¤ˆ¤ªyHv(™!ÏÛçV¹ÐìD¡´!?íúËŲÍKJáÃD¸ÇFp3Çrm@yÄ‚‰ óoš HÍN¨@éN—’9ýΡ’rFišsŽ»Ê†Œ’nrs0?,êSd4$”j†çPn N[1’r[’8ì û 9Ó ‹[º£­™eg8 `sŸþhÔÉ/¤šà6F«-øÅOjÝ;šjÊÁ r¹i`GG+³dr:±Èï«;Š…ÕKš`¨T@k\$$¨ ¦¢wš¦Y9j•Ã+1Üj3 œ'Tg¸‘J c¬Þk[R‹%Mi°æ’I z«ß¾3óÕ“\A:¥/p¶4š`9ÙŽ R§UjûËtM™U×¼¨bj©èÌOu­P%™’ÀÎ~ƒ°ïÛ@s\ÆÇD¬h{æýC j¡U T|0}í Ô¹/)ç@ºF÷£Zé ¦SXÈÝ%âpPñžý±÷Õ}n")’duÓùRh\$˜T­‹p§ÜR hÕ’¨.LG˜8Ñ-ïéÜ îˆUmLI9#ûŶ ûôsÆŒp²$E•ÐçRkWsp0™J‘©øJWªÞ¶Ô8Hë$'ÐDþÚ€oÙ°*`´P€Ôx‡I$¦8(ª¥–TßC?ˆœsómi©[ScC]=Vz­jŽv! "´Ößü ZÈ«jéŠjGpb§¿ØãçæÓ‡ºLâ>f°Fo>ìwz/ßo6Û‚ÅÎþµtýA,ˆâÈÊtpqœ œµ¥Wa©=ÄŽžÈ´ª´vØï”Ÿq´Ð^©¾ÝOÓBeë§bN;u)>œg.›E•]Ê•¢³£ss†“Z\ó°×øóÉ.J¶ºØáHéýê@È%g=2°ÇR‚x-Èãûj++RÙº-“¾✎qsAÿ2<â=üÖ–ð‡ÙvÅs ·î]Á]O~Š¡‘ÑÛ˜U#<£™xÊŽç:ÜØðê 6»Ètæ#O]×”ß\×£UöÎac›‘AôùçeY¿mhi#­ÐGOd—d+”ǧ×WäFŠ™§ª‰øÓÍ¿WMÑÿ†|™%ø²ØÊöì2¢Ü4U¤æÔŠ.,¨² –§•Ë=$=g¾c'Ÿ¿N¼ôöL8Z°gDÙ÷n[«®r\«fšª®†AäQ( b¹3[ (’OVµ !±®ètYˆL­%¶6¢Öcš×g¥£žyN…!½ËŸRyÆ Ò¼¬× '$z–ìp!Ûî™wÇ„”·±U£¯iîÅ‘¸‘ÞÄÝDž!öÕÍÝ€|Ü5ý“ŸYúèªh\Å9„lx ¼7eæ;­âüµ´4*&ZbÓ<˜øWfêuÉa„yÑ(š÷Í"˜Â#Rýµ«ÛÎ3žÚÆýÞ^èÙ[ª‚¢Z½Áo¯F£ ½1Ä£Ó!<~ƒ¾{k7wÃ/éöê7ƒ?/Ù{¿ãüÑdöÒÄg $ùäOšHÜõqUÚ'¥©•f£–& æÀ!׃ÇíßUT±7Y[W†Ak²WO³÷/nÔÐUšš»è\i9@致ª0˜§¸#]kvm+~C¨1Þ=לqþÎ1h¥f~ûé>Ç1¼í çâ-º%ÖŠ®:Ëuz¤”õPœ## ‚3Î{ðyyÚóZ ‚¾{u½J5F«p¹¦;õÿVhÜÛÄ\ëê< Â0ùlNxïƒþ|µEq}N“ËJ±¥jç¶TΣl#Ï#¤„+1`08ÉÏÏY q2¯BOem±WWh¼^Zµ<õ+;ˆ¾&(§ÌÃcðò‹Œã úêg8œ64¶ã dî´•¢Ù= 3I4~T`(Çrqþÿ–« y#¼‡‘*zù ¨ÏNT7IXÆ8²^ÍgÄm¸•?´[¾Aõž„lUgïÊ»†Å‚ÀÕX©kZxÀ9èG\•ú|y8þc«[*®4M# 9yÿ?5å¿ÚS§{N庽¹ø´À>„$åâÛn¦Ý$© Øó™r:Ï$gžu[vÂê¥ÍY‹xå‰F¯R´¨^†—§ Œݵ]ŸU'²š½œá»mÝ™†ém{|”¤Ç­g¹‘]c T¯pÈsßG¯T:¡s ƒÿ‹˜ÞÌiXZ²º:™ƒçà##‘õùg@ÍÙ¤$¼Òí«œŠA§ø˜7â•9ûÿ¾»’éÉ;˜Õò®ºëáýšy=ߨJÙ- ù cÈ^Àœ úh¬. F›õ™T×”¹ÕÚ°_;îõ¿wŒµ"¢ºÞ´÷)3<ª!êŠô²ô.[°“[[Õ$¸óßÁE¯BC3ˆËoyðOÚFáq¤–)ÅB@ $òGPR™ËâSÏ×0V4ÞZJ%J!Ìk‡Eù{Qî;VêÚ¶‘š¦÷qŽ’’0æIÄþ!‚nå—#B»p¨ÆÁí¬øV«¨W«Œ}Ùl¸hzuò•-¸Ü!ðÉÖÅšëÇ““ýJ%t²{_Âä…Ï®¢–Š2ÑP8…ëø­Á¬ÞæÏÌê}ܱÔÞZ¤ˆ¤ªyHv(™!ÏÛçV¹ÐìD¡´!?íúËŲÍKJáÃD¸ÇFp3Çrm@yÄ‚‰ óoš HÍN¨@éN—’9ýΡ’rFišsŽ»Ê†Œ’nrs0?,êSd4$”j†çPn N[1’r[’8ì û 9Ó ‹[º£­™eg8 `sŸþhÔÉ/¤šà6F«-øÅOjÝ;šjÊÁ r¹i`GG+³dr:±Èï«;Š…ÕKš`¨T@k\$$¨ ¦¢wš¦Y9j•Ã+1Üj3 œ'Tg¸‘J c¬Þk[R‹%Mi°æ’I z«ß¾3óÕ“\A:¥/p¶4š`9ÙŽ R§UjûËtM™U×¼¨bj©èÌOu­P%™’ÀÎ~ƒ°ïÛ@s\ÆÇD¬h{æ÷¹qW/&8á–8åEíûuÆ©s2íí°ØÒºS+Î( ‘U$PáÊõÆ,êŒJÛ'$ËWfT¯CF¤4–ä‹ôÿ–uE¡µkB÷Tö{Y–DõǾ4²­ïõúbêqÝáb–ÅaˆãÀùÇ 2ÝŽ%Òþì\±…¿™ûâ‚X{¹›¨·Ë„›#¼´“FÙm‘Щ;SÛú°ÜTT“SùýI·¸_Ãê4rŸ§tÌàùžŠϺ’§òÄn ^ãâÈRx©É÷š=Djó=²9iúžžÃØbéI·âgÜV0=´®L– EïcÝ4Œ†Ã…óŽ~ÿ»”MÅ"¶Øq1ù‘æ°×S-\ôë|Y©d¯qÃ$fpOO&à¤XÜ"m%¸¸'“'ꊓ繅{™™T?]·ºŸÀŒU5†YtLà‚.0@Avó˜P“$Òåq55é¶Ôí=ðyn»¯Æß‹uÅíí<=Ýqìö–äȲmÆÂ8Eøå¿Æwx±îé£ZgÒY+Fg£jˆ D†FfII(êHaƱKÖ³ÏÞBìª%y Ý=§áš±dS±Ô‡q1³(½Û¯Kzâö1íYK3ª{¨í“4Ë^-WU¥š÷ðJIª%—jí ½-Ôž9àúZT‘olÐÍÙþ«Ë©i©tF«¤jŒµãj˜3j#7‹Œ(=Òº°*X^Í͸ë‰\äGrMn4rø«ä¤_¦•ÖÖ"çÿ¸$ÚÜu4¹CöÕy®qÚÆxrÍC˜åù};ŠHâ¦ØˆLck5ö’IkòMþà1Kv¢Q±Æ<‘{E0ôiÎ9lWÉ[¨T³>­Îäö -¿Ã^³7°ú¢µùA“VgFF?òŒõ~ÒŸç‚ö<|ò^´fUS”–EC,œ´Š¥n=8rª½ßvFÔjòÏ%ÜZrº”®³í!ÚÉê%Åd„Þù^M%udh¢ç~Ãe¸Ž~¸‘e¹$†«~ÎI¨éé ÇK:Õ“I%=l{‘€Ùø ßô%¥ËR‹ÃŽ£œd²†ßg½Ši­¦Þ®\¾Zšx©áܱGe'w&å‰IàXaèT£Úžìfv·Ù#3çÚ+8ÔÙƒfYžxµ™…HI版ée ¡ž‚ëeÇe‰·àËh}£Mqà…m/4¨ì’µ‘Bfô{È7Nà-¾ó|#î¹ôš÷1zWÖÞŠÎ}¢gÉ£¨Y¦Þ:†ƒy´k#(¶;›†SÀ°­ñY~šTå·×ûŽ¿±kV¢6ã ¦½ \šj}í·»Û~<ã²ÉYE1ª¬AµÔz{ãIƒ/ÈfiJ‰3>“¼F+–°¿ÚõR[¾ó¼‚Y¢Ô±ÆDsz€Æ¸™=‡n“¡O’8e­¸!Ÿ›zN‚"ÊF†ÒZŽŸ$¡„×Vbc½Læ?ÂvŽI&ÖãõÄÔÒ[‘wo`†§Õ11™T)&£(‘·S»ËÏㆥ<€BÆB…›·Òä[ äÒJJLÉqXžl¼‚‰«²¡ñsÃE=Z–¢`»ãad‘¹ XpnyóqéŠ}UPVqÉ%ž½¾<ÍŽéÊ¥ÛÆØéÞ¿ç!OS¦_$Æã°T8Y¿B>:c:öäÍñO¤€:’—»XzcMƒ+œŽ=)UG˜eôqÓ¬ž #•#s{ÔÚýz\úáÔV~õ:;=¦­« 4U!ZMÆÑ†6óü<ÜŸK㢜dsk´ìNk$‚iU^9N Òþø±¨g2ÙÛòÖ­œ\¦8¦:‡”¬Îc6m*n ôôÁµgŒ¸^å8gÙ„ù2eóÇ P…”1spo`l8¾I…É>@Y"'¼Qr‘Ç^ŸçNO°4OLìKMŒ9õ??ï¦ {Ž–û•½ußœ›¾ˆXÀáe´q¸ ÚÛƒ‚ àsÉëˆzÈæ¾%ÓÁ=Ÿ™c¡’V8>¾|×±—/†G rúW%AÜ©2ƒÀæÊJ¸‘íŠ VÓÇÿeòÊ÷HØšÿ'ð"Ôöa4èV0¬OVëLjÆE[‚6U¢5~ž¨WÉâŽxã}Ëî|IàM½Îjšé£ÔjgÙUn¹ÐùÖGQ‘ÁC=jˆ¼M]Lnê,·u ~I 9úâGÀ˱{  ÕªåµÝÅewîf@ìEÁ‡Ú¿^zZØ„¢Y,ÌÿQM©e§š}¨±®ÈÐØ[““‡ZɰÑoRöýýpœ’+D|IÇq¼ÈŒ #˽€t¸·¹¿ìC®§jØ*i$Z¨Ú%$âæö Ô|&Pã‹xåràš—pˆ©je¨XcmÄ”’vFÖêUloð1™âÆÙKÚ¿‘¬áO}þ?ÈÆË˜•‰‰óXüãXc™aÝõ%ÏÉ-ŽAÀM¥jXehŽÓÞ„é.ë[ðÇ!=™DŒ³æ,Ý@Qð8ãuùèÝš(É$ÿ¿€Ç ³ªg,ŠI¹5¥í‚wV µAÍjxþ_Ïs;¡GoH7=XVç¨ýßžPuuD´¹¦Z"s3l}7 "[4ɉMsS%µÏ©éÜÃUóªFœC`1•Ô_d.œböMüͶš¨NˆJKv‘ÿÙhtml2canvas-0.5.0-beta4/tests/cases/000077500000000000000000000000001265076030100171735ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/acid2.html000066400000000000000000000344661265076030100210600ustar00rootroot00000000000000 The Second Acid Test

                              
ERROR
 
html2canvas-0.5.0-beta4/tests/cases/background/000077500000000000000000000000001265076030100213125ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/background/clip.html000066400000000000000000000043601265076030100231320ustar00rootroot00000000000000 Background attribute tests
html2canvas-0.5.0-beta4/tests/cases/background/encoded.html000066400000000000000000000117461265076030100236120ustar00rootroot00000000000000 Background attribute tests
html2canvas-0.5.0-beta4/tests/cases/background/linear-gradient.html000066400000000000000000000155411265076030100252530ustar00rootroot00000000000000 Background attribute tests
 
 
 
 
 
 
 
 
 
 
html2canvas-0.5.0-beta4/tests/cases/background/multi.html000066400000000000000000000024601265076030100233340ustar00rootroot00000000000000 Background attribute tests
html2canvas-0.5.0-beta4/tests/cases/background/position.html000066400000000000000000000035631265076030100240530ustar00rootroot00000000000000 Background attribute tests
html2canvas-0.5.0-beta4/tests/cases/background/radial-gradient.html000066400000000000000000000240441265076030100252330ustar00rootroot00000000000000 Background attribute tests
 
 
 
 
 
 
 
 
 
 
 
html2canvas-0.5.0-beta4/tests/cases/background/repeat.html000066400000000000000000000032401265076030100234570ustar00rootroot00000000000000 Background attribute tests
html2canvas-0.5.0-beta4/tests/cases/background/size.html000066400000000000000000000032311265076030100231510ustar00rootroot00000000000000 Background size tests
html2canvas-0.5.0-beta4/tests/cases/border/000077500000000000000000000000001265076030100204505ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/border/dashed.html000066400000000000000000000016501265076030100225700ustar00rootroot00000000000000 Borders tests
 
 
 
 
html2canvas-0.5.0-beta4/tests/cases/border/dotted.html000066400000000000000000000016501265076030100226230ustar00rootroot00000000000000 Borders tests
 
 
 
 
html2canvas-0.5.0-beta4/tests/cases/border/double.html000066400000000000000000000016471265076030100226200ustar00rootroot00000000000000 Borders tests
 
 
 
 
html2canvas-0.5.0-beta4/tests/cases/border/inset.html000066400000000000000000000022621265076030100224620ustar00rootroot00000000000000 Borders tests
 
 
 
 
 
html2canvas-0.5.0-beta4/tests/cases/border/radius.html000066400000000000000000000035161265076030100226320ustar00rootroot00000000000000 Borders tests
 
 
 
 
 
 
html2canvas-0.5.0-beta4/tests/cases/border/solid.html000066400000000000000000000016471265076030100224600ustar00rootroot00000000000000 Borders tests
 
 
 
 
html2canvas-0.5.0-beta4/tests/cases/child-textnodes.html000066400000000000000000000011101265076030100231500ustar00rootroot00000000000000 Inline text in the top element Some inline text followed by text in span followed by more inline text.

Then a block level element.

Then more inline text. html2canvas-0.5.0-beta4/tests/cases/clip.html000066400000000000000000000031521265076030100210110ustar00rootroot00000000000000 Inline text in the top element
Some inline text followed by text in span followed by more inline text.

Then a block level element.

Then more inline text.
Some inline text followed by text in span followed by more inline text.

Then a block level element.

Then more inline text.
Some inline text followed by text in span followed by more inline text.

Then a block level element.

Then more inline text.
Some inline text followed by text in span followed by more inline text.

Then a block level element.

Then more inline text.
Some inline text followed by text in span followed by more inline text.

Then a block level element.

Then more inline text.
html2canvas-0.5.0-beta4/tests/cases/crossorigin-iframe.html000066400000000000000000000005021265076030100236600ustar00rootroot00000000000000 cross-origin iframe test html2canvas-0.5.0-beta4/tests/cases/forms.html000066400000000000000000000067141265076030100212170ustar00rootroot00000000000000 Form tests



html2canvas-0.5.0-beta4/tests/cases/google-maps.html000066400000000000000000000020511265076030100222710ustar00rootroot00000000000000 google maps

Google maps

html2canvas-0.5.0-beta4/tests/cases/iframe.html000066400000000000000000000003541265076030100213260ustar00rootroot00000000000000 iframe test html2canvas-0.5.0-beta4/tests/cases/images/000077500000000000000000000000001265076030100204405ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/images/base.html000066400000000000000000000007751265076030100222510ustar00rootroot00000000000000 External content tests

External image

External image (using <base> href)

html2canvas-0.5.0-beta4/tests/cases/images/canvas.html000066400000000000000000000013421265076030100226010ustar00rootroot00000000000000 Image tests html2canvas-0.5.0-beta4/tests/cases/images/cross-origin.html000066400000000000000000000007211265076030100237440ustar00rootroot00000000000000 External content tests

External image (CORS)

html2canvas-0.5.0-beta4/tests/cases/images/empty.html000066400000000000000000000011331265076030100224620ustar00rootroot00000000000000 Image tests Image without src attribute, should not crash: Image with broken src attribute, should not crash: html2canvas-0.5.0-beta4/tests/cases/images/images.html000066400000000000000000000022331265076030100225730ustar00rootroot00000000000000 Image tests html2canvas-0.5.0-beta4/tests/cases/images/svg/000077500000000000000000000000001265076030100212375ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/images/svg/base64.html000066400000000000000000000027761265076030100232250ustar00rootroot00000000000000 Base64 svg
Inline svg image:
html2canvas-0.5.0-beta4/tests/cases/images/svg/external.html000066400000000000000000000005571265076030100237560ustar00rootroot00000000000000 Image tests SVG taints image:
html2canvas-0.5.0-beta4/tests/cases/images/svg/inline.html000066400000000000000000000023151265076030100234040ustar00rootroot00000000000000 Inline svg
Inline svg image:
html2canvas-0.5.0-beta4/tests/cases/images/svg/native_only.html000066400000000000000000000066721265076030100244670ustar00rootroot00000000000000 Native svg only
html2canvas-0.5.0-beta4/tests/cases/images/svg/node.html000066400000000000000000000022771265076030100230620ustar00rootroot00000000000000 SVG node
SVG node image:
html2canvas-0.5.0-beta4/tests/cases/list/000077500000000000000000000000001265076030100201465ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/list/decimal-leading-zero.html000066400000000000000000000021451265076030100250120ustar00rootroot00000000000000 List tests
    html2canvas-0.5.0-beta4/tests/cases/list/decimal.html000066400000000000000000000021471265076030100224360ustar00rootroot00000000000000 List tests
      html2canvas-0.5.0-beta4/tests/cases/list/lower-alpha.html000066400000000000000000000021471265076030100232530ustar00rootroot00000000000000 List tests
        html2canvas-0.5.0-beta4/tests/cases/list/upper-roman.html000066400000000000000000000021471265076030100233050ustar00rootroot00000000000000 List tests
          html2canvas-0.5.0-beta4/tests/cases/overflow.html000066400000000000000000000056141265076030100217320ustar00rootroot00000000000000 Overflow tests

          Overflow: visible

          Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

          Overflow: hidden

          Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
          a
          Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
          position:relative within a overflow:hidden element

          Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
          html2canvas-0.5.0-beta4/tests/cases/pseudoelements.html000066400000000000000000000024401265076030100231150ustar00rootroot00000000000000 Pseudoelement tests
          Content 1 Content 2
          Content 1 Content 2
          Content 1 Content 2
          Content 1 Content 2
          html2canvas-0.5.0-beta4/tests/cases/text/000077500000000000000000000000001265076030100201575ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/text/chinese.html000066400000000000000000000124351265076030100224700ustar00rootroot00000000000000 Chinese text

              æ³¨    é‡Š

              ã€”1〕 è§æœ¬ä¹¦ç¬¬ä¸€å·ã€Šå®žè·µè®ºã€‹æ³¨ã€”6〕。

              ã€”2〕 è§åˆ—å®ã€Šå…šçš„组织和党的出版物》。列å®åœ¨è¿™ç¯‡è®ºæ–‡ä¸­è¯´ï¼šâ€œè¿™å°†æ˜¯è‡ªç”±çš„写作,因为把一批åˆä¸€æ‰¹æ–°ç”ŸåŠ›é‡å¸å¼•到写作队ä¼ä¸­æ¥çš„ï¼Œä¸æ˜¯ç§åˆ©è´ªæ¬²ï¼Œä¹Ÿä¸æ˜¯å誉地ä½ï¼Œè€Œæ˜¯ç¤¾ä¼šä¸»ä¹‰æ€æƒ³å’Œå¯¹åŠ³åŠ¨äººæ°‘çš„åŒæƒ…ã€‚è¿™å°†æ˜¯è‡ªç”±çš„å†™ä½œï¼Œå› ä¸ºå®ƒä¸æ˜¯ä¸ºé¥±é£Ÿç»ˆæ—¥çš„贵妇人æœåŠ¡ï¼Œä¸æ˜¯ä¸ºç™¾æ— èŠèµ–ã€èƒ–得呿„的‘一万个上层分å­â€™æœåŠ¡ï¼Œè€Œæ˜¯ä¸ºåƒåƒä¸‡ä¸‡åŠ³åŠ¨äººæ°‘ï¼Œä¸ºè¿™äº›å›½å®¶çš„ç²¾åŽã€å›½å®¶çš„力é‡ã€å›½å®¶çš„æœªæ¥æœåŠ¡ã€‚è¿™å°†æ˜¯è‡ªç”±çš„å†™ä½œï¼Œå®ƒè¦ç”¨ç¤¾ä¼šä¸»ä¹‰æ— äº§é˜¶çº§çš„ç»éªŒå’Œç”Ÿæ°”勃勃的工作去丰富人类é©å‘½æ€æƒ³çš„æœ€æ–°æˆå°±ï¼Œå®ƒè¦ä½¿è¿‡åŽ»çš„ç»éªŒï¼ˆä»ŽåŽŸå§‹ç©ºæƒ³çš„ç¤¾ä¼šä¸»ä¹‰å‘展而æˆçš„科学社会主义)和现在的ç»éªŒï¼ˆå·¥äººåŒå¿—们当å‰çš„æ–—争)之间ç»å¸¸å‘生相互作用。â€ï¼ˆã€Šåˆ—å®å…¨é›†ã€‹ç¬¬12å·ï¼Œäººæ°‘出版社1987年版,第96—97页)

              ã€”3〕 æ¢å®žç§‹ï¼ˆä¸€ä¹â—‹ä¸‰â€”—一ä¹å…«ä¸ƒï¼‰ï¼ŒåŒ—äº¬äººã€‚æ–°æœˆç¤¾ä¸»è¦æˆå‘˜ã€‚å…ˆåŽåœ¨å¤æ—¦å¤§å­¦ã€åŒ—京大学等校任教。曾写过一些文艺评论,长时期致力于文学翻译工作和散文的写作。é²è¿…对æ¢å®žç§‹çš„æ‰¹è¯„,è§ã€Šä¸‰é—²é›†Â·æ–°æœˆç¤¾æ‰¹è¯„家的任务》ã€ã€ŠäºŒå¿ƒé›†Â·â€œç¡¬è¯‘â€ä¸Žâ€œæ–‡å­¦çš„阶级性â€ã€‹ç­‰æ–‡ã€‚(《é²è¿…全集》第4å·ï¼Œäººæ°‘文学出版社1981年版,第159ã€195—212页)

              ã€”4〕 周作人(一八八五——一ä¹å…­ä¸ƒï¼‰ï¼Œæµ™æ±Ÿç»å…´äººã€‚曾在北京大学ã€ç‡•京大学等校任教。五四è¿åŠ¨æ—¶ä»Žäº‹æ–°æ–‡å­¦å†™ä½œã€‚ä»–çš„è‘—è¿°å¾ˆå¤šï¼Œæœ‰å¤§é‡çš„æ•£æ–‡é›†ã€æ–‡å­¦ä¸“著和翻译作å“。张资平(一八ä¹ä¸‰â€”—一ä¹äº”ä¹ï¼‰ï¼Œå¹¿ä¸œæ¢…县人。他写过很多å°è¯´ï¼Œæ›¾åœ¨æš¨å—大学ã€å¤§å¤å¤§å­¦å…¼ä»»æ•™èŒã€‚周作人ã€å¼ èµ„平于一ä¹ä¸‰å…«å¹´å’Œä¸€ä¹ä¸‰ä¹å¹´å…ˆåŽåœ¨åŒ—å¹³ã€ä¸Šæµ·ä¾é™„侵略中国的日本å é¢†è€…。

              ã€”5〕 è§é²è¿…《二心集·对于左翼作家è”盟的æ„è§ã€‹ï¼ˆã€Šé²è¿…全集》第4å·ï¼Œäººæ°‘文学出版社1981年版,第237—238页)。

              ã€”6〕 å‚è§é²è¿…ã€Šä¸”ä»‹äº­æ‚æ–‡æœ«ç¼–·附集·死》(《é²è¿…全集》第6å·ï¼Œäººæ°‘文学出版社1981年版,第612页)。

              ã€”7〕 â€œå°æ”¾ç‰›â€æ˜¯ä¸­å›½ä¸€å‡ºä¼ ç»Ÿçš„å°æ­Œèˆžå‰§ã€‚å…¨å‰§åªæœ‰ä¸¤ä¸ªè§’色,男角是牧童,女角是乡æ‘å°å§‘娘,以互相对唱的方å¼è¡¨çŽ°å‰§çš„å†…å®¹ã€‚æŠ—æ—¥æˆ˜äº‰åˆæœŸï¼Œé©å‘½çš„æ–‡è‰ºå·¥ä½œè€…利用这个歌舞剧的形å¼ï¼Œå˜åŠ¨å…¶åŽŸæ¥çš„è¯å¥ï¼Œå®£ä¼ æŠ—日,一时颇为æµè¡Œã€‚

              ã€”8〕 â€œäººã€æ‰‹ã€å£ã€åˆ€ã€ç‰›ã€ç¾Šâ€æ˜¯ç¬”画比较简å•的汉字,旧时一些å°å­¦å›½è¯­è¯»æœ¬æŠŠè¿™å‡ ä¸ªå­—编在第一册的最åˆå‡ è¯¾é‡Œã€‚

              ã€”9〕 “阳春白雪â€å’Œâ€œä¸‹é‡Œå·´äººâ€ï¼Œéƒ½æ˜¯å…¬å…ƒå‰ä¸‰ä¸–çºªæ¥šå›½çš„æ­Œæ›²ã€‚â€œé˜³æ˜¥ç™½é›ªâ€æ˜¯ä¾›å°‘数人欣èµçš„è¾ƒé«˜çº§çš„æ­Œæ›²ï¼›â€œä¸‹é‡Œå·´äººâ€æ˜¯æµä¼ å¾ˆå¹¿çš„æ°‘é—´æ­Œæ›²ã€‚ã€Šæ–‡é€‰Â·å®‹çŽ‰å¯¹æ¥šçŽ‹é—®ã€‹è®°è½½ä¸€ä¸ªæ•…äº‹ï¼Œè¯´æœ‰äººåœ¨æ¥šéƒ½å”±æ­Œï¼Œå”±â€œé˜³æ˜¥ç™½é›ªâ€æ—¶ï¼Œâ€œå›½ä¸­å±žè€Œå’Œè€…(跟ç€å”±çš„),ä¸è¿‡æ•°å人â€ï¼›ä½†å”±â€œä¸‹é‡Œå·´äººâ€æ—¶ï¼Œâ€œå›½ä¸­å±žè€Œå’Œè€…æ•°åƒäººâ€ã€‚

              ã€”10〕 è§åˆ—å®ã€Šå…šçš„组织和党的出版物》。列å®åœ¨è¿™ç¯‡è®ºæ–‡ä¸­è¯´ï¼šâ€œå†™ä½œäº‹ä¸šåº”当æˆä¸ºæ•´ä¸ªæ— äº§é˜¶çº§äº‹ä¸šçš„一部分,æˆä¸ºç”±æ•´ä¸ªå·¥äººé˜¶çº§çš„æ•´ä¸ªè§‰æ‚Ÿçš„先锋队所开动的一部巨大的社会民主主义机器的‘齿轮和螺ä¸é’‰â€™ã€‚â€ï¼ˆã€Šåˆ—å®å…¨é›†ã€‹ç¬¬12å·ï¼Œäººæ°‘出版社1987年版,第93页)

              ã€”11〕 亭å­é—´æ˜¯ä¸Šæµ·é‡Œå¼„房å­ä¸­çš„一ç§å°æˆ¿é—´ï¼Œä½ç½®åœ¨æˆ¿å­åŽéƒ¨çš„æ¥¼æ¢¯ä¸­ä¾§ï¼Œç‹­å°é»‘暗,因此租金比较低廉。解放以å‰ï¼Œè´«è‹¦çš„作家ã€è‰ºæœ¯å®¶ã€çŸ¥è¯†åˆ†å­å’Œæœºå…³å°èŒå‘˜ï¼Œå¤šåŠç§Ÿè¿™ç§æˆ¿é—´å±…ä½ã€‚

              ã€”12〕 è§æœ¬ä¹¦ç¬¬äºŒå·ã€Šå’Œä¸­å¤®ç¤¾ã€æ‰«è¡æŠ¥ã€æ–°æ°‘报三记者的谈è¯ã€‹æ³¨ã€”3〕。

              ã€”13〕 法æ·è€¶å¤«ï¼ˆä¸€ä¹â—‹ä¸€â€”—一ä¹äº”六),è‹è”å作家。他所作的å°è¯´ã€Šæ¯ç­ã€‹äºŽä¸€ä¹äºŒä¸ƒå¹´å‡ºç‰ˆï¼Œå†…容是æå†™è‹è”国内战争时期由è‹è”远东滨海边区工人ã€å†œæ°‘å’Œé©å‘½çŸ¥è¯†åˆ†å­æ‰€ç»„æˆçš„一支游击队åŒå›½å†…åé©å‘½ç™½å«å†›ä»¥åŠæ—¥æœ¬æ­¦è£…干涉军进行斗争的故事。这部å°è¯´æ›¾ç”±é²è¿…译为汉文。

              ã€”14〕 è§é²è¿…《集外集·自嘲》(《é²è¿…全集》第7å·ï¼Œäººæ°‘文学出版社1981年版,第147页)。

          html2canvas-0.5.0-beta4/tests/cases/text/fontawesome.html000066400000000000000000000027601265076030100234010ustar00rootroot00000000000000 fontawesome icons
          Fontawesome icons
          fa-5x
          • List icons
          • can be used
          • as bullets
          • in lists
          fa-twitter on fa-square-o
          fa-flag on fa-circle
          fa-terminal on fa-square
          fa-ban on fa-camera
          html2canvas-0.5.0-beta4/tests/cases/text/linethrough.html000066400000000000000000000024371265076030100234030ustar00rootroot00000000000000 Text-decoration:line-through tests Creating content through JavaScript html2canvas-0.5.0-beta4/tests/cases/text/shadow.html000066400000000000000000000021341265076030100223320ustar00rootroot00000000000000 Text shadow tests
          Some text followed by text with shadow followed by more text without shadow. Multi text shadow and some more text without shadow
          testing with transparent testing with low opacity
          html2canvas-0.5.0-beta4/tests/cases/text/text.html000066400000000000000000000124631265076030100220370ustar00rootroot00000000000000 Text tests

          <h1> text-decoration

          Arial

          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;
          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;
          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;

          Verdana

          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;
          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;
          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;

          Tahoma

          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;
          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;
          1. text-decoration:none;
          2. text-decoration:underline;
          3. text-decoration:overline;
          4. text-decoration:line-through;

          <h2> text-transform

          • text-transform:none;
          • text-transform: capitalize; (including foreign characters such as Öaäå)
          • text-transform:uppercase;
          • text-transform:lowercase;

          <h3> misc text alignments

          • word-spacing:5px; (as each letter is rendered individually, the bounds will always be correct)
          • line-height:35px;
            (same goes for line-height)
          • letter-spacing:5px;
          • text-align:right;width:300px;
          • font-variant:small-caps;
          html2canvas-0.5.0-beta4/tests/cases/text/underline-lineheight.html000066400000000000000000000023631265076030100251540ustar00rootroot00000000000000 Text-decoration:underline tests Creating content through JavaScript html2canvas-0.5.0-beta4/tests/cases/text/underline.html000066400000000000000000000024311265076030100230320ustar00rootroot00000000000000 Text-decoration:underline tests Creating content through JavaScript html2canvas-0.5.0-beta4/tests/cases/transform/000077500000000000000000000000001265076030100212065ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/transform/nested.html000066400000000000000000000027371265076030100233670ustar00rootroot00000000000000 Nested transform tests
          First level content
          with second level content
          and third level content
          , ending second
          , ending first
          something else
          html2canvas-0.5.0-beta4/tests/cases/transform/rotate.html000066400000000000000000000035331265076030100233760ustar00rootroot00000000000000 Rotation transform tests
          html2canvas-0.5.0-beta4/tests/cases/transform/translate.html000066400000000000000000000032001265076030100240640ustar00rootroot00000000000000 Nested transform tests
          First level content
          with second level content
          and third level content
          , ending second
          , ending first
          html2canvas-0.5.0-beta4/tests/cases/visibility.html000066400000000000000000000015041265076030100222500ustar00rootroot00000000000000 Visible elements tests

          Display:none and visible:hidden tests

          This should be visible
          display:none, This should be hidden
          visibility:hidden, This should be hidden

          display:none, This should be hidden
          visibility:hidden, This should be hidden
          html2canvas-0.5.0-beta4/tests/cases/zindex/000077500000000000000000000000001265076030100204745ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/cases/zindex/z-index1.html000066400000000000000000000033211265076030100230200ustar00rootroot00000000000000 z-index tests #1

          No z-indexed content

          DIV #1
          position: relative;

          DIV #2
          position: absolute;
          z-index: 1;


          DIV #3
          position: relative;

          DIV #4
          position: absolute;
          z-index: 2;
          Some more non-zindexed content
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index10.html000066400000000000000000000052071265076030100231050ustar00rootroot00000000000000 Understanding CSS z-index: The Stacking Context: Example Source

          Division Element #1

          position: relative;
          z-index: 5;

          Division Element #2

          position: relative;
          z-index: 2;

          Division Element #4

          position: relative;
          z-index: 6;

          Division Element #3

          position: absolute;
          z-index: 4;

          Division Element #5

          position: relative;
          z-index: 1;

          Division Element #6

          position: absolute;
          z-index: 3;
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index11.html000066400000000000000000000020141265076030100230770ustar00rootroot00000000000000 static position inside position relative

          Div Element #1

          position: relative;

          Div Element #2

          position: static;

          Div Element #3

          float: left;
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index12.html000066400000000000000000000020031265076030100230760ustar00rootroot00000000000000 Negative z-indexes

          Div Element #2

          Div Element #3

          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index13.html000066400000000000000000000012721265076030100231060ustar00rootroot00000000000000 text above children with negative z-index; z-index tests #13
          outer
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index14.html000066400000000000000000000011321265076030100231020ustar00rootroot00000000000000 body text above children with negative index but body bgcolor below body
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index15.html000066400000000000000000000011641265076030100231100ustar00rootroot00000000000000 body text and bgcolor above children with negative z-index body
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index16.html000066400000000000000000000014731265076030100231140ustar00rootroot00000000000000 Z-order positioning

          A butterfly image

          This text will overlay the butterfly image.
          This text will be beneath everything.
          This text will underlay text1, but overlay the butterfly image
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index17.html000066400000000000000000000010071265076030100231060ustar00rootroot00000000000000 z-index17
          fixed z-index 10
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index18.html000066400000000000000000000043151265076030100231140ustar00rootroot00000000000000 z-index18
          a
          b
          c
          d
          e
          f
          g
          h
          i
          j
          k
          l
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index2.html000066400000000000000000000042431265076030100230250ustar00rootroot00000000000000 z-index tests #2

          DIV #1
          position: relative;

          DIV #2
          position: absolute;
          z-index: 2;


          DIV #3
          position: relative;
          z-index: 1;

          DIV #4
          position: absolute;
          z-index: 10;

          DIV #5
          position:relative;

          DIV #6
          position:static;
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index3.html000066400000000000000000000051411265076030100230240ustar00rootroot00000000000000 z-index tests #3
          LEVEL #1

          LEVEL #2
          z-index: 1;
          LEVEL #3
          LEVEL #3
          LEVEL #3
          LEVEL #3
          LEVEL #3
          LEVEL #3
          LEVEL #3
          LEVEL #3
          LEVEL #3
          LEVEL #3
          LEVEL #3

          LEVEL #2
          z-index: 1;
          LEVEL #1
          LEVEL #1
          LEVEL #1
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index4.html000066400000000000000000000014461265076030100230310ustar00rootroot00000000000000 z-index tests #4
          LEVEL #1
          LEVEL #1
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index5.html000066400000000000000000000014011265076030100230210ustar00rootroot00000000000000 z-index tests #5
          LEVEL #1
          LEVEL #1
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index6.html000066400000000000000000000013521265076030100230270ustar00rootroot00000000000000 z-index tests #6
          z-index:0
          default z-index
          z-index:1
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index7.html000066400000000000000000000037501265076030100230340ustar00rootroot00000000000000 Stacking without z-index


          DIV #1
          position: absolute;

          DIV #2
          position: relative;

          DIV #3
          position: relative;

          DIV #4
          position: absolute;

          DIV #5
          no positioning
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index8.html000066400000000000000000000036651265076030100230420ustar00rootroot00000000000000 Stacking and float


          DIV #1
          position: absolute;

          DIV #2
          float: left;

          DIV #3
          float: right;


          DIV #4
          no positioning

          DIV #5
          position: absolute;
          html2canvas-0.5.0-beta4/tests/cases/zindex/z-index9.html000066400000000000000000000041121265076030100230270ustar00rootroot00000000000000 Adding z-index


          DIV #1
          position: absolute;
          z-index: 5;

          DIV #2
          position: relative;
          z-index: 3;

          DIV #3
          position: relative;
          z-index: 2;

          DIV #4
          position: absolute;
          z-index: 1;

          DIV #5
          no positioning
          z-index: 8;
          html2canvas-0.5.0-beta4/tests/mocha/000077500000000000000000000000001265076030100171645ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/mocha/.jshintrc000066400000000000000000000012461265076030100210140ustar00rootroot00000000000000{ "curly": true, "eqeqeq": true, "immed": true, "latedef": false, "newcap": true, "noarg": true, "sub": true, "undef": true, "boss": true, "eqnull": true, "browser": true, "globals": { "jQuery": true }, "predef": ["deepEqual", "module", "test", "$", "QUnit", "NodeParser", "NodeContainer", "StackingContext", "TextContainer", "ImageLoader", "CanvasRenderer", "Renderer", "Support", "bind", "Promise", "ImageContainer", "ProxyImageContainer", "DummyImageContainer", "Font", "FontMetrics", "GradientContainer", "LinearGradientContainer", "WebkitGradientContainer", "log", "smallImage", "parseBackgrounds"] } html2canvas-0.5.0-beta4/tests/mocha/background.html000066400000000000000000000111651265076030100221750ustar00rootroot00000000000000 Mocha Tests
          html2canvas-0.5.0-beta4/tests/mocha/clone.js000066400000000000000000000000671265076030100206250ustar00rootroot00000000000000document.querySelector("#block").className += "class"; html2canvas-0.5.0-beta4/tests/mocha/cropping.html000066400000000000000000000132201265076030100216710ustar00rootroot00000000000000 Mocha Tests
          html2canvas-0.5.0-beta4/tests/mocha/css.js000066400000000000000000000156331265076030100203220ustar00rootroot00000000000000var NodeContainer = html2canvas.NodeContainer; describe('Borders', function() { $('#borders div').each(function(i, node) { it($(this).attr('style'), function() { ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"].forEach(function(prop) { var result = $(node).css(prop); // older IE's don't necessarily return px even with jQuery if (result === "thin") { result = "1px"; } else if (result === "medium") { result = "3px"; } else if (result === "thick") { result = "5px"; } var container = new NodeContainer(node, null); expect(container.css(prop)).to.be(result); }); }); }); }); describe('Padding', function() { $('#padding div').each(function(i, node) { it($(this).attr('style'), function() { ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"].forEach(function(prop) { var container = new NodeContainer(node, null); var result = container.css(prop); expect(result).to.contain("px"); expect(result, $(node).css(prop)); }); }); }); }); describe('Background-position', function() { $('#backgroundPosition div').each(function(i, node) { it($(this).attr('style'), function() { var prop = "backgroundPosition"; var img = new Image(); img.width = 50; img.height = 50; var container = new NodeContainer(node, null); var item = container.css(prop), backgroundPosition = container.parseBackgroundPosition(html2canvas.utils.getBounds(node), img), split = (window.getComputedStyle) ? $(node).css(prop).split(" ") : [$(node).css(prop+"X"), $(node).css(prop+"Y")]; var testEl = $('
          ').css({ 'position': 'absolute', 'left': split[0], 'top': split[1] }); testEl.appendTo(node); expect(backgroundPosition.left).to.equal(Math.floor(parseFloat(testEl.css('left')))); expect(backgroundPosition.top).to.equal(Math.floor(parseFloat(testEl.css('top')))); testEl.remove(); }); }); }); describe('Text-shadow', function() { $('#textShadows div').each(function(i, node) { var index = i + 1; var container = new NodeContainer(node, null); var shadows = container.parseTextShadows(); it(node.style.textShadow, function() { if (i === 0) { expect(shadows.length).to.equal(0); } else { expect(shadows.length).to.equal(i >= 6 ? 2 : 1); expect(shadows[0].offsetX).to.equal(i); expect(shadows[0].offsetY).to.equal(i); if (i < 2) { expect(shadows[0].color.toString()).to.equal('rgba(0,0,0,0)'); } else if (i % 2 === 0) { expect(shadows[0].color.toString()).to.equal('rgb(2,2,2)'); } else { var opacity = '0.2'; expect(shadows[0].color.toString()).to.match(/rgba\(2,2,2,(0.2|0\.199219)\)/); } // only testing blur once if (i === 1) { expect(shadows[0].blur).to.equal('1'); } } }); }); }); describe('Background-image', function() { test_parse_background_image( 'url("te)st")', { prefix: '', method: 'url', value: 'url("te)st")', args: ['te)st'], image: null }, 'test quoted' ); test_parse_background_image( 'url("te,st")', { prefix: '', method: 'url', value: 'url("te,st")', args: ['te,st'], image: null }, 'test quoted' ); test_parse_background_image( 'url(te,st)', { prefix: '', method: 'url', value: 'url(te,st)', args: ['te,st'], image: null }, 'test quoted' ); test_parse_background_image( 'url(test)', { prefix: '', method: 'url', value: 'url(test)', args: ['test'], image: null }, 'basic url' ); test_parse_background_image( 'url("test")', { prefix: '', method: 'url', value: 'url("test")', args: ['test'], image: null }, 'quoted url' ); test_parse_background_image( 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)', { prefix: '', method: 'url', value: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)', args: ['data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'], image: null }, 'data url' ); test_parse_background_image( 'linear-gradient(red,black)', { prefix: '', method: 'linear-gradient', value: 'linear-gradient(red,black)', args: ['red','black'], image: null }, 'linear-gradient' ); test_parse_background_image( 'linear-gradient(top,rgb(255,0,0),rgb(0,0,0))', { prefix: '', method: 'linear-gradient', value: 'linear-gradient(top,rgb(255,0,0),rgb(0,0,0))', args: ['top', 'rgb(255,0,0)', 'rgb(0,0,0)'], image: null }, 'linear-gradient w/ rgb()' ); test_parse_background_image( '-webkit-linear-gradient(red,black)', { prefix: '-webkit-', method: 'linear-gradient', value: '-webkit-linear-gradient(red,black)', args: ['red','black'], image: null }, 'prefixed linear-gradient' ); test_parse_background_image( 'linear-gradient(red,black), url(test), url("test"),\n none, ', [ { prefix: '', method: 'linear-gradient', value: 'linear-gradient(red,black)', args: ['red','black'], image: null }, { prefix: '', method: 'url', value: 'url(test)', args: ['test'], image: null }, { prefix: '', method: 'url', value: 'url("test")', args: ['test'], image: null }, { prefix: '', method: 'none', value: 'none', args: [], image: null } ], 'multiple backgrounds' ); function test_parse_background_image(value, expected, name) { it(name, function() { expect(html2canvas.utils.parseBackgrounds(value)).to.eql(Array.isArray(expected) ? expected : [expected]); }); } }); html2canvas-0.5.0-beta4/tests/mocha/form-rendering.html000066400000000000000000000135541265076030100230000ustar00rootroot00000000000000 Mocha Tests
          html2canvas-0.5.0-beta4/tests/mocha/gradients.js000066400000000000000000000112741265076030100215070ustar00rootroot00000000000000describe("Gradients", function() { var expected = [ { method: "linear-gradient", args: [ "left", " rgb(255, 0, 0)", " rgb(255, 255, 0)", " rgb(0, 255, 0)" ] }, { method: "linear-gradient", args: [ "left", " red", " rgb(255, 255, 0)", " rgb(0, 255, 0)" ] }, { method: 'linear-gradient', args: [ "left", " rgb(206, 219, 233) 0%", " rgb(170, 197, 222) 17%", " rgb(97, 153, 199) 50%", " rgb(58, 132, 195) 51%", " rgb(65, 154, 214) 59%", " rgb(75, 184, 240) 71%", " rgb(58, 139, 194) 84%", " rgb(38, 85, 139) 100%" ] }, { method: 'linear-gradient', args: [ "left", " rgb(206, 219, 233) 0%", " rgb(170, 197, 222) 17px", " rgb(97, 153, 199) 50%", " rgb(58, 132, 195) 51px", " rgb(65, 154, 214) 59%", " rgb(75, 184, 240) 71px", " rgb(58, 139, 194) 84%", " rgb(38, 85, 139) 100px" ] }, { method: "gradient", args: [ "linear", " 50% 0%", " 50% 100%", " from(rgb(240, 183, 161))", " color-stop(0.5, rgb(140, 51, 16))", " color-stop(0.51, rgb(117, 34, 1))", " to(rgb(191, 110, 78))" ] }, { method: "gradient", args: [ "linear", " 50% 0%", " 50% 100%", " from(rgb(255, 0, 0))", " color-stop(0.314159, green)", " color-stop(0.51, rgb(0, 0, 255))", // temporary workaround for Blink/WebKit bug: crbug.com/453414 //" to(rgba(0, 0, 0, 0.5))" " to(rgba(0, 0, 0, 0))" ] }, { method: 'linear-gradient', args: [ "0deg", " rgb(221, 221, 221)", " rgb(221, 221, 221) 50%", " transparent 50%" ] }, { method: "radial-gradient", args: [ "75% 19%", " ellipse closest-side", " rgb(171, 171, 171)", " rgb(0, 0, 255) 33%", " rgb(153, 31, 31) 100%" ] }, { method: "radial-gradient", args: [ "75% 19%", " ellipse closest-corner", " rgb(171, 171, 171)", " rgb(0, 0, 255) 33%", " rgb(153, 31, 31) 100%" ] }, { method: "radial-gradient", args: [ "75% 19%", " ellipse farthest-side", " rgb(171, 171, 171)", " rgb(0, 0, 255) 33%", " rgb(153, 31, 31) 100%" ] }, { method: "radial-gradient", args: [ "75% 19%", " ellipse farthest-corner", " rgb(171, 171, 171)", " rgb(0, 0, 255) 33%", " rgb(153, 31, 31) 100%" ] }, { method: "radial-gradient", args: [ "75% 19%", " ellipse contain", " rgb(171, 171, 171)", " rgb(0, 0, 255) 33%", " rgb(153, 31, 31) 100%" ] }, { method: "radial-gradient", args: [ "75% 19%", " ellipse cover", " rgb(171, 171, 171)", " rgb(0, 0, 255) 33%", " rgb(153, 31, 31) 100%" ] } ]; [].slice.call(document.querySelectorAll('#backgroundGradients div'), 0).forEach(function(node, i) { var container = new html2canvas.NodeContainer(node, null); var value = container.css("backgroundImage"); it(value, function() { var parsedBackground = html2canvas.utils.parseBackgrounds(value); if (parsedBackground[0].args[0] === "0% 50%") { parsedBackground[0].args[0] = 'left'; } expect(parsedBackground[0].args).to.eql(expected[i].args); expect(parsedBackground[0].method).to.eql(expected[i].method); }); }); }); html2canvas-0.5.0-beta4/tests/mocha/ie9-clonenode-bug.html000066400000000000000000000037411265076030100232640ustar00rootroot00000000000000 Proxy tests
          html2canvas-0.5.0-beta4/tests/mocha/iframe1.htm000066400000000000000000000006641265076030100212300ustar00rootroot00000000000000  
           
          html2canvas-0.5.0-beta4/tests/mocha/iframe2.htm000066400000000000000000000007131265076030100212240ustar00rootroot00000000000000
           
          html2canvas-0.5.0-beta4/tests/mocha/iframe3.htm000066400000000000000000000006121265076030100212230ustar00rootroot00000000000000
           
          html2canvas-0.5.0-beta4/tests/mocha/multiple-renders.html000066400000000000000000000062361265076030100233540ustar00rootroot00000000000000 Mocha Tests
          html2canvas-0.5.0-beta4/tests/mocha/options.onclone.html000066400000000000000000000066031265076030100232060ustar00rootroot00000000000000 Mocha Tests
          html2canvas-0.5.0-beta4/tests/mocha/parsing.html000066400000000000000000000323421265076030100215210ustar00rootroot00000000000000 Mocha Tests
          Yep, here's some more.
          Div 1
          Div 2
          Some more divs
          html2canvas-0.5.0-beta4/tests/mocha/proxy.htm000066400000000000000000000057371265076030100210730ustar00rootroot00000000000000 Proxy tests
          html2canvas-0.5.0-beta4/tests/mocha/scrolling.html000066400000000000000000000102631265076030100220500ustar00rootroot00000000000000 Scrolling tests
          html2canvas-0.5.0-beta4/tests/mocha/selenium.js000066400000000000000000000054671265076030100213570ustar00rootroot00000000000000var wd = require('wd'); var http = require("http"); var https = require("https"); var url = require("url"); var path = require("path"); var Promise = require('bluebird'); var _ = require('lodash'); var humanizeDuration = require("humanize-duration"); var utils = require('../utils'); var colors = utils.colors; var port = 8080; function runTestWithRetries(browser, test, retries) { retries = retries || 0; return runTest(browser, test) .timeout(30000) .catch(Promise.TimeoutError, function() { if (retries < 3) { console.log(colors.violet, "Retry", (retries + 1), test); return runTestWithRetries(browser, test, retries + 1); } else { throw new Error("Couldn't run test after 3 retries"); } }); } function getResults(browser) { return function() { return Promise.props({ dataUrl: browser.waitForElementByCss("body[data-complete='true']", 90000).then(function() { return browser.elementsByCssSelector('.test.fail'); }).then(function(nodes) { return Array.isArray(nodes) ? Promise.map(nodes, function(node) { return browser.text(node).then(function(error) { return Promise.reject(error); }); }) : Promise.resolve([]); }) }); }; } function runTest(browser, test) { return Promise.resolve(browser .then(utils.loadTestPage(browser, test, port)) .then(getResults(browser)) ).cancellable(); } exports.tests = function(browsers, singleTest) { var path = "tests/mocha"; return (singleTest ? Promise.resolve([singleTest]) : utils.getTests(path)).then(function(tests) { return Promise.map(browsers, function(settings) { var name = [settings.browserName, settings.version, settings.platform].join("-"); var count = 0; var browser = utils.initBrowser(settings); return Promise.using(browser, function() { return Promise.map(tests, function(test, index, total) { console.log(colors.green, "STARTING", "(" + (++count) + "/" + total + ")", name, test, colors.clear); var start = Date.now(); return runTestWithRetries(browser, test).then(function() { console.log(colors.green, "COMPLETE", humanizeDuration(Date.now() - start), "(" + count + "/" + total + ")", name, colors.clear); }); }, {concurrency: 1}) .settle() .catch(function(error) { console.error(colors.red, "ERROR", name, error); throw error; }); }); }, {concurrency: 3}); }); }; html2canvas-0.5.0-beta4/tests/node/000077500000000000000000000000001265076030100170225ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/node/color.js000066400000000000000000000071711265076030100205040ustar00rootroot00000000000000var Color = require('../../src/color'); var assert = require('assert'); describe("Colors", function() { describe("named colors", function() { it("bisque", function () { var c = new Color("bisque"); assertColor(c, 255, 228, 196, null); assert.equal(c.isTransparent(), false); }); it("BLUE", function () { var c = new Color("BLUE"); assertColor(c, 0, 0, 255, null); assert.equal(c.isTransparent(), false); }); }); describe("rgb()", function() { it("rgb(1,3,5)", function () { var c = new Color("rgb(1,3,5)"); assertColor(c, 1, 3, 5, null); assert.equal(c.isTransparent(), false); }); it("rgb(222, 111, 50)", function () { var c = new Color("rgb(222, 111, 50)"); assertColor(c, 222, 111, 50, null); assert.equal(c.isTransparent(), false); }); it("rgb( 222, 111 , 50)", function () { var c = new Color("rgb(222 , 111 , 50)"); assertColor(c, 222, 111, 50, null); assert.equal(c.isTransparent(), false); }); }); describe("rgba()", function() { it("rgba(200,3,5,1)", function () { var c = new Color("rgba(200,3,5,1)"); assertColor(c, 200, 3, 5, 1); assert.equal(c.isTransparent(), false); }); it("rgba(222, 111, 50, 0.22)", function () { var c = new Color("rgba(222, 111, 50, 0.22)"); assertColor(c, 222, 111, 50, 0.22); assert.equal(c.isTransparent(), false); }); it("rgba( 222, 111 , 50, 0.123 )", function () { var c = new Color("rgba(222 , 111 , 50, 0.123)"); assertColor(c, 222, 111, 50, 0.123); assert.equal(c.isTransparent(), false); }); }); describe("hex", function() { it("#7FFFD4", function () { var c = new Color("#7FFFD4"); assertColor(c, 127, 255, 212, null); assert.equal(c.isTransparent(), false); }); it("#f0ffff", function () { var c = new Color("#f0ffff"); assertColor(c, 240, 255, 255, null); assert.equal(c.isTransparent(), false); }); it("#fff", function () { var c = new Color("#fff"); assertColor(c, 255, 255, 255, null); assert.equal(c.isTransparent(), false); }); }); describe("from array", function() { it("[1,2,3]", function () { var c = new Color([1,2,3]); assertColor(c, 1, 2, 3, null); assert.equal(c.isTransparent(), false); }); it("[5,6,7,1]", function () { var c = new Color([5,6,7, 1]); assertColor(c, 5, 6, 7, 1); assert.equal(c.isTransparent(), false); }); it("[5,6,7,0]", function () { var c = new Color([5,6,7, 0]); assertColor(c, 5, 6, 7, 0); assert.equal(c.isTransparent(), true); }); }); describe("transparency", function() { it("transparent", function () { var c = new Color("transparent"); assertColor(c, 0, 0, 0, 0); assert.equal(c.isTransparent(), true); }); it("rgba(255,255,255,0)", function () { var c = new Color("rgba(255,255,255,0)"); assertColor(c, 255, 255, 255, 0); assert.equal(c.isTransparent(), true); }); }); }); function assertColor(c, r, g, b, a) { assert.equal(c.r, r); assert.equal(c.g, g); assert.equal(c.b, b); assert.equal(c.a, a); } html2canvas-0.5.0-beta4/tests/node/package.js000066400000000000000000000011651265076030100207560ustar00rootroot00000000000000var assert = require('assert'); var path = require('path'); var html2canvas = require('../../'); describe("Package", function() { it("should have html2canvas defined", function() { assert.equal(typeof(html2canvas), "function"); }); }); describe.only("requirejs", function() { var requirejs = require('requirejs'); requirejs.config({ baseUrl: path.resolve(__dirname, '../../dist') }); it("should have html2canvas defined", function(done) { requirejs(['html2canvas'], function(h2c) { assert.equal(typeof(h2c), "function"); done(); }); }); }); html2canvas-0.5.0-beta4/tests/rangetest.html000066400000000000000000000017361265076030100207660ustar00rootroot00000000000000 Range tests
          html2canvas-0.5.0-beta4/tests/results/000077500000000000000000000000001265076030100175765ustar00rootroot00000000000000html2canvas-0.5.0-beta4/tests/results/.gitignore000066400000000000000000000000151265076030100215620ustar00rootroot00000000000000* !.gitignorehtml2canvas-0.5.0-beta4/tests/sauceconnect.js000066400000000000000000000005101265076030100211010ustar00rootroot00000000000000const sauceConnectLauncher = require('sauce-connect-launcher'); sauceConnectLauncher({ username: process.env.SAUCE_USERNAME, accessKey: process.env.SAUCE_ACCESS_KEY, logger: console.log }, err => { if (err) { console.error(err.message); return; } console.log('Sauce Connect ready'); }); html2canvas-0.5.0-beta4/tests/selenium.js000066400000000000000000000105221265076030100202540ustar00rootroot00000000000000(function(){ "use strict;"; var wd = require('wd'), http = require("http"), https = require("https"), url = require("url"), path = require("path"), base64_arraybuffer = require('base64-arraybuffer'), PNG = require('pngjs').PNG, Promise = require('bluebird'), _ = require('lodash'), humanizeDuration = require("humanize-duration"), fs = require("fs"); var utils = require('./utils'); var colors = utils.colors; Promise.promisifyAll(fs); var port = 8080; function getPixelArray(base64) { return new Promise(function(resolve, reject) { const arraybuffer = base64_arraybuffer.decode(base64); new PNG().parse(arraybuffer, (error, data) => { if (error) { reject(error); } else { resolve(data.data); } }); }); } function calculateDifference(h2cPixels, screenPixels) { var len = h2cPixels.length, index = 0, diff = 0; for (; index < len; index++) { if (screenPixels[index] - h2cPixels[index] !== 0) { diff++; } } return (100 - (Math.round((diff/h2cPixels.length) * 10000) / 100)); } function captureScreenshots(browser) { return function() { return Promise.props({ dataUrl: browser.waitForElementByCss(".html2canvas", 15000).then(function(node) { return browser.execute("return arguments[0].toDataURL('image/png').substring(22)", [node]); }), screenshot: browser.takeScreenshot() }); }; } function analyzeResults(test) { return function(result) { return Promise.all([getPixelArray(result.dataUrl), getPixelArray(result.screenshot)]).spread(calculateDifference).then(function(accuracy) { return { testCase: test, accuracy: accuracy, dataUrl: result.dataUrl, screenshot: result.screenshot }; }); }; } function runTestWithRetries(browser, test, retries) { retries = retries || 0; return runTest(browser, test) .timeout(60000) .catch(Promise.TimeoutError, function() { if (retries < 3) { console.log(colors.violet, "Retry", (retries + 1), test); return runTestWithRetries(browser, test, retries + 1); } else { throw new Error("Couldn't run test after 3 retries"); } }); } function runTest(browser, test) { return Promise.resolve(browser .then(utils.loadTestPage(browser, test, port)) .then(captureScreenshots(browser)) .then(analyzeResults(test))); } exports.tests = function(browsers, singleTest) { var path = "tests/cases"; return (singleTest ? Promise.resolve([singleTest]) : utils.getTests(path)).then(function(tests) { return Promise.map(browsers, function(settings) { var browser = utils.initBrowser(settings); var name = [settings.browserName, settings.version, settings.platform].join("-"); var count = 0; return Promise.using(browser, function() { return Promise.map(tests, function(test, index, total) { console.log(colors.green, "STARTING", "(" + (++count) + "/" + total + ")", name, test, colors.clear); var start = Date.now(); return runTestWithRetries(browser, test).then(function(result) { console.log(colors.green, "COMPLETE", humanizeDuration(Date.now() - start), "(" + count + "/" + total + ")", name, result.testCase.substring(path.length), result.accuracy.toFixed(2) + "%", colors.clear); }); }, {concurrency: 1}) .settle() .catch(function(error) { console.log(colors.red, "ERROR", name, error.message); throw error; }); }); }, {concurrency: 3}); }); }; })(); html2canvas-0.5.0-beta4/tests/test.js000066400000000000000000000117741265076030100174240ustar00rootroot00000000000000var h2cSelector, h2cOptions; (function(document, window) { function appendScript(src) { document.write(''); } ['/node_modules/bluebird/js/browser/bluebird', '/tests/assets/jquery-1.6.2', '/dist/html2canvas'].forEach(appendScript); if (typeof(noFabric) === "undefined") { appendScript('/dist/html2canvas.svg'); } window.onload = function() { (function( $ ){ $.fn.html2canvas = function(options) { if (options && options.profile && window.console && window.console.profile && window.location.search !== "?selenium2") { window.console.profile(); } var date = new Date(), $message = null, timeoutTimer = false, timer = date.getTime(); options = options || {}; var promise = html2canvas(this, options); promise['catch'](function(err) { console.log("html2canvas threw an error", err); }); promise.then(function(canvas) { var $canvas = $(canvas), finishTime = new Date(); if (options && options.profile && window.console && window.console.profileEnd) { window.console.profileEnd(); } $canvas.addClass("html2canvas") .css({ position: 'absolute', left: 0, top: 0 }).appendTo(document.body); if (window.location.search !== "?selenium") { $canvas.siblings().toggle(); $(window).click(function(){ $canvas.toggle().siblings().toggle(); $(document.documentElement).css('background', $canvas.is(':visible') ? "none" : ""); $(document.body).css('background', $canvas.is(':visible') ? "none" : ""); throwMessage("Canvas Render " + ($canvas.is(':visible') ? "visible" : "hidden")); }); $(document.documentElement).css('background', $canvas.is(':visible') ? "none" : ""); $(document.body).css('background', $canvas.is(':visible') ? "none" : ""); throwMessage('Screenshot created in '+ ((finishTime.getTime()-timer)) + " ms
          ",4000); } else { $canvas.css('display', 'none'); } // test if canvas is read-able try { $canvas[0].toDataURL(); } catch(e) { if ($canvas[0].nodeName.toLowerCase() === "canvas") { // TODO, maybe add a bit less offensive way to present this, but still something that can easily be noticed window.alert("Canvas is tainted, unable to read data"); } } }); function throwMessage(msg,duration){ window.clearTimeout(timeoutTimer); timeoutTimer = window.setTimeout(function(){ $message.fadeOut(function(){ $message.remove(); $message = null; }); },duration || 2000); if ($message) $message.remove(); $message = $('
          ').html(msg).css({ margin:0, padding:10, background: "#000", opacity:0.7, position:"fixed", top:10, right:10, fontFamily: 'Tahoma', color:'#fff', fontSize:12, borderRadius:12, width:'auto', height:'auto', textAlign:'center', textDecoration:'none', display:'none' }).appendTo(document.body).fadeIn(); console.log(msg); } }; })(jQuery); h2cSelector = [document.documentElement]; if (window.setUp) { window.setUp(); } window.run = function() { $(h2cSelector).html2canvas($.extend({ logging: true, profile: true, proxy: "http://localhost:8082", useCORS: false, removeContainer: false }, h2cOptions)); }; if (typeof(dontRun) === "undefined") { setTimeout(window.run, 100); } }; }(document, window)); html2canvas-0.5.0-beta4/tests/utils.js000066400000000000000000000034461265076030100176020ustar00rootroot00000000000000var fs = require('fs'); var wd = require('wd'); var path = require('path'); var Promise = require('bluebird'); var _ = require('lodash'); Promise.promisifyAll(fs); var colors = { red: "\x1b[1;31m", blue: "\x1b[1;36m", violet: "\x1b[0;35m", green: "\x1b[0;32m", clear: "\x1b[0m" }; function isHtmlFile(filename) { return path.extname(filename) === '.html'; } function getTests(path) { return fs.readdirAsync(path).map(function(name) { var filename = path + "/" + name; return fs.statAsync(filename).then(function(stat) { return stat.isDirectory() ? getTests(filename) : filename; }); }).then(function(t) { return _.flatten(t).filter(isHtmlFile); }); } function initBrowser(settings) { var browser = wd.remote({ hostname: 'localhost', port: 4445, user: process.env.SAUCE_USERNAME, pwd: process.env.SAUCE_ACCESS_KEY }, 'promiseChain'); if (process.env.TRAVIS_JOB_NUMBER) { settings["tunnel-identifier"] = process.env.TRAVIS_JOB_NUMBER; settings["name"] = process.env.TRAVIS_COMMIT.substring(0, 10); settings["build"] = process.env.TRAVIS_BUILD_NUMBER; } else { settings["name"] = "Manual run"; } return browser.resolve(Promise).init(settings).then(function(b) { return Promise.resolve(b).disposer(function() { return browser.quit(); }); }); } function loadTestPage(browser, test, port) { return function(settings) { return browser.get("http://localhost:" + port + "/" + test + "?selenium").then(function() { return settings; }); }; } module.exports.colors = colors; module.exports.getTests = getTests; module.exports.initBrowser = initBrowser; module.exports.loadTestPage = loadTestPage;