{"action":"created","issue":{"url":"https://api.github.com/repos/servo/rust-selectors/issues/78","repository_url":"https://api.github.com/repos/servo/rust-selectors","labels_url":"https://api.github.com/repos/servo/rust-selectors/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/servo/rust-selectors/issues/78/comments","events_url":"https://api.github.com/repos/servo/rust-selectors/issues/78/events","html_url":"https://github.com/servo/rust-selectors/pull/78","id":146558557,"number":78,"title":"Remove support for style-affecting attributes.","user":{"login":"Ms2ger","id":111161,"avatar_url":"https://avatars.githubusercontent.com/u/111161?v=3","gravatar_id":"","url":"https://api.github.com/users/Ms2ger","html_url":"https://github.com/Ms2ger","followers_url":"https://api.github.com/users/Ms2ger/followers","following_url":"https://api.github.com/users/Ms2ger/following{/other_user}","gists_url":"https://api.github.com/users/Ms2ger/gists{/gist_id}","starred_url":"https://api.github.com/users/Ms2ger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ms2ger/subscriptions","organizations_url":"https://api.github.com/users/Ms2ger/orgs","repos_url":"https://api.github.com/users/Ms2ger/repos","events_url":"https://api.github.com/users/Ms2ger/events{/privacy}","received_events_url":"https://api.github.com/users/Ms2ger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-07T09:22:19Z","updated_at":"2016-04-13T00:32:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/servo/rust-selectors/pulls/78","html_url":"https://github.com/servo/rust-selectors/pull/78","diff_url":"https://github.com/servo/rust-selectors/pull/78.diff","patch_url":"https://github.com/servo/rust-selectors/pull/78.patch"},"body":"Most of the presentational attributes supported in Servo are not in either of\r\nthose lists, apparently with no negative effect.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/servo/rust-selectors/78)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/servo/rust-selectors/issues/comments/209164897","html_url":"https://github.com/servo/rust-selectors/pull/78#issuecomment-209164897","issue_url":"https://api.github.com/repos/servo/rust-selectors/issues/78","id":209164897,"user":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T00:32:45Z","updated_at":"2016-04-13T00:32:45Z","body":"Style sharing is the single most important restyling optimization that Servo does.\r\n\r\nWe maintain an LRU cache of the cascading results for the last few DOM nodes that each thread saw. For each node we go to restyle and for each entry in that cache, if we can quickly prove that the node we're looking at has the same style as the node associated with that entry, we skip matching and cascading for that node and simply share the style by bumping the reference count. This quick check is done by checking to make sure the nodes share the same parent style and that the IDs, classes, tag names, and a subset of attributes are identical.\r\n\r\nNow IDs, classes, tag names, and that subset of attributes are not necessarily enough to prove that two nodes must have the same style, because CSS selectors describe a very rich language. Therefore, we keep a flag (`shareable`) around when matching selectors. It starts off as true. If any \"unusual\" case happens—sibling selectors matched, for instance, or an attribute outside of that subset matched—then we set `shareable` to false and never insert the node into the LRU cache. The effect of this is that \"unusual\" cases exact a high performance penalty. For this reason it's quite important to make sure that the attribute subset includes all the attributes for common elements in the UA stylesheet, since the UA stylesheet rules always apply and could effectively disable the style sharing optimizations for most DOMs if this is not done."}}