{"action":"created","issue":{"url":"https://api.github.com/repos/shaefner-usgs/hazdev-template/issues/1","labels_url":"https://api.github.com/repos/shaefner-usgs/hazdev-template/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/shaefner-usgs/hazdev-template/issues/1/comments","events_url":"https://api.github.com/repos/shaefner-usgs/hazdev-template/issues/1/events","html_url":"https://github.com/shaefner-usgs/hazdev-template/pull/1","id":63873410,"number":1,"title":"Refactor linklist to use more efficient selectors","user":{"login":"jmfee-usgs","id":1717896,"avatar_url":"https://avatars.githubusercontent.com/u/1717896?v=3","gravatar_id":"","url":"https://api.github.com/users/jmfee-usgs","html_url":"https://github.com/jmfee-usgs","followers_url":"https://api.github.com/users/jmfee-usgs/followers","following_url":"https://api.github.com/users/jmfee-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jmfee-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jmfee-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmfee-usgs/subscriptions","organizations_url":"https://api.github.com/users/jmfee-usgs/orgs","repos_url":"https://api.github.com/users/jmfee-usgs/repos","events_url":"https://api.github.com/users/jmfee-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jmfee-usgs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-24T01:21:12Z","updated_at":"2015-03-24T22:36:06Z","closed_at":"2015-03-24T22:36:06Z","pull_request":{"url":"https://api.github.com/repos/shaefner-usgs/hazdev-template/pulls/1","html_url":"https://github.com/shaefner-usgs/hazdev-template/pull/1","diff_url":"https://github.com/shaefner-usgs/hazdev-template/pull/1.diff","patch_url":"https://github.com/shaefner-usgs/hazdev-template/pull/1.patch"},"body":"Food for thought, this implementation may be more efficient but requires additional classes in markup.  The markup supports either option, although leaves the overhead for all the generic elements which removes most of the benefit (I'd prefer to remove the element selectors altogether).  Removing element selectors places a little extra burden on authors to use the classes, but saves cpu cycles, battery, and load time for users.\r\n\r\nSelectors are evaluated right to left, so if we use element selectors like `img`, every image on the page has to check whether it is inside a list item, etc.  If we marked up a linklist like this, the browser could render it by matching only class names (also threw in other elements, which could be interchangeable):\r\n\r\n```\r\n<ul class=\"linklist\">\r\n  <li><a class=\"linklist-item\">\r\n    <strong class=\"linklist-header\">I'm a header</strong>\r\n    <img class=\"linklist-image\" src=\"image.png\"/>\r\n    <div class=\"linklist-content\">I'm content</div>\r\n  </a></li>\r\n</ul>\r\n```\r\n\r\nAn in-between might be only a class on the anchor, reusing other template classes for the ul, with direct descendant for header, image, content.  Thoughts?"},"comment":{"url":"https://api.github.com/repos/shaefner-usgs/hazdev-template/issues/comments/85720527","html_url":"https://github.com/shaefner-usgs/hazdev-template/pull/1#issuecomment-85720527","issue_url":"https://api.github.com/repos/shaefner-usgs/hazdev-template/issues/1","id":85720527,"user":{"login":"jmfee-usgs","id":1717896,"avatar_url":"https://avatars.githubusercontent.com/u/1717896?v=3","gravatar_id":"","url":"https://api.github.com/users/jmfee-usgs","html_url":"https://github.com/jmfee-usgs","followers_url":"https://api.github.com/users/jmfee-usgs/followers","following_url":"https://api.github.com/users/jmfee-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jmfee-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jmfee-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmfee-usgs/subscriptions","organizations_url":"https://api.github.com/users/jmfee-usgs/orgs","repos_url":"https://api.github.com/users/jmfee-usgs/repos","events_url":"https://api.github.com/users/jmfee-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jmfee-usgs/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T22:36:06Z","updated_at":"2015-03-24T22:36:06Z","body":"A couple notes about your test:\r\n- the performance hit affects elements everywhere on the page (heading/element/p/img), not just inside the image list.\r\n- using classes doesn't mean you can't use semantic elements like headings, it provides the option to reuse this pattern with any elements.\r\n- most of the class selector overhead compresses away with gzip.\r\n"}}