Title: [107259] trunk
Revision
107259
Author
[email protected]
Date
2012-02-09 10:27:06 -0800 (Thu, 09 Feb 2012)

Log Message

CSS3 calc() - remove mod
https://bugs.webkit.org/show_bug.cgi?id=78226

Source/WebCore:

mod has been removed from the spec for calc().

Reviewed by Ojan Vafai.

* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcBinaryOperation::create):
(WebCore::CSSCalcBinaryOperation::evaluate):
(WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
* css/CSSGrammar.y:
* platform/CalculationValue.h:

LayoutTests:

Reviewed by Ojan Vafai.

* css3/calc/simple-calcs-expected.txt:
* css3/calc/simple-calcs.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (107258 => 107259)


--- trunk/LayoutTests/ChangeLog	2012-02-09 17:42:25 UTC (rev 107258)
+++ trunk/LayoutTests/ChangeLog	2012-02-09 18:27:06 UTC (rev 107259)
@@ -1,3 +1,13 @@
+2012-02-09  Mike Lawther  <[email protected]>
+
+        CSS3 calc() - remove mod
+        https://bugs.webkit.org/show_bug.cgi?id=78226
+
+        Reviewed by Ojan Vafai.
+
+        * css3/calc/simple-calcs-expected.txt:
+        * css3/calc/simple-calcs.html:
+
 2012-02-09  Jochen Eisinger  <[email protected]>
 
         Add missing file for fast/events/scroll-event-during-modal-dialog.html

Modified: trunk/LayoutTests/css3/calc/simple-calcs-expected.txt (107258 => 107259)


--- trunk/LayoutTests/css3/calc/simple-calcs-expected.txt	2012-02-09 17:42:25 UTC (rev 107258)
+++ trunk/LayoutTests/css3/calc/simple-calcs-expected.txt	2012-02-09 18:27:06 UTC (rev 107259)
@@ -18,9 +18,7 @@
 50px*(12 - 10) => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 50px*(10 / 5) => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 10px* (5 * 2) => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
-50px* (12 mod 10) => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 50px + 10px * 5 (operation order) => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
-1100px mod 1000 => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 100%/2 (where 100% is 200px) => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 100% + -100px (where 100% is 200px) => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 80% - 60px (where 100% is 200px) => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
@@ -39,7 +37,6 @@
 (25px + 25px) * 2 => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 2 * 50px => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 2 * 100px / 2 => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
-12 mod 10 * 50px => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 (1em - 1em) + 100px => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 50px + +50px => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256
 -50px + 150px => FAIL: @zoom=1 expected width of 100, but was 256; @zoom=1.2 expected width of 100, but was 256; @zoom=2 expected width of 100, but was 256

Modified: trunk/LayoutTests/css3/calc/simple-calcs.html (107258 => 107259)


--- trunk/LayoutTests/css3/calc/simple-calcs.html	2012-02-09 17:42:25 UTC (rev 107258)
+++ trunk/LayoutTests/css3/calc/simple-calcs.html	2012-02-09 18:27:06 UTC (rev 107259)
@@ -36,9 +36,7 @@
 <div class="width-test" style="width: -webkit-calc(50px*(12 - 10));">50px*(12 - 10)</div>
 <div class="width-test" style="width: -webkit-calc(50px*(10 / 5));">50px*(10 / 5)</div>
 <div class="width-test" style="width: -webkit-calc(10px* (5 * 2));">10px* (5 * 2)</div>
-<div class="width-test" style="width: -webkit-calc(50px* (12 mod 10));">50px* (12 mod 10)</div>
 <div class="width-test" style="width: -webkit-calc(50px + 10px * 5);">50px + 10px * 5 (operation order)</div>
-<div class="width-test" style="width: -webkit-calc(1100px mod 1000);">1100px mod 1000</div>
 <div style="width: 200px; background-color: white;" class="wrapper">
     <div class="width-test" style="width: -webkit-calc(100%/2);">100%/2 (where 100% is 200px)</div>
 </div>
@@ -66,12 +64,6 @@
 <div style="width: 200px; background-color: white;" class="wrapper">
     <div class="width-test" style="width: -webkit-calc(5 * 10%);">5 * 10% (where 100% is 200px)</div>
 </div>
-<!--
- FIXME: what do we do with mod of percent?
-<div style="width: 200px; background-color: white;" class="wrapper">
-    <div class="width-test" style="width: -webkit-calc(75% mod 100);">150% mod 100 (where 100% is 200px)</div>
-</div>
--->
 <div class="width-test" style="width: -webkit-calc((100px));">(100px)</div>
 <div class="width-test" style="width: -webkit-calc((50px + 50px));">(50px + 50px)</div>
 <div class="width-test" style="width: -webkit-calc((50px) + 50px);">(50px) + 50px</div>
@@ -81,7 +73,6 @@
 <div class="width-test" style="width: -webkit-calc( (25px + 25px) * 2 );"> (25px + 25px) * 2 </div>
 <div class="width-test" style="width: -webkit-calc(2 * 50px);">2 * 50px</div>
 <div class="width-test" style="width: -webkit-calc(2 * 100px / 2);">2 * 100px / 2</div>
-<div class="width-test" style="width: -webkit-calc(12 mod 10 * 50px);">12 mod 10 * 50px</div>
 <div class="width-test" style="width: -webkit-calc((1em - 1em) + 100px);">(1em - 1em) + 100px</div>
 <div class="width-test" style="width: -webkit-calc(50px +  +50px);">50px +  +50px</div>
 <div class="width-test" style="width: -webkit-calc(-50px + 150px);">-50px + 150px</div>

Modified: trunk/Source/WebCore/ChangeLog (107258 => 107259)


--- trunk/Source/WebCore/ChangeLog	2012-02-09 17:42:25 UTC (rev 107258)
+++ trunk/Source/WebCore/ChangeLog	2012-02-09 18:27:06 UTC (rev 107259)
@@ -1,3 +1,19 @@
+2012-02-09  Mike Lawther  <[email protected]>
+
+        CSS3 calc() - remove mod
+        https://bugs.webkit.org/show_bug.cgi?id=78226
+
+        mod has been removed from the spec for calc().
+
+        Reviewed by Ojan Vafai.
+
+        * css/CSSCalculationValue.cpp:
+        (WebCore::CSSCalcBinaryOperation::create):
+        (WebCore::CSSCalcBinaryOperation::evaluate):
+        (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
+        * css/CSSGrammar.y:
+        * platform/CalculationValue.h:
+
 2012-02-09  Pavel Feldman  <[email protected]>
 
         Web Inspector: rename DOMEditor to DOMPatchSupport, move undoable actions from

Modified: trunk/Source/WebCore/css/CSSCalculationValue.cpp (107258 => 107259)


--- trunk/Source/WebCore/css/CSSCalculationValue.cpp	2012-02-09 17:42:25 UTC (rev 107258)
+++ trunk/Source/WebCore/css/CSSCalculationValue.cpp	2012-02-09 18:27:06 UTC (rev 107259)
@@ -158,7 +158,6 @@
             break;
                 
         case CalcDivide:
-        case CalcMod:
             if (rightCategory != CalcNumber || rightSide->isZero())
                 return 0;
             newCategory = leftCategory;
@@ -198,10 +197,6 @@
             if (rightValue)
                 return leftValue / rightValue;
             return std::numeric_limits<double>::quiet_NaN();
-        case CalcMod:
-            // FIXME calc() : mod has been removed from the spec, need to remove
-            // this enum value
-            return 0;
         }
         return 0;
     }
@@ -296,7 +291,7 @@
 
         while (*index < tokens->size() - 1) {
             char operatorCharacter = operatorValue(tokens, *index);
-            if (operatorCharacter != CalcMultiply && operatorCharacter != CalcDivide && operatorCharacter != CalcMod)
+            if (operatorCharacter != CalcMultiply && operatorCharacter != CalcDivide)
                 break;
             ++*index;
 

Modified: trunk/Source/WebCore/css/CSSGrammar.y (107258 => 107259)


--- trunk/Source/WebCore/css/CSSGrammar.y	2012-02-09 17:42:25 UTC (rev 107258)
+++ trunk/Source/WebCore/css/CSSGrammar.y	2012-02-09 18:27:06 UTC (rev 107259)
@@ -1530,12 +1530,6 @@
     | '/' maybe_space {
         $$ = '/';
     }
-    | IDENT maybe_space {
-        if (equalIgnoringCase("mod", $1.characters, $1.length))
-            $$ = '%';
-        else
-            $$ = 0;
-    }
   ;
 
 calc_func_paren_expr:

Modified: trunk/Source/WebCore/platform/CalculationValue.h (107258 => 107259)


--- trunk/Source/WebCore/platform/CalculationValue.h	2012-02-09 17:42:25 UTC (rev 107258)
+++ trunk/Source/WebCore/platform/CalculationValue.h	2012-02-09 18:27:06 UTC (rev 107259)
@@ -44,7 +44,6 @@
     CalcSubtract = '-',
     CalcMultiply = '*',
     CalcDivide = '/',
-    CalcMod = '%'
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to