{"action":"created","issue":{"url":"https://api.github.com/repos/sdesalas/trifleJS/issues/55","labels_url":"https://api.github.com/repos/sdesalas/trifleJS/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/sdesalas/trifleJS/issues/55/comments","events_url":"https://api.github.com/repos/sdesalas/trifleJS/issues/55/events","html_url":"https://github.com/sdesalas/trifleJS/issues/55","id":80488444,"number":55,"title":"clipRect can not work well","user":{"login":"xiangdewei","id":3114109,"avatar_url":"https://avatars.githubusercontent.com/u/3114109?v=3","gravatar_id":"","url":"https://api.github.com/users/xiangdewei","html_url":"https://github.com/xiangdewei","followers_url":"https://api.github.com/users/xiangdewei/followers","following_url":"https://api.github.com/users/xiangdewei/following{/other_user}","gists_url":"https://api.github.com/users/xiangdewei/gists{/gist_id}","starred_url":"https://api.github.com/users/xiangdewei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiangdewei/subscriptions","organizations_url":"https://api.github.com/users/xiangdewei/orgs","repos_url":"https://api.github.com/users/xiangdewei/repos","events_url":"https://api.github.com/users/xiangdewei/events{/privacy}","received_events_url":"https://api.github.com/users/xiangdewei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-25T10:34:08Z","updated_at":"2015-05-26T09:19:43Z","closed_at":null,"body":"Hello, \r\n\r\nI found an issue, I use trifleJS to capture a specific DOM element, the same code that can work correctly in Phantom, but in trifileJS can not work correctly.\r\n\r\nThis is my full code, and my IE=11\r\n\r\nvar page = require('webpage').create(),\r\n       system = require('system'),\r\n       address, output, size;\r\n\r\nvar output = \"cnblog.png\";\r\nvar address = \"http://news.cnblogs.com/n/521792/\";\r\n\r\npage.viewportSize = { width: 1366, height: 768 };\r\npage.open(address, function (status) {\r\n    if (status !== 'success') {\r\n        console.log('Unable to load the address!');\r\n        phantom.exit();\r\n    } else {\r\n        window.setTimeout(function () {\r\n           var fk=page.evaluate(function () {\r\n                var response;\r\n               // var element = document.getElementById(\"news_main\");    // script error, getBoundingClientRect not defined\r\n                var element = document.querySelector('#news_main');         // returns {}\r\n                //var element = document.documentElement            // returns {}\r\n                var rect = element.getBoundingClientRect();\r\n                response = rect.height;\r\n                return '{\"width\":'+rect.width+',\"height\":'+rect.height+',\"top\":'+rect.top+',\"left\":'+rect.left+'}';\r\n           });\r\n\r\n           var clipRect = JSON.parse(fk);\r\n           \r\n           page.clipRect = {\r\n               top: clipRect.top,\r\n               left: clipRect.left,\r\n               width: clipRect.width,\r\n               height: clipRect.height\r\n           };\r\n           console.log(page.clipRect)\r\n            page.render(output);\r\n            phantom.exit();\r\n        }, 1000);\r\n    }\r\n});\r\n\r\nHere are the results:\r\n\r\nThe correct one.\r\n\r\n![cnblog](https://cloud.githubusercontent.com/assets/3114109/7795889/ed5e5f0a-030b-11e5-978c-536972b508cb.png)\r\n\r\nThe Incorrect one:\r\n![cnblog](https://cloud.githubusercontent.com/assets/3114109/7795905/263ce4f4-030c-11e5-83e5-68c97dc45106.png)\r\n"},"comment":{"url":"https://api.github.com/repos/sdesalas/trifleJS/issues/comments/105460305","html_url":"https://github.com/sdesalas/trifleJS/issues/55#issuecomment-105460305","issue_url":"https://api.github.com/repos/sdesalas/trifleJS/issues/55","id":105460305,"user":{"login":"xiangdewei","id":3114109,"avatar_url":"https://avatars.githubusercontent.com/u/3114109?v=3","gravatar_id":"","url":"https://api.github.com/users/xiangdewei","html_url":"https://github.com/xiangdewei","followers_url":"https://api.github.com/users/xiangdewei/followers","following_url":"https://api.github.com/users/xiangdewei/following{/other_user}","gists_url":"https://api.github.com/users/xiangdewei/gists{/gist_id}","starred_url":"https://api.github.com/users/xiangdewei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiangdewei/subscriptions","organizations_url":"https://api.github.com/users/xiangdewei/orgs","repos_url":"https://api.github.com/users/xiangdewei/repos","events_url":"https://api.github.com/users/xiangdewei/events{/privacy}","received_events_url":"https://api.github.com/users/xiangdewei/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T09:19:43Z","updated_at":"2015-05-26T09:19:43Z","body":"Hello, anybody saw my question?"}}