Bug 8789

Summary: RenderStyle::getPseudoStyle() always returns 0
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P3    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch hyatt: review+

Description mitz 2006-05-08 12:56:49 PDT
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().

Unfortunately, canging
            if (styleType() == pid)
to
            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.
Comment 1 mitz 2006-05-09 14:09:16 PDT
Created attachment 8189 [details]
Patch
Comment 2 Dave Hyatt 2006-05-09 14:10:55 PDT
Comment on attachment 8189 [details]
Patch

r=me
Comment 3 mitz 2006-05-09 22:26:33 PDT
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.
Comment 4 Darin Adler 2006-05-09 23:35:38 PDT
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.