CSSStyleSelector::canShareStyleWithElement() has gathered a fair bit of cruft, we can reorder parts of it, and avoid some bits altogether.
Created attachment 126277 [details] Proposed patch
Committed r107261: <http://trac.webkit.org/changeset/107261>
Reopening as I rolled the change out in r107279. This test started failing after the change: svg/W3C-SVG-1.1/styling-css-05-b.svg Visually, it looked like the wrong lang() selector was applied: the test assumes we apply the lang(fr) one but we were applying lang(en) after the change.
Relanded in <http://trac.webkit.org/changeset/107551> without breaking the lang() selector.