{"action":"created","issue":{"url":"https://api.github.com/repos/Khan/KaTeX/issues/263","labels_url":"https://api.github.com/repos/Khan/KaTeX/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/Khan/KaTeX/issues/263/comments","events_url":"https://api.github.com/repos/Khan/KaTeX/issues/263/events","html_url":"https://github.com/Khan/KaTeX/issues/263","id":89962255,"number":263,"title":"Snapshot alternatives","user":{"login":"gagern","id":190759,"avatar_url":"https://avatars.githubusercontent.com/u/190759?v=3","gravatar_id":"","url":"https://api.github.com/users/gagern","html_url":"https://github.com/gagern","followers_url":"https://api.github.com/users/gagern/followers","following_url":"https://api.github.com/users/gagern/following{/other_user}","gists_url":"https://api.github.com/users/gagern/gists{/gist_id}","starred_url":"https://api.github.com/users/gagern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagern/subscriptions","organizations_url":"https://api.github.com/users/gagern/orgs","repos_url":"https://api.github.com/users/gagern/repos","events_url":"https://api.github.com/users/gagern/events{/privacy}","received_events_url":"https://api.github.com/users/gagern/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-21T21:18:02Z","updated_at":"2015-07-06T13:55:36Z","closed_at":null,"body":"In https://github.com/Khan/KaTeX/pull/246#issuecomment-112148381 I asked about whether PhantomJS could/should be used to create snapshots, instead of Selenium. Today [I gave that a try](https://github.com/gagern/KaTeX/commits/phantomjs-experiments), using the phantomjs 1.9.0 package that comes with Ubuntu 14.04 (though 15.04 is still at 1.9.0). I stayed with Docker for now, since that (with Boot2Docker) appears to be the most reliable option for cross-platform reproducibility, but I envisioned packaging phantomjs and its libs into a tarball which could be used with a `LD_LIBRARY_PATH` override, on Linux without Docker and Ubuntu and all that stuff along. [Here is the Dockerfile.](https://github.com/gagern/KaTeX/blob/phantomjs-experiments/dockers/Phantom/Dockerfile)\r\n\r\nI used this to execute a script which was accessed through the `/KaTeX` mount and named on the command line. The docker I created is in no way KaTeX-Specific and therefore highly reusable. (I'll likely upload it to the DockerHub if I ever create an account there.) I had the script access the KaTeX development server running outside the docker, on my development machine, thus avoiding the need for node and other stuff inside the docker.\r\n\r\nSo far, so good. But when I got [the first results](https://github.com/gagern/KaTeX/commit/7a1b0158f95ca06cf52a3f9742cf4020301ae3d3), things looked *really bad.* Quite a number of test cases had severe problems with vertical positioning. So what should we learn from this? One thing to learn is that the QtWebKit version used by that version of PhantomJS doesn't seem particularly well suited to rendering our output. If that browser is affected, how many other browsers might be affected as well? Should we diagnose the bug, make sure that QtWebKit is violating some spec to render stuff the way it does, then file a bug report? Or should we try to work around the issue, assuming that others might be using QtWebKit or something related in one way or another, so we should support it?\r\n\r\nAnother thing I learned is that even in the days of the WHATWG, it matters quite a lot what browser you are using. Should we therefore extend our snapshots to not only cover Firefox, but at least Chrome as well? If we do, then I would suggest we stop building our own specific docker image, and instead build on the [selenium images available from the docker hub](https://registry.hub.docker.com/repos/selenium/). That way, users don't have to build images themselves, which can take considerable time in a VM, but instead just download them. And at 531.5M the standalonge firefox image for selenium is still smaller than the 790.6M for the KaTeX screenshotter as it currently stands. We could do some of the stuff I did in my experiments: run the development server outside the docker, so that you need no modifications to the images in order to run the tests.\r\n\r\nThe current version of PhantomJS is 2.0.0. Building that from source takes ages, but I tried [this docker image](https://registry.hub.docker.com/u/servebox/phantomjs/). The vertical spacing was better with that, but the fonts were all wrong. I'm not sure whether that's some artifact from the build environment, or another bug in PhantomJS. I guess I'll compile a version on Gentoo tomorrow, see what that does, to distinguish between these possibilities."},"comment":{"url":"https://api.github.com/repos/Khan/KaTeX/issues/comments/118861381","html_url":"https://github.com/Khan/KaTeX/issues/263#issuecomment-118861381","issue_url":"https://api.github.com/repos/Khan/KaTeX/issues/263","id":118861381,"user":{"login":"kevinb7","id":1044413,"avatar_url":"https://avatars.githubusercontent.com/u/1044413?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinb7","html_url":"https://github.com/kevinb7","followers_url":"https://api.github.com/users/kevinb7/followers","following_url":"https://api.github.com/users/kevinb7/following{/other_user}","gists_url":"https://api.github.com/users/kevinb7/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinb7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinb7/subscriptions","organizations_url":"https://api.github.com/users/kevinb7/orgs","repos_url":"https://api.github.com/users/kevinb7/repos","events_url":"https://api.github.com/users/kevinb7/events{/privacy}","received_events_url":"https://api.github.com/users/kevinb7/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T13:55:36Z","updated_at":"2015-07-06T13:55:36Z","body":"Thanks to @spicyj we now have an open source account with BrowserStack."}}