Changeset 138816 in webkit


Ignore:
Timestamp:
Jan 4, 2013 11:02:51 AM (11 years ago)
Author:
mikelawther@chromium.org
Message:

CSS3 calc: mixed percent/absolute for border-radius
https://bugs.webkit.org/show_bug.cgi?id=106046

Reviewed by Ojan Vafai.

Source/WebCore:

Add the calculation evaluation to the border radius code.

Test: css3/calc/border-radius.html

  • css/StyleBuilder.cpp:

(WebCore::ApplyPropertyBorderRadius::applyValue):

LayoutTests:

  • css3/calc/border-radius-expected.html: Renamed from LayoutTests/css3/calc/border-radius-expected-mismatch.html.
  • css3/calc/border-radius.html:
Location:
trunk
Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138815 r138816  
     12013-01-04  Mike Lawther  <mikelawther@chromium.org>
     2
     3        CSS3 calc: mixed percent/absolute for border-radius
     4        https://bugs.webkit.org/show_bug.cgi?id=106046
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/calc/border-radius-expected.html: Renamed from LayoutTests/css3/calc/border-radius-expected-mismatch.html.
     9        * css3/calc/border-radius.html:
     10
    1112013-01-04  Zan Dobersek  <zandobersek@gmail.com>
    212
  • trunk/LayoutTests/css3/calc/border-radius-expected.html

    r138815 r138816  
    1515}
    1616.both {
    17     border-radius:50%;
     17    /* Note that 100% is 104px, so 25% + 25px = 51px*/
     18    border-radius:51px;
    1819}
    1920</style>
  • trunk/LayoutTests/css3/calc/border-radius.html

    r104428 r138816  
    1515}
    1616.both {
     17    /* Note that 100% is 104px, so 25% + 25px = 51px*/
    1718    border-radius:-webkit-calc(25% + 25px);
    1819}
  • trunk/Source/WebCore/ChangeLog

    r138812 r138816  
     12013-01-04  Mike Lawther  <mikelawther@chromium.org>
     2
     3        CSS3 calc: mixed percent/absolute for border-radius
     4        https://bugs.webkit.org/show_bug.cgi?id=106046
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Add the calculation evaluation to the border radius code.
     9
     10        Test: css3/calc/border-radius.html
     11
     12        * css/StyleBuilder.cpp:
     13        (WebCore::ApplyPropertyBorderRadius::applyValue):
     14
    1152013-01-04  John Mellor  <johnme@chromium.org>
    216
  • trunk/Source/WebCore/css/StyleBuilder.cpp

    r137359 r138816  
    448448        else if (pair->first()->isViewportPercentageLength())
    449449            radiusWidth = pair->first()->viewportPercentageLength();
    450         else if (pair->first()->isCalculatedPercentageWithLength()) {
    451             // FIXME calc(): http://webkit.org/b/16662
    452             // handle this case
    453             return;
    454         } else
     450        else if (pair->first()->isCalculatedPercentageWithLength())
     451            radiusWidth = Length((pair->first()->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom())));
     452        else
    455453            radiusWidth = pair->first()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
    456454        if (pair->second()->isPercentage())
     
    458456        else if (pair->second()->isViewportPercentageLength())
    459457            radiusHeight = pair->second()->viewportPercentageLength();
    460         else if (pair->second()->isCalculatedPercentageWithLength()) {
    461             // FIXME calc(): http://webkit.org/b/16662
    462             // handle this case
    463             return;
    464         } else
     458        else if (pair->second()->isCalculatedPercentageWithLength())
     459            radiusHeight = Length((pair->second()->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom())));
     460        else
    465461            radiusHeight = pair->second()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
    466462        int width = radiusWidth.value();
Note: See TracChangeset for help on using the changeset viewer.