Title: [102528] trunk
Revision
102528
Author
[email protected]
Date
2011-12-10 13:40:14 -0800 (Sat, 10 Dec 2011)

Log Message

CSS 2.1 failure: numerous counter-increment-* tests fail
https://bugs.webkit.org/show_bug.cgi?id=73360

Source/WebCore:

Reviewed by Julien Chaffraix.

Allow counter-increment to handle integer underflow and overflow.
Also allow 'counter' to inherit.

* css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyCounter::applyInheritValue):
(WebCore::ApplyPropertyCounter::applyValue):
(WebCore::ApplyPropertyCounter::createHandler):

LayoutTests:

WebKit dumpAsText() versions of the CSS test suite's counter-increment-001 and 002 are already present in
fast/css/counters, so add a dumpAsText version of tests 003 to 056.

Reviewed by Julien Chaffraix.

* fast/css/counters/counter-increment-inherit-expected.txt: Added.
* fast/css/counters/counter-increment-inherit.htm: Added.
* fast/css/counters/counter-increment-tests-expected.txt: Added.
* fast/css/counters/counter-increment-tests.htm: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (102527 => 102528)


--- trunk/LayoutTests/ChangeLog	2011-12-10 21:35:06 UTC (rev 102527)
+++ trunk/LayoutTests/ChangeLog	2011-12-10 21:40:14 UTC (rev 102528)
@@ -1,3 +1,18 @@
+2011-12-09  Robert Hogan  <[email protected]>
+
+        CSS 2.1 failure: numerous counter-increment-* tests fail
+        https://bugs.webkit.org/show_bug.cgi?id=73360
+
+        WebKit dumpAsText() versions of the CSS test suite's counter-increment-001 and 002 are already present in
+        fast/css/counters, so add a dumpAsText version of tests 003 to 056.
+
+        Reviewed by Julien Chaffraix.
+
+        * fast/css/counters/counter-increment-inherit-expected.txt: Added.
+        * fast/css/counters/counter-increment-inherit.htm: Added.
+        * fast/css/counters/counter-increment-tests-expected.txt: Added.
+        * fast/css/counters/counter-increment-tests.htm: Added.
+
 2011-11-09  Robert Hogan  <[email protected]>
 
         CSS 2.1 failure: outline-color-* tests fail

Added: trunk/LayoutTests/fast/css/counters/counter-increment-inherit-expected.txt (0 => 102528)


--- trunk/LayoutTests/fast/css/counters/counter-increment-inherit-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/counters/counter-increment-inherit-expected.txt	2011-12-10 21:40:14 UTC (rev 102528)
@@ -0,0 +1,7 @@
+PASS layoutTestController.counterValueForElementById('wrapper90') is '5'
+PASS layoutTestController.counterValueForElementById('test90') is '10'
+PASS layoutTestController.counterValueForElementById('test90a') is '15'
+PASS layoutTestController.counterValueForElementById('wrapper91') is '10'
+PASS layoutTestController.counterValueForElementById('test91') is '20'
+PASS layoutTestController.counterValueForElementById('test91a') is '30'
+
Property changes on: trunk/LayoutTests/fast/css/counters/counter-increment-inherit-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/counters/counter-increment-inherit.htm (0 => 102528)


--- trunk/LayoutTests/fast/css/counters/counter-increment-inherit.htm	                        (rev 0)
+++ trunk/LayoutTests/fast/css/counters/counter-increment-inherit.htm	2011-12-10 21:40:14 UTC (rev 102528)
@@ -0,0 +1,91 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+    <head>
+        <title>CSS Test: Counter-increment tests</title>
+        <link rel="author" title="Microsoft" href=""
+        <link rel="help" href=""
+        <script src=""
+        <script>
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.waitUntilDone();
+            }
+            function run()
+            {
+                // Some extra WebKit testing for counter-increment inherit
+                shouldBe("layoutTestController.counterValueForElementById('wrapper90')", "'5'");
+                shouldBe("layoutTestController.counterValueForElementById('test90')", "'10'");
+                shouldBe("layoutTestController.counterValueForElementById('test90a')", "'15'");
+                shouldBe("layoutTestController.counterValueForElementById('wrapper91')", "'10'");
+                shouldBe("layoutTestController.counterValueForElementById('test91')", "'20'");
+                shouldBe("layoutTestController.counterValueForElementById('test91a')", "'30'");
+                if (window.layoutTestController)
+                    layoutTestController.notifyDone();
+            }
+        </script>
+        <style type="text/css">
+            #wrapper90 /*test 90*/
+            {
+                counter-increment: ident90 5;
+            }
+            #wrapper90:before
+            {
+                content: counter(ident90);
+            }
+            #test90
+            {
+                counter-increment: inherit;
+            }
+            #test90:before
+            {
+                content: counter(ident90);
+            }
+            #test90a
+            {
+                counter-increment: inherit;
+            }
+            #test90a:before
+            {
+                content: counter(ident90);
+            }
+
+            #wrapper91 /*test 91*/
+            {
+                counter-increment: ident91 5 ident91 5;
+            }
+            #wrapper91:before
+            {
+                content: counter(ident91);
+            }
+            #test91
+            {
+                counter-increment: inherit;
+            }
+            #test91:before
+            {
+                content: counter(ident91);
+            }
+            #test91a
+            {
+                counter-increment: inherit;
+            }
+            #test91a:before
+            {
+                content: counter(ident91);
+            }
+
+        </style>
+    </head>
+    <body _onload_="setTimeout('run()', 0);">
+        <div id="wrapper90"> 
+            <div id="test90">
+                <div id="test90a"></div>
+            </div>
+        </div>
+        <div id="wrapper91"> 
+            <div id="test91">
+                <div id="test91a"></div>
+            </div>
+        </div>
+    </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/fast/css/counters/counter-increment-inherit.htm
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/counters/counter-increment-tests-expected.txt (0 => 102528)


--- trunk/LayoutTests/fast/css/counters/counter-increment-tests-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/counters/counter-increment-tests-expected.txt	2011-12-10 21:40:14 UTC (rev 102528)
@@ -0,0 +1,58 @@
+PASS layoutTestController.counterValueForElementById('test3') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test4') is '-2147483647'
+PASS layoutTestController.counterValueForElementById('test5') is '0'
+PASS layoutTestController.counterValueForElementById('test6') is '0'
+PASS layoutTestController.counterValueForElementById('test7') is '0'
+PASS layoutTestController.counterValueForElementById('test8') is '10'
+PASS layoutTestController.counterValueForElementById('test9') is '10'
+PASS layoutTestController.counterValueForElementById('test10') is '2147483646'
+PASS layoutTestController.counterValueForElementById('test11') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test12') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test13') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test14') is '2'
+PASS layoutTestController.counterValueForElementById('test15') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test16') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test17') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test18') is '0'
+PASS layoutTestController.counterValueForElementById('test19') is '0'
+PASS layoutTestController.counterValueForElementById('test20') is '0'
+PASS layoutTestController.counterValueForElementById('test21') is '20'
+PASS layoutTestController.counterValueForElementById('test22') is '20'
+PASS layoutTestController.counterValueForElementById('test23') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test24') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test25') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test26') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test27') is '3'
+PASS layoutTestController.counterValueForElementById('test28') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test29') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test30') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test31') is '0'
+PASS layoutTestController.counterValueForElementById('test32') is '0'
+PASS layoutTestController.counterValueForElementById('test33') is '0'
+PASS layoutTestController.counterValueForElementById('test34') is '30'
+PASS layoutTestController.counterValueForElementById('test35') is '30'
+PASS layoutTestController.counterValueForElementById('test36') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test37') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test38') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test39') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test40') is '32'
+PASS layoutTestController.counterValueForElementById('test41') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test42') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test43') is '-2147483648'
+PASS layoutTestController.counterValueForElementById('test44') is '0'
+PASS layoutTestController.counterValueForElementById('test45') is '0'
+PASS layoutTestController.counterValueForElementById('test46') is '0'
+PASS layoutTestController.counterValueForElementById('test47') is '320'
+PASS layoutTestController.counterValueForElementById('test48') is '320'
+PASS layoutTestController.counterValueForElementById('test49') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test50') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test51') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test52') is '2147483647'
+PASS layoutTestController.counterValueForElementById('test53') is '5'
+PASS layoutTestController.counterValueForElementById('none53') is '5'
+PASS layoutTestController.counterValueForElementById('test53a') is '10'
+PASS layoutTestController.counterValueForElementById('wrapper54') is '5'
+PASS layoutTestController.counterValueForElementById('test54') is '10'
+PASS layoutTestController.counterValueForElementById('test55') is '1'
+PASS layoutTestController.counterValueForElementById('test56') is '-2147483648'
+
Property changes on: trunk/LayoutTests/fast/css/counters/counter-increment-tests-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/counters/counter-increment-tests.htm (0 => 102528)


--- trunk/LayoutTests/fast/css/counters/counter-increment-tests.htm	                        (rev 0)
+++ trunk/LayoutTests/fast/css/counters/counter-increment-tests.htm	2011-12-10 21:40:14 UTC (rev 102528)
@@ -0,0 +1,603 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+    <head>
+        <title>CSS Test: Counter-increment tests</title>
+        <link rel="author" title="Microsoft" href=""
+        <link rel="help" href=""
+        <script src=""
+        <script>
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.waitUntilDone();
+            }
+            function run()
+            {
+                /* These are text versions of the counter-increment-* tests in the CSS 2.1 test suite.
+                   So 'test3' here is equivalent to counter-increment-003.htm, and so on. 
+                   WebKit dumpAsText versions of counter-increment-001 and 002 already exist in fast/css/counters */
+                shouldBe("layoutTestController.counterValueForElementById('test3')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test4')", "'-2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test5')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test6')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test7')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test8')", "'10'");
+                shouldBe("layoutTestController.counterValueForElementById('test9')", "'10'");
+                shouldBe("layoutTestController.counterValueForElementById('test10')", "'2147483646'");
+                shouldBe("layoutTestController.counterValueForElementById('test11')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test12')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test13')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test14')", "'2'");
+                shouldBe("layoutTestController.counterValueForElementById('test15')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test16')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test17')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test18')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test19')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test20')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test21')", "'20'");
+                shouldBe("layoutTestController.counterValueForElementById('test22')", "'20'");
+                shouldBe("layoutTestController.counterValueForElementById('test23')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test24')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test25')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test26')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test27')", "'3'");
+                shouldBe("layoutTestController.counterValueForElementById('test28')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test29')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test30')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test31')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test32')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test33')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test34')", "'30'");
+                shouldBe("layoutTestController.counterValueForElementById('test35')", "'30'");
+                shouldBe("layoutTestController.counterValueForElementById('test36')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test37')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test38')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test39')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test40')", "'32'");
+                shouldBe("layoutTestController.counterValueForElementById('test41')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test42')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test43')", "'-2147483648'");
+                shouldBe("layoutTestController.counterValueForElementById('test44')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test45')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test46')", "'0'");
+                shouldBe("layoutTestController.counterValueForElementById('test47')", "'320'");
+                shouldBe("layoutTestController.counterValueForElementById('test48')", "'320'");
+                shouldBe("layoutTestController.counterValueForElementById('test49')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test50')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test51')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test52')", "'2147483647'");
+                shouldBe("layoutTestController.counterValueForElementById('test53')", "'5'");
+                shouldBe("layoutTestController.counterValueForElementById('none53')", "'5'");
+                shouldBe("layoutTestController.counterValueForElementById('test53a')", "'10'");
+                shouldBe("layoutTestController.counterValueForElementById('wrapper54')", "'5'");
+                shouldBe("layoutTestController.counterValueForElementById('test54')", "'10'");
+                shouldBe("layoutTestController.counterValueForElementById('test55')", "'1'");
+                shouldBe("layoutTestController.counterValueForElementById('test56')", "'-2147483648'");
+                if (window.layoutTestController)
+                    layoutTestController.notifyDone();
+            }
+        </script>
+        <style type="text/css">
+            #test3
+            {
+                counter-increment: ident3 -2147483648;
+            }
+            #test3:before
+            {
+                content: counter(ident3);
+            }
+            #test4
+            {
+                counter-increment: ident4 -2147483647;
+            }
+            #test4:before
+            {
+                content: counter(ident4);
+            }
+            #test5
+            {
+                counter-increment: ident5 -0;
+            }
+            #test5:before
+            {
+                content: counter(ident5);
+            }
+            #test6
+            {
+                counter-increment: ident6 0;
+            }
+            #test6:before
+            {
+                content: counter(ident6);
+            }
+            #test7
+            {
+                counter-increment: ident7 +0;
+            }
+            #test7:before
+            {
+                content: counter(ident7);
+            }
+            #test8
+            {
+                counter-increment: ident8 10;
+            }
+            #test8:before
+            {
+                content: counter(ident8);
+            }
+            #test9
+            {
+                counter-increment: ident9 +10;
+            }
+            #test9:before
+            {
+                content: counter(ident9);
+            }
+            #test10
+            {
+                counter-increment: ident10 2147483646;
+            }
+            #test10:before
+            {
+                content: counter(ident10);
+            }
+            #test11
+            {
+                counter-increment: ident11 2147483647;
+            }
+            #test11:before
+            {
+                content: counter(ident11);
+            }
+            #test12
+            {
+                counter-increment: ident12 +2147483647;
+            }
+            #test12:before
+            {
+                content: counter(ident12);
+            }
+            #test13
+            {
+                counter-increment: ident13 2147483648;
+            }
+            #test13:before
+            {
+                content: counter(ident13);
+            }
+            #test14
+            {
+                counter-increment: ident14 ident14;
+            }
+            #test14:before
+            {
+                content: counter(ident14);
+            }
+            #test15
+
+            {
+                counter-increment: ident15 -2147483649 ident15 -2147483649;
+            }
+            #test15:before
+            {
+                content: counter(ident15);
+            }
+            #test16
+            {
+                counter-increment: ident16 -2147483648 ident16 -2147483648;
+            }
+            #test16:before
+            {
+                content: counter(ident16);
+            }
+            #test17
+            {
+                counter-increment: ident17 -2147483647 ident17 -2147483647;
+            }
+            #test17:before
+            {
+                content: counter(ident17);
+            }
+            #test18
+            {
+                counter-increment: ident18 -0 ident18 -0;
+            }
+            #test18:before
+            {
+                content: counter(ident18);
+            }
+            #test19
+            {
+                counter-increment: ident19 0 ident19 0;
+            }
+            #test19:before
+            {
+                content: counter(ident19);
+            }
+            #test20
+            {
+                counter-increment: ident20 +0 ident20 +0;
+            }
+            #test20:before
+            {
+                content: counter(ident20);
+            }
+            #test21
+
+            {
+                counter-increment: ident21 10 ident21 10;
+            }
+            #test21:before
+            {
+                content: counter(ident21);
+            }
+            #test22
+            {
+                counter-increment: ident22 +10 ident22 +10;
+            }
+            #test22:before
+            {
+                content: counter(ident22);
+            }
+            #test23
+            {
+                counter-increment: ident23 2147483646 ident23 2147483646;
+            }
+            #test23:before
+            {
+                content: counter(ident23);
+            }
+            #test24
+            {
+                counter-increment: ident24 2147483647 ident24 2147483647;
+            }
+            #test24:before
+            {
+                content: counter(ident24);
+            }
+            #test25
+            {
+                counter-increment: ident25 +2147483647 ident25 +2147483647;
+            }
+            #test25:before
+            {
+                content: counter(ident25);
+            }
+            #test26
+            {
+                counter-increment: ident26 2147483648 ident26 2147483648;
+            }
+            #test26:before
+            {
+                content: counter(ident26);
+            }
+            #test27
+            {
+                counter-increment: ident27 ident27 ident27;
+            }
+            #test27:before
+            {
+                content: counter(ident27);
+            }
+            #test28
+            {
+                counter-increment: ident28 -2147483649 ident28 -2147483649 ident28 -2147483649;
+            }
+            #test28:before
+            {
+                content: counter(ident28);
+            }
+            #test29
+            {
+                counter-increment: ident29 -2147483648 ident29 -2147483648 ident29 -2147483648;
+            }
+            #test29:before
+            {
+                content: counter(ident29);
+            }
+            #test30
+            {
+                counter-increment: ident30 -2147483647 ident30 -2147483647 ident30 -2147483647;
+            }
+            #test30:before
+            {
+                content: counter(ident30);
+            }
+            #test31
+            {
+                counter-increment: ident31 -0 ident31 -0 ident31 -0;
+            }
+            #test31:before
+            {
+                content: counter(ident31);
+            }
+            #test32
+            {
+                counter-increment: ident32 0 ident32 0 ident32 0;
+            }
+            #test32:before
+            {
+                content: counter(ident32);
+            }
+            #test33
+            {
+                counter-increment: ident33 +0 ident33 +0 ident33 +0;
+            }
+            #test33:before
+            {
+                content: counter(ident33);
+            }
+            #test34
+            {
+                counter-increment: ident34 10 ident34 10 ident34 10;
+            }
+            #test34:before
+            {
+                content: counter(ident34);
+            }
+            #test35
+            {
+                counter-increment: ident35 +10 ident35 +10 ident35 +10;
+            }
+            #test35:before
+            {
+                content: counter(ident35);
+            }
+            #test36
+            {
+                counter-increment: ident36 2147483646 ident36 2147483646 ident36 2147483646;
+            }
+            #test36:before
+            {
+                content: counter(ident36);
+            }
+            #test37
+            {
+                counter-increment: ident37 2147483647 ident37 2147483647 ident37 2147483647;
+            }
+            #test37:before
+            {
+                content: counter(ident37);
+            }
+            #test38
+            {
+                counter-increment: ident38 +2147483647 ident38 +2147483647 ident38 +2147483647;
+            }
+            #test38:before
+            {
+                content: counter(ident38);
+            }
+            #test39
+            {
+                counter-increment: ident39 2147483648 ident39 2147483648 ident39 2147483648;
+            }
+            #test39:before
+            {
+                content: counter(ident39);
+            }
+            #test40
+            {
+                counter-increment: ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40 ident40;
+            }
+            #test40:before
+            {
+                content: counter(ident40);
+            }
+            #test41
+            {
+                counter-increment: ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649 ident41 -2147483649;
+            }
+            #test41:before
+            {
+                content: counter(ident41);
+            }
+            #test42
+            {
+                counter-increment: ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648 ident42 -2147483648;
+            }
+            #test42:before
+            {
+                content: counter(ident42);
+            }
+            #test43
+            {
+                counter-increment: ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647 ident43 -2147483647;
+            }
+            #test43:before
+            {
+                content: counter(ident43);
+            }
+            #test44
+            {
+                counter-increment: ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0 ident44 -0;
+            }
+            #test44:before
+            {
+                content: counter(ident44);
+            }
+            #test45
+            {
+                counter-increment: ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0 ident45 0;
+            }
+            #test45:before
+            {
+                content: counter(ident45);
+            }
+            #test46
+            {
+                counter-increment: ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0 ident46 +0;
+            }
+            #test46:before
+            {
+                content: counter(ident46);
+            }
+            #test47
+            {
+                counter-increment: ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10 ident47 10;
+            }
+            #test47:before
+            {
+                content: counter(ident47);
+            }
+            #test48
+            {
+                counter-increment: ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10 ident48 +10;
+            }
+            #test48:before
+            {
+                content: counter(ident48);
+            }
+            #test49
+            {
+                counter-increment: ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646 ident49 2147483646;
+            }
+            #test49:before
+            {
+                content: counter(ident49);
+            }
+            #test50
+            {
+                counter-increment: ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647 ident50 2147483647;
+            }
+            #test50:before
+            {
+                content: counter(ident50);
+            }
+            #test51
+            {
+                counter-increment: ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647 ident51 +2147483647;
+            }
+            #test51:before
+            {
+                content: counter(ident51);
+            }
+            #test52
+            {
+                counter-increment: ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648 ident52 2147483648;
+            }
+            #test52:before
+            {
+                content: counter(ident52);
+            }
+            #test53
+            {
+                counter-increment: ident53 5;
+            }
+            #test53a
+            {
+                counter-increment: ident53 5;
+            }
+            #none53
+            {
+                counter-increment: none;
+            }
+            #none53:before
+            {
+                content: counter(ident53);
+            }
+            #test53:before
+            {
+                content: counter(ident53);
+            }
+            #test53a:before
+            {
+                content: counter(ident53);
+            }
+
+            #wrapper54 /*test 54*/
+            {
+                counter-increment: ident54 5;
+            }
+            #test54
+            {
+                counter-increment: inherit;
+            }
+            #test54:before
+            {
+                content: counter(ident54);
+            }
+            #wrapper54:before
+            {
+                content: counter(ident54);
+            }
+
+            #test55
+            {
+                counter-increment: ident55;
+            }
+            #test55:before
+            {
+                content: counter(ident55);
+            }
+            #test56
+            {
+                counter-increment: ident56 -2147483649;
+            }
+            #test56:before
+            {
+                content: counter(ident56);
+            }
+
+        </style>
+    </head>
+    <body _onload_="setTimeout('run()', 0);">
+        <div id="test3"></div>
+        <div id="test4"></div>
+        <div id="test5"></div>
+        <div id="test6"></div>
+        <div id="test7"></div>
+        <div id="test8"></div>
+        <div id="test9"></div>
+        <div id="test10"></div>
+        <div id="test11"></div>
+        <div id="test12"></div>
+        <div id="test13"></div>
+        <div id="test14"></div>
+        <div id="test15"></div>
+        <div id="test16"></div>
+        <div id="test17"></div>
+        <div id="test18"></div>
+        <div id="test19"></div>
+        <div id="test20"></div>
+        <div id="test21"></div>
+        <div id="test22"></div>
+        <div id="test23"></div>
+        <div id="test24"></div>
+        <div id="test25"></div>
+        <div id="test26"></div>
+        <div id="test27"></div>
+        <div id="test28"></div>
+        <div id="test29"></div>
+        <div id="test30"></div>
+        <div id="test31"></div>
+        <div id="test32"></div>
+        <div id="test33"></div>
+        <div id="test34"></div>
+        <div id="test35"></div>
+        <div id="test36"></div>
+        <div id="test37"></div>
+        <div id="test38"></div>
+        <div id="test39"></div>
+        <div id="test40"></div>
+        <div id="test41"></div>
+        <div id="test42"></div>
+        <div id="test43"></div>
+        <div id="test44"></div>
+        <div id="test45"></div>
+        <div id="test46"></div>
+        <div id="test47"></div>
+        <div id="test48"></div>
+        <div id="test49"></div>
+        <div id="test50"></div>
+        <div id="test51"></div>
+        <div id="test52"></div>
+        <div id="test53"></div>
+        <div id="none53"></div>
+        <div id="test53a"></div>
+        <div id="wrapper54"> 
+            <div id="test54"></div>
+        </div>
+        <div id="test55"></div>
+        <div id="test56"></div>
+    </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/fast/css/counters/counter-increment-tests.htm
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (102527 => 102528)


--- trunk/Source/WebCore/ChangeLog	2011-12-10 21:35:06 UTC (rev 102527)
+++ trunk/Source/WebCore/ChangeLog	2011-12-10 21:40:14 UTC (rev 102528)
@@ -1,3 +1,18 @@
+2011-12-09  Robert Hogan  <[email protected]>
+
+        CSS 2.1 failure: numerous counter-increment-* tests fail
+        https://bugs.webkit.org/show_bug.cgi?id=73360
+
+        Reviewed by Julien Chaffraix.
+
+        Allow counter-increment to handle integer underflow and overflow.
+        Also allow 'counter' to inherit.
+
+        * css/CSSStyleApplyProperty.cpp:
+        (WebCore::ApplyPropertyCounter::applyInheritValue):
+        (WebCore::ApplyPropertyCounter::applyValue):
+        (WebCore::ApplyPropertyCounter::createHandler):
+
 2011-12-09  Ryosuke Niwa  <[email protected]>
 
         There should be a way to count the number of nodes held by undo stack

Modified: trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp (102527 => 102528)


--- trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2011-12-10 21:35:06 UTC (rev 102527)
+++ trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2011-12-10 21:40:14 UTC (rev 102528)
@@ -720,6 +720,33 @@
 class ApplyPropertyCounter {
 public:
     static void emptyFunction(CSSStyleSelector*) { }
+    static void applyInheritValue(CSSStyleSelector* selector)
+    {
+        CounterDirectiveMap& map = selector->style()->accessCounterDirectives();
+        CounterDirectiveMap& parentMap = selector->parentStyle()->accessCounterDirectives();
+
+        typedef CounterDirectiveMap::iterator Iterator;
+        Iterator end = parentMap.end();
+        for (Iterator it = parentMap.begin(); it != end; ++it) {
+            CounterDirectives& directives = map.add(it->first, CounterDirectives()).first->second;
+            if (counterBehavior == Reset) {
+                directives.m_reset = it->second.m_reset;
+                directives.m_resetValue = it->second.m_resetValue;
+            } else {
+                // Inheriting a counter-increment means taking the parent's current value for the counter
+                // and adding it to itself.
+                directives.m_increment = it->second.m_increment;
+                directives.m_incrementValue = 0;
+                if (directives.m_increment) {
+                    float incrementValue = directives.m_incrementValue;
+                    directives.m_incrementValue = clampToInteger(incrementValue + it->second.m_incrementValue);
+                } else {
+                    directives.m_increment = true;
+                    directives.m_incrementValue = it->second.m_incrementValue;
+                }
+            }
+        }
+    }
     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
     {
         if (!value->isValueList())
@@ -732,7 +759,7 @@
 
         Iterator end = map.end();
         for (Iterator it = map.begin(); it != end; ++it)
-            if (counterBehavior)
+            if (counterBehavior == Reset)
                 it->second.m_reset = false;
             else
                 it->second.m_increment = false;
@@ -748,23 +775,24 @@
                 continue;
 
             AtomicString identifier = static_cast<CSSPrimitiveValue*>(pair->first())->getStringValue();
-            // FIXME: What about overflow?
             int value = static_cast<CSSPrimitiveValue*>(pair->second())->getIntValue();
             CounterDirectives& directives = map.add(identifier.impl(), CounterDirectives()).first->second;
-            if (counterBehavior) {
+            if (counterBehavior == Reset) {
                 directives.m_reset = true;
                 directives.m_resetValue = value;
             } else {
-                if (directives.m_increment)
-                    directives.m_incrementValue += value;
-                else {
+                if (directives.m_increment) {
+                    float incrementValue = directives.m_incrementValue;
+                    directives.m_incrementValue = clampToInteger(incrementValue + value);
+                } else {
                     directives.m_increment = true;
                     directives.m_incrementValue = value;
                 }
             }
+            
         }
     }
-    static PropertyHandler createHandler() { return PropertyHandler(&emptyFunction, &emptyFunction, &applyValue); }
+    static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &emptyFunction, &applyValue); }
 };
 
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to