Commit cfb40ca2 authored by hyatt@apple.com's avatar hyatt@apple.com
Browse files

WebCore:

        Fix for bug 17254, nth-* selectors do not work with negative coefficients.

        Reviewed by Mitz.

        fast/css/negative-nth-child.html

        * css/CSSStyleSelector.cpp:
        (WebCore::parseNth):

LayoutTests:

        Added test for bug 17254.

        Reviewed by Mitz.

        * fast/css/negative-nth-child.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bce364f7
2008-02-09 David Hyatt <hyatt@apple.com>
Added test for bug 17254.
Reviewed by Mitz.
* fast/css/negative-nth-child.html: Added.
2008-02-08 Oliver Hunt <oliver@apple.com>
 
Reviewed by Maciej.
<html>
<head>
<style>
div { background-color:green; height:1em }
div:nth-child(-2n+1) { background-color:red }
div:first-child { background-color:green }
</style>
</head>
<body>
There should be only green below. If you see RED the test has failed.
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div><div></div>
<div></div>
<div></div><div></div>
<div></div>
<div></div><div></div>
<div></div>
<div></div><div></div>
<div></div>
<div></div><div></div>
<div></div>
<div></div>
d6e607be12c9529e5bf11f966f1948dc
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock (anonymous) at (0,0) size 784x18
RenderText {#text} at (0,0) size 439x18
text run at (0,0) width 224: "There should be only green below. "
text run at (224,0) width 215: "If you see RED the test has failed."
RenderBlock {DIV} at (0,18) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,34) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,50) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,66) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,82) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,98) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,114) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,130) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,146) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,162) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,178) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,194) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,210) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,226) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,242) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,258) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,274) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,290) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,306) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,322) size 784x16 [bgcolor=#008000]
RenderBlock {DIV} at (0,338) size 784x16 [bgcolor=#008000]
2008-02-09 David Hyatt <hyatt@apple.com>
Fix for bug 17254, nth-* selectors do not work with negative coefficients.
Reviewed by Mitz.
fast/css/negative-nth-child.html
* css/CSSStyleSelector.cpp:
(WebCore::parseNth):
2008-02-09 David Hyatt <hyatt@apple.com>
 
Fix for bug 17203, high CPU usage loading HTML5 spec. This patch significantly improves the performance
......@@ -733,7 +733,7 @@ static bool parseNth(const String& nth, int &a, int &b)
if (n == 1)
a = -1; // -n == -1n
else
a = nth.substring(1, n-1).toInt();
a = nth.substring(0, n).toInt();
} else if (!n)
a = 1; // n == 1n
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment