[webkit-reviews] review granted: [Bug 6248] CSS3: implement nth-* selectors (Acid3 bug) : [Attachment 18969] Latest patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 6 16:54:35 PST 2008


Eric Seidel <eric at webkit.org> has granted Dave Hyatt <hyatt at apple.com>'s
request for review:
Bug 6248: CSS3: implement nth-* selectors (Acid3 bug)
http://bugs.webkit.org/show_bug.cgi?id=6248

Attachment 18969: Latest patch
http://bugs.webkit.org/attachment.cgi?id=18969&action=edit

------- Additional Comments from Eric Seidel <eric at webkit.org>
if (n->isElementNode() && static_cast<Element*>(n)->tagName() == type)
can just be:
n->hasTagName(type)
(in a couple places)

matchNth should use the return-early style that we use throughout the rest of
WebKit:
static bool matchNth(int count, int a, int b)
{
    if (!a)
	return count == b;
    if (a > 0) {
	if (count < b)
	    return false;
	return (count - b) % a == 0;
    }
    if (count > b)
	return false;
    return (b - count) % (-a) == 0;
}

Overall this looks fine.


More information about the webkit-reviews mailing list