{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/ol3/issues/4016","labels_url":"https://api.github.com/repos/openlayers/ol3/issues/4016/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/4016/comments","events_url":"https://api.github.com/repos/openlayers/ol3/issues/4016/events","html_url":"https://github.com/openlayers/ol3/pull/4016","id":101854645,"number":4016,"title":"Make ol.has.* do not depend on ol.ENABLE_*","user":{"login":"elemoine","id":76594,"avatar_url":"https://avatars.githubusercontent.com/u/76594?v=3","gravatar_id":"","url":"https://api.github.com/users/elemoine","html_url":"https://github.com/elemoine","followers_url":"https://api.github.com/users/elemoine/followers","following_url":"https://api.github.com/users/elemoine/following{/other_user}","gists_url":"https://api.github.com/users/elemoine/gists{/gist_id}","starred_url":"https://api.github.com/users/elemoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elemoine/subscriptions","organizations_url":"https://api.github.com/users/elemoine/orgs","repos_url":"https://api.github.com/users/elemoine/repos","events_url":"https://api.github.com/users/elemoine/events{/privacy}","received_events_url":"https://api.github.com/users/elemoine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-19T10:09:22Z","updated_at":"2015-08-19T12:20:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openlayers/ol3/pulls/4016","html_url":"https://github.com/openlayers/ol3/pull/4016","diff_url":"https://github.com/openlayers/ol3/pull/4016.diff","patch_url":"https://github.com/openlayers/ol3/pull/4016.patch"},"body":"With this PR `ol.has.WEBGL` does not depend on the value of the `ol.ENABLE_WEBGL` define variable. Same for `ol.has.CANVAS`, `ol.has.DOM` (which I completely removed) and `ol.has.TOUCH`.\r\n\r\n`ol.has` is about the capabilities of the browser, so it doesn't make sense that variables set in `ol.has` depend on compilation settings (`@define`).\r\n\r\nFor example, currently, a custom build with `ol.ENABLE_WEBGL` set to `false` will have `ol.has.WEBGL` set to `false` as well, even if the browser does support WebGL. And if the user also generates a debug build (with no `compile` section in the json config) then `ol.ENABLE_WEBGL` will be `true` and `ol.has.WEBGL`  will be `false` only if the browser does not support WebGL. This PR fixes that inconsistency issue.\r\n\r\nWith `ol.ENABLE_WEBGL` set to `false` the build is slightly bigger with my changes (131660 bytes versus 131841 bytes compressed, see below). This is because, with my changes, the build always includes the code that tests whether the browser supports WebGL.\r\n\r\nPlease review.\r\n\r\n----\r\n\r\nFull build size with `ol.ENABLE_WEBGL` and `ol.ENABLE_DOM` set to `false`. First is `master` branch. Second is `has` branch.\r\n\r\n```bash\r\n[wrk12 ol3 (master *$% u+1196)]$ make build/ol.js\r\nnode tasks/build.js config/ol.json build/ol.js\r\ninfo ol Parsing dependencies\r\ninfo ol Compiling 356 sources\r\nuncompressed: 441277 bytes\r\n  compressed: 131660 bytes\r\n``` \r\n\r\n```bash\r\n[wrk12 ol3 (has *$%)]$ make build/ol.js\r\nnode tasks/build.js config/ol.json build/ol.js\r\ninfo ol Parsing dependencies\r\ninfo ol Compiling 356 sources\r\nuncompressed: 441523 bytes\r\n  compressed: 131841 bytes\r\n```"},"comment":{"url":"https://api.github.com/repos/openlayers/ol3/issues/comments/132571273","html_url":"https://github.com/openlayers/ol3/pull/4016#issuecomment-132571273","issue_url":"https://api.github.com/repos/openlayers/ol3/issues/4016","id":132571273,"user":{"login":"elemoine","id":76594,"avatar_url":"https://avatars.githubusercontent.com/u/76594?v=3","gravatar_id":"","url":"https://api.github.com/users/elemoine","html_url":"https://github.com/elemoine","followers_url":"https://api.github.com/users/elemoine/followers","following_url":"https://api.github.com/users/elemoine/following{/other_user}","gists_url":"https://api.github.com/users/elemoine/gists{/gist_id}","starred_url":"https://api.github.com/users/elemoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elemoine/subscriptions","organizations_url":"https://api.github.com/users/elemoine/orgs","repos_url":"https://api.github.com/users/elemoine/repos","events_url":"https://api.github.com/users/elemoine/events{/privacy}","received_events_url":"https://api.github.com/users/elemoine/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T12:20:31Z","updated_at":"2015-08-19T12:20:31Z","body":"@tschaub, are you able to have a look at this?"}}