While working on bug 8760 I noticed that RenderStyle::getPseudoStyle() never breaks out of the while loop, since it tries to match styleType() instead of ps->styleType(), and therefore always returns 0, potentially causing redundant calls to createPseudoStyleForElement() and addPseudoStyle().
if (styleType() == pid)
if (ps->styleType() == pid)
doesn't work, since for things like :after and :hover:after you need to keep two pseudoStyles of the same styleType (or have a rule for deciding which one to keep). Making the trivial change regresses fast/css-generated-content/hover-style-change.html.
Created attachment 8189 [details]
Comment on attachment 8189 [details]
It looks like the render_style half of the patch was essentially checked in along with the patch for bug 8782. You still need to check in the other part in order or fast/css-generated-content/hover-style-change.html will fail.
Oops. I fixed this getPseudoStyle loop by accident when making a different change to this file, without even realizing this bug report existed. So I might have broken something. Sorry for any merge headaches.
Heh, and reading this bug I see that Mitz is way ahead of me already! I better land this right now.