Changeset 107259 in webkit


Ignore:
Timestamp:
Feb 9, 2012 10:27:06 AM (12 years ago)
Author:
mikelawther@chromium.org
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:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107258 r107259  
     12012-02-09  Mike Lawther  <mikelawther@chromium.org>
     2
     3        CSS3 calc() - remove mod
     4        https://bugs.webkit.org/show_bug.cgi?id=78226
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/calc/simple-calcs-expected.txt:
     9        * css3/calc/simple-calcs.html:
     10
    1112012-02-09  Jochen Eisinger  <jochen@chromium.org>
    212
  • trunk/LayoutTests/css3/calc/simple-calcs-expected.txt

    r83415 r107259  
    191950px*(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
    202010px* (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
    21 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
    222150px + 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
    23 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
    2422100%/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
    2523100% + -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
     
    40382 * 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
    41392 * 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
    42 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
    4340(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
    444150px + +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
  • trunk/LayoutTests/css3/calc/simple-calcs.html

    r83415 r107259  
    3737<div class="width-test" style="width: -webkit-calc(50px*(10 / 5));">50px*(10 / 5)</div>
    3838<div class="width-test" style="width: -webkit-calc(10px* (5 * 2));">10px* (5 * 2)</div>
    39 <div class="width-test" style="width: -webkit-calc(50px* (12 mod 10));">50px* (12 mod 10)</div>
    4039<div class="width-test" style="width: -webkit-calc(50px + 10px * 5);">50px + 10px * 5 (operation order)</div>
    41 <div class="width-test" style="width: -webkit-calc(1100px mod 1000);">1100px mod 1000</div>
    4240<div style="width: 200px; background-color: white;" class="wrapper">
    4341    <div class="width-test" style="width: -webkit-calc(100%/2);">100%/2 (where 100% is 200px)</div>
     
    6765    <div class="width-test" style="width: -webkit-calc(5 * 10%);">5 * 10% (where 100% is 200px)</div>
    6866</div>
    69 <!--
    70  FIXME: what do we do with mod of percent?
    71 <div style="width: 200px; background-color: white;" class="wrapper">
    72     <div class="width-test" style="width: -webkit-calc(75% mod 100);">150% mod 100 (where 100% is 200px)</div>
    73 </div>
    74 -->
    7567<div class="width-test" style="width: -webkit-calc((100px));">(100px)</div>
    7668<div class="width-test" style="width: -webkit-calc((50px + 50px));">(50px + 50px)</div>
     
    8274<div class="width-test" style="width: -webkit-calc(2 * 50px);">2 * 50px</div>
    8375<div class="width-test" style="width: -webkit-calc(2 * 100px / 2);">2 * 100px / 2</div>
    84 <div class="width-test" style="width: -webkit-calc(12 mod 10 * 50px);">12 mod 10 * 50px</div>
    8576<div class="width-test" style="width: -webkit-calc((1em - 1em) + 100px);">(1em - 1em) + 100px</div>
    8677<div class="width-test" style="width: -webkit-calc(50px +  +50px);">50px +  +50px</div>
  • trunk/Source/WebCore/ChangeLog

    r107257 r107259  
     12012-02-09  Mike Lawther  <mikelawther@chromium.org>
     2
     3        CSS3 calc() - remove mod
     4        https://bugs.webkit.org/show_bug.cgi?id=78226
     5
     6        mod has been removed from the spec for calc().
     7
     8        Reviewed by Ojan Vafai.
     9
     10        * css/CSSCalculationValue.cpp:
     11        (WebCore::CSSCalcBinaryOperation::create):
     12        (WebCore::CSSCalcBinaryOperation::evaluate):
     13        (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
     14        * css/CSSGrammar.y:
     15        * platform/CalculationValue.h:
     16
    1172012-02-09  Pavel Feldman  <pfeldman@google.com>
    218
  • trunk/Source/WebCore/css/CSSCalculationValue.cpp

    r107030 r107259  
    159159               
    160160        case CalcDivide:
    161         case CalcMod:
    162161            if (rightCategory != CalcNumber || rightSide->isZero())
    163162                return 0;
     
    199198                return leftValue / rightValue;
    200199            return std::numeric_limits<double>::quiet_NaN();
    201         case CalcMod:
    202             // FIXME calc() : mod has been removed from the spec, need to remove
    203             // this enum value
    204             return 0;
    205200        }
    206201        return 0;
     
    297292        while (*index < tokens->size() - 1) {
    298293            char operatorCharacter = operatorValue(tokens, *index);
    299             if (operatorCharacter != CalcMultiply && operatorCharacter != CalcDivide && operatorCharacter != CalcMod)
     294            if (operatorCharacter != CalcMultiply && operatorCharacter != CalcDivide)
    300295                break;
    301296            ++*index;
  • trunk/Source/WebCore/css/CSSGrammar.y

    r103692 r107259  
    15311531        $$ = '/';
    15321532    }
    1533     | IDENT maybe_space {
    1534         if (equalIgnoringCase("mod", $1.characters, $1.length))
    1535             $$ = '%';
    1536         else
    1537             $$ = 0;
    1538     }
    15391533  ;
    15401534
  • trunk/Source/WebCore/platform/CalculationValue.h

    r106166 r107259  
    4545    CalcMultiply = '*',
    4646    CalcDivide = '/',
    47     CalcMod = '%'
    4847};
    4948
Note: See TracChangeset for help on using the changeset viewer.