Bug 8789 - RenderStyle::getPseudoStyle() always returns 0
Summary: RenderStyle::getPseudoStyle() always returns 0
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P3 Normal
Assignee: Nobody
Depends on:
Reported: 2006-05-08 12:56 PDT by mitz
Modified: 2006-05-09 23:37 PDT (History)
0 users

See Also:

Patch (3.13 KB, patch)
2006-05-09 14:09 PDT, mitz
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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)
            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]
Comment 2 Dave Hyatt 2006-05-09 14:10:55 PDT
Comment on attachment 8189 [details]

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.