Changeset 167132 in webkit


Ignore:
Timestamp:
Apr 11, 2014 10:09:19 AM (10 years ago)
Author:
betravis@adobe.com
Message:

[CSS Shapes] inset args and radial args should serialize to the simplest form
https://bugs.webkit.org/show_bug.cgi?id=129825

Reviewed by Dirk Schulze.

Source/WebCore:

Modify inset serialization to omit components where possible. The insets simplify
according to the margin shorthand, while the corner radii simplify according to
the border-radius shorthand.

Modifying existing parsing tests.

  • css/CSSBasicShapes.cpp:

(WebCore::buildInsetRadii): Add the necessary radii, omitting components where possible.
(WebCore::buildInsetString): Omit components where possible.

LayoutTests:

Modify tests to use the shortened inset serialization.

  • animations/resources/animation-test-helpers.js: Accept shortened inset forms.
  • css3/masking/clip-path-animation-expected.txt:
  • css3/masking/clip-path-animation.html:
  • fast/masking/parsing-clip-path-shape-expected.txt:
  • fast/masking/parsing-clip-path-shape.html:
  • fast/shapes/parsing/parsing-shape-lengths-expected.txt:
  • fast/shapes/parsing/parsing-shape-lengths.html:
  • fast/shapes/parsing/parsing-shape-outside-expected.txt:
  • fast/shapes/parsing/parsing-test-utils.js:
  • fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt:
  • fast/shapes/shape-outside-floats/shape-outside-animation.html:
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167131 r167132  
     12014-04-11  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Shapes] inset args and radial args should serialize to the simplest form
     4        https://bugs.webkit.org/show_bug.cgi?id=129825
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Modify tests to use the shortened inset serialization.
     9
     10        * animations/resources/animation-test-helpers.js: Accept shortened inset forms.
     11        * css3/masking/clip-path-animation-expected.txt:
     12        * css3/masking/clip-path-animation.html:
     13        * fast/masking/parsing-clip-path-shape-expected.txt:
     14        * fast/masking/parsing-clip-path-shape.html:
     15        * fast/shapes/parsing/parsing-shape-lengths-expected.txt:
     16        * fast/shapes/parsing/parsing-shape-lengths.html:
     17        * fast/shapes/parsing/parsing-shape-outside-expected.txt:
     18        * fast/shapes/parsing/parsing-test-utils.js:
     19        * fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt:
     20        * fast/shapes/shape-outside-floats/shape-outside-animation.html:
     21
    1222014-04-11  Praveen R Jadhav  <praveen.j@samsung.com>
    223
  • trunk/LayoutTests/animations/resources/animation-test-helpers.js

    r165638 r167132  
    183183    switch (shapeFunction[1]) {
    184184    case "inset":
    185         matches = s.match("inset\\((.*)\\s+(.*)\\s+(.*)\\s+(.*)\\s+round\\s+(.*)\\s+(.*)\\s+(.*)\\s+(.*)\\s+/\\s+(.*)\\s+(.*)\\s+(.*)\\s+(.*)\\)");
     185        matches = s.match("inset\\(\\s*(.*)\\s*\\)");
     186        matches = matches[1].split(/\s+/);
     187        matches.unshift(s);
    186188        break;
    187189    case "circle":
  • trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt

    r165638 r167132  
    11   
    2 PASS - "webkitClipPath" property for "inset-box" element at 1s saw something close to: inset(10% 10% 10% 10% round 0px 0px 0px 0px / 0px 0px 0px 0px)
     2PASS - "webkitClipPath" property for "inset-box" element at 1s saw something close to: inset(10%)
    33PASS - "webkitClipPath" property for "circle-box" element at 1s saw something close to: circle(35% at 35% 35%)
    44PASS - "webkitClipPath" property for "ellipse-box" element at 1s saw something close to: ellipse(35% 30% at 35% 35%)
  • trunk/LayoutTests/css3/masking/clip-path-animation.html

    r165638 r167132  
    6363    const expectedValues = [
    6464      // [animation-name, time, element-id, property, expected-value, tolerance]
    65       ["inset-anim",  1, "inset-box", "webkitClipPath", "inset(10% 10% 10% 10% round 0px 0px 0px 0px / 0px 0px 0px 0px)", 0.05],
     65      ["inset-anim",  1, "inset-box", "webkitClipPath", "inset(10%)", 0.05],
    6666      ["circle-anim",  1, "circle-box", "webkitClipPath", "circle(35% at 35% 35%)", 0.05],
    6767      ["ellipse-anim",  1, "ellipse-box", "webkitClipPath", "ellipse(35% 30% at 35% 35%)", 0.05],
  • trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt

    r165638 r167132  
    2222PASS computedStyle("-webkit-clip-path", "circle(1.5vmin at .5vmin 1vmin)") is "circle(1.5vmin at 0.5vmin 1vmin)"
    2323PASS computedStyle("-webkit-clip-path", "circle(150% at 50% 100%)") is "circle(150% at 50% 100%)"
    24 PASS computedStyle("-webkit-clip-path", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)"
     24PASS computedStyle("-webkit-clip-path", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10%)"
    2525PASS computedStyle("-webkit-clip-path", "ellipse(100% 100% at 100% 100%)") is "ellipse(100% 100% at 100% 100%)"
    2626PASS computedStyle("-webkit-clip-path", "polygon(10% 20%, 30% 40%, 40% 50%)") is "polygon(10% 20%, 30% 40%, 40% 50%)"
  • trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html

    r165638 r167132  
    7070// percentage lengths - units
    7171testComputed("-webkit-clip-path", "circle(150% at 50% 100%)", "circle(150% at 50% 100%)");
    72 testComputed("-webkit-clip-path", "inset(45% 45% 90% 60% round 25% 10%)", "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)");
     72testComputed("-webkit-clip-path", "inset(45% 45% 90% 60% round 25% 10%)", "inset(45% 45% 90% 60% round 25% 10%)");
    7373testComputed("-webkit-clip-path", "ellipse(100% 100% at 100% 100%)", "ellipse(100% 100% at 100% 100%)");
    7474testComputed("-webkit-clip-path", "polygon(10% 20%, 30% 40%, 40% 50%)", "polygon(10% 20%, 30% 40%, 40% 50%)");
  • trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths-expected.txt

    r166301 r167132  
    88PASS getStyleValue("-webkit-shape-outside", "circle(1.5px at -1.5px +1.5px)") is "circle(1.5px at -1.5px 1.5px)"
    99PASS getStyleValue("-webkit-shape-outside", "circle(.5px at -.5px +.5px)") is "circle(0.5px at -0.5px 0.5px)"
    10 PASS getStyleValue("-webkit-shape-outside", "inset(1cm 1mm 1in 1px round 1pt 1pc)") is "inset(1cm 1mm 1in 1px round 1pt 1pc 1pt 1pc / 1pt 1pc 1pt 1pc)"
    11 PASS getStyleValue("-webkit-shape-outside", "inset(-1px 1px 1px 1px round 1px 1px 1px 1px)") is "inset(-1px 1px 1px 1px round 1px 1px 1px 1px / 1px 1px 1px 1px)"
    12 PASS getStyleValue("-webkit-shape-outside", "inset(1px -1px 1px 1px round 1px 1px 1px 1px)") is "inset(1px -1px 1px 1px round 1px 1px 1px 1px / 1px 1px 1px 1px)"
    13 PASS getStyleValue("-webkit-shape-outside", "inset(1px 1px -1px 1px round 1px 1px 1px 1px)") is "inset(1px 1px -1px 1px round 1px 1px 1px 1px / 1px 1px 1px 1px)"
    14 PASS getStyleValue("-webkit-shape-outside", "inset(1px 1px 1px -1px round 1px 1px 1px 1px)") is "inset(1px 1px 1px -1px round 1px 1px 1px 1px / 1px 1px 1px 1px)"
     10PASS getStyleValue("-webkit-shape-outside", "inset(1cm 1mm 1in 1px round 1pt 1pc)") is "inset(1cm 1mm 1in 1px round 1pt 1pc)"
     11PASS getStyleValue("-webkit-shape-outside", "inset(-1px 1px 1px 1px round 1px 1px 1px 1px)") is "inset(-1px 1px 1px round 1px)"
     12PASS getStyleValue("-webkit-shape-outside", "inset(1px -1px 1px 1px round 1px 1px 1px 1px)") is "inset(1px -1px 1px 1px round 1px)"
     13PASS getStyleValue("-webkit-shape-outside", "inset(1px 1px -1px 1px round 1px 1px 1px 1px)") is "inset(1px 1px -1px round 1px)"
     14PASS getStyleValue("-webkit-shape-outside", "inset(1px 1px 1px -1px round 1px 1px 1px 1px)") is "inset(1px 1px 1px -1px round 1px)"
    1515PASS getStyleValue("-webkit-shape-outside", "circle(1em at -1em +1em)") is "circle(1em at -1em 1em)"
    1616PASS getStyleValue("-webkit-shape-outside", "circle(1.5em at -1.5em +1.5em)") is "circle(1.5em at -1.5em 1.5em)"
     
    2727PASS getComputedStyleValue("-webkit-shape-outside", "circle(1.5vmin at .5vmin 1vmin)") is "circle(1.5vmin at 0.5vmin 1vmin)"
    2828PASS getStyleValue("-webkit-shape-outside", "circle(100% at 100% 100%)") is "circle(100% at 100% 100%)"
    29 PASS getStyleValue("-webkit-shape-outside", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)"
     29PASS getStyleValue("-webkit-shape-outside", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10%)"
    3030PASS getStyleValue("-webkit-shape-outside", "ellipse(100% 100% at 100% 100%)") is "ellipse(100% 100% at 100% 100%)"
    3131PASS getStyleValue("-webkit-shape-outside", "polygon(10% 20%, 30% 40%, 40% 50%)") is "polygon(10% 20%, 30% 40%, 40% 50%)"
    3232PASS getComputedStyleValue("-webkit-shape-outside", "circle(150% at 50% 100%)") is "circle(150% at 50% 100%)"
    33 PASS getComputedStyleValue("-webkit-shape-outside", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)"
     33PASS getComputedStyleValue("-webkit-shape-outside", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10%)"
    3434PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(100% 100% at 100% 100%)") is "ellipse(100% 100% at 100% 100%)"
    3535PASS getComputedStyleValue("-webkit-shape-outside", "polygon(10% 20%, 30% 40%, 40% 50%)") is "polygon(10% 20%, 30% 40%, 40% 50%)"
  • trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths.html

    r166301 r167132  
    4242testStyleValue("circle(.5px at -.5px +.5px)", "circle(0.5px at -0.5px 0.5px)");
    4343
    44 testStyleValue("inset(1cm 1mm 1in 1px round 1pt 1pc)", "inset(1cm 1mm 1in 1px round 1pt 1pc 1pt 1pc / 1pt 1pc 1pt 1pc)");
    45 testStyleValue("inset(-1px 1px 1px 1px round 1px 1px 1px 1px)", "inset(-1px 1px 1px 1px round 1px 1px 1px 1px / 1px 1px 1px 1px)");
    46 testStyleValue("inset(1px -1px 1px 1px round 1px 1px 1px 1px)", "inset(1px -1px 1px 1px round 1px 1px 1px 1px / 1px 1px 1px 1px)");
    47 testStyleValue("inset(1px 1px -1px 1px round 1px 1px 1px 1px)", "inset(1px 1px -1px 1px round 1px 1px 1px 1px / 1px 1px 1px 1px)");
    48 testStyleValue("inset(1px 1px 1px -1px round 1px 1px 1px 1px)", "inset(1px 1px 1px -1px round 1px 1px 1px 1px / 1px 1px 1px 1px)");
     44testStyleValue("inset(1cm 1mm 1in 1px round 1pt 1pc)", "inset(1cm 1mm 1in 1px round 1pt 1pc)");
     45testStyleValue("inset(-1px 1px 1px 1px round 1px 1px 1px 1px)", "inset(-1px 1px 1px round 1px)");
     46testStyleValue("inset(1px -1px 1px 1px round 1px 1px 1px 1px)", "inset(1px -1px 1px 1px round 1px)");
     47testStyleValue("inset(1px 1px -1px 1px round 1px 1px 1px 1px)", "inset(1px 1px -1px round 1px)");
     48testStyleValue("inset(1px 1px 1px -1px round 1px 1px 1px 1px)", "inset(1px 1px 1px -1px round 1px)");
    4949
    5050// font-relative lengths - number serialization, units, resolution
     
    7171// percentage lengths - units
    7272testStyleValue("circle(100% at 100% 100%)", "circle(100% at 100% 100%)");
    73 testStyleValue("inset(45% 45% 90% 60% round 25% 10%)", "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)");
     73testStyleValue("inset(45% 45% 90% 60% round 25% 10%)", "inset(45% 45% 90% 60% round 25% 10%)");
    7474testStyleValue("ellipse(100% 100% at 100% 100%)", "ellipse(100% 100% at 100% 100%)");
    7575testStyleValue("polygon(10% 20%, 30% 40%, 40% 50%)", "polygon(10% 20%, 30% 40%, 40% 50%)");
    7676
    7777testComputedStyleValue("circle(150% at 50% 100%)", "circle(150% at 50% 100%)");
    78 testComputedStyleValue("inset(45% 45% 90% 60% round 25% 10%)", "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)");
     78testComputedStyleValue("inset(45% 45% 90% 60% round 25% 10%)", "inset(45% 45% 90% 60% round 25% 10%)");
    7979testComputedStyleValue("ellipse(100% 100% at 100% 100%)", "ellipse(100% 100% at 100% 100%)");
    8080testComputedStyleValue("polygon(10% 20%, 30% 40%, 40% 50%)", "polygon(10% 20%, 30% 40%, 40% 50%)");
  • trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt

    r166894 r167132  
    66PASS getCSSText("-webkit-shape-outside", "none") is "none"
    77PASS getComputedStyleValue("-webkit-shape-outside", "none") is "none"
    8 PASS getCSSText("-webkit-shape-outside", "inset(10px)") is "inset(10px 10px 10px 10px)"
    9 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px)") is "inset(10px 10px 10px 10px round 0px 0px 0px 0px / 0px 0px 0px 0px)"
    10 PASS getCSSText("-webkit-shape-outside", "inset(10px 9px)") is "inset(10px 9px 10px 9px)"
    11 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 9px)") is "inset(10px 9px 10px 9px round 0px 0px 0px 0px / 0px 0px 0px 0px)"
    12 PASS getCSSText("-webkit-shape-outside", "inset(10px 9px 8px)") is "inset(10px 9px 8px 9px)"
    13 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 9px 8px)") is "inset(10px 9px 8px 9px round 0px 0px 0px 0px / 0px 0px 0px 0px)"
     8PASS getCSSText("-webkit-shape-outside", "inset(10px)") is "inset(10px)"
     9PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px)") is "inset(10px)"
     10PASS getCSSText("-webkit-shape-outside", "inset(10px 9px)") is "inset(10px 9px)"
     11PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 9px)") is "inset(10px 9px)"
     12PASS getCSSText("-webkit-shape-outside", "inset(10px 9px 8px)") is "inset(10px 9px 8px)"
     13PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 9px 8px)") is "inset(10px 9px 8px)"
    1414PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 40px)") is "inset(10px 20px 30px 40px)"
    15 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px)") is "inset(10px 20px 30px 40px round 0px 0px 0px 0px / 0px 0px 0px 0px)"
    16 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 9px 9px 9px 9px)"
    17 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 9px 9px 9px 9px)"
    18 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 9px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 9px 9px 9px 9px)"
    19 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 9px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 9px 9px 9px 9px)"
    20 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 8px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 8px 8px 8px)"
    21 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 8px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 8px 8px 8px)"
    22 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 8px 7px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 8px 7px)"
    23 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 8px 7px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 8px 7px)"
    24 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 8px 7px 6px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 6px 7px)"
    25 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 8px 7px 6px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 6px 7px)"
    26 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 8px 7px 6px 5px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 6px 5px)"
    27 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 8px 7px 6px 5px)") is "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 6px 5px)"
    28 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 7px 7px 7px)"
    29 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 7px 7px 7px)"
    30 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 7px 6px)"
    31 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 7px 6px)"
    32 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 7px 6px)"
    33 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 7px 6px)"
    34 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px 5px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 5px 6px)"
    35 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px 5px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 5px 6px)"
    36 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px 5px 4px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 5px 4px)"
    37 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px 5px 4px)") is "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 5px 4px)"
    38 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 6px 6px 6px)"
    39 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 6px 6px 6px)"
    40 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 6px 5px)"
    41 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 6px 5px)"
    42 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px 4px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 4px 5px)"
    43 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px 4px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 4px 5px)"
    44 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px 4px 3px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 4px 3px)"
    45 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px 4px 3px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 4px 3px)"
    46 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 5px 5px 5px)"
    47 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 5px 5px 5px)"
    48 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 5px 4px)"
    49 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 5px 4px)"
    50 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px 3px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 3px 4px)"
    51 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px 3px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 3px 4px)"
    52 PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px 3px 2px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 3px 2px)"
    53 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px 3px 2px)") is "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 3px 2px)"
    54 PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px)") is "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)"
    55 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px)") is "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)"
     15PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px)") is "inset(10px 20px 30px 40px)"
     16PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 20px)") is "inset(10px 20px 30px)"
     17PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 20px)") is "inset(10px 20px 30px)"
     18PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 10px 20px)") is "inset(10px 20px)"
     19PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 10px 20px)") is "inset(10px 20px)"
     20PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px)") is "inset(10px round 9px)"
     21PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px)") is "inset(10px round 9px)"
     22PASS getCSSText("-webkit-shape-outside", "inset(10px round 0px / 0px 10px)") is "inset(10px round 0px / 0px 10px)"
     23PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 0px / 0px 10px)") is "inset(10px round 0px / 0px 10px)"
     24PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 9px)") is "inset(10px round 9px)"
     25PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 9px)") is "inset(10px round 9px)"
     26PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 8px)") is "inset(10px round 9px / 8px)"
     27PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 8px)") is "inset(10px round 9px / 8px)"
     28PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 8px 7px)") is "inset(10px round 9px / 8px 7px)"
     29PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 8px 7px)") is "inset(10px round 9px / 8px 7px)"
     30PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 8px 7px 6px)") is "inset(10px round 9px / 8px 7px 6px)"
     31PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 8px 7px 6px)") is "inset(10px round 9px / 8px 7px 6px)"
     32PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px / 8px 7px 6px 5px)") is "inset(10px round 9px / 8px 7px 6px 5px)"
     33PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px / 8px 7px 6px 5px)") is "inset(10px round 9px / 8px 7px 6px 5px)"
     34PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px)") is "inset(10px round 9px 8px / 7px)"
     35PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px)") is "inset(10px round 9px 8px / 7px)"
     36PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px)") is "inset(10px round 9px 8px / 7px 6px)"
     37PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px)") is "inset(10px round 9px 8px / 7px 6px)"
     38PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px 5px)") is "inset(10px round 9px 8px / 7px 6px 5px)"
     39PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px 5px)") is "inset(10px round 9px 8px / 7px 6px 5px)"
     40PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px 5px 4px)") is "inset(10px round 9px 8px / 7px 6px 5px 4px)"
     41PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px / 7px 6px 5px 4px)") is "inset(10px round 9px 8px / 7px 6px 5px 4px)"
     42PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px)") is "inset(10px round 9px 8px 7px / 6px)"
     43PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px)") is "inset(10px round 9px 8px 7px / 6px)"
     44PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px)") is "inset(10px round 9px 8px 7px / 6px 5px)"
     45PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px)") is "inset(10px round 9px 8px 7px / 6px 5px)"
     46PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px 4px)") is "inset(10px round 9px 8px 7px / 6px 5px 4px)"
     47PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px 4px)") is "inset(10px round 9px 8px 7px / 6px 5px 4px)"
     48PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px 4px 3px)") is "inset(10px round 9px 8px 7px / 6px 5px 4px 3px)"
     49PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px / 6px 5px 4px 3px)") is "inset(10px round 9px 8px 7px / 6px 5px 4px 3px)"
     50PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px)") is "inset(10px round 9px 8px 7px 6px / 5px)"
     51PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px)") is "inset(10px round 9px 8px 7px 6px / 5px)"
     52PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px)") is "inset(10px round 9px 8px 7px 6px / 5px 4px)"
     53PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px)") is "inset(10px round 9px 8px 7px 6px / 5px 4px)"
     54PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px 3px)") is "inset(10px round 9px 8px 7px 6px / 5px 4px 3px)"
     55PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px 3px)") is "inset(10px round 9px 8px 7px 6px / 5px 4px 3px)"
     56PASS getCSSText("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px 3px 2px)") is "inset(10px round 9px 8px 7px 6px / 5px 4px 3px 2px)"
     57PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 9px 8px 7px 6px / 5px 4px 3px 2px)") is "inset(10px round 9px 8px 7px 6px / 5px 4px 3px 2px)"
     58PASS getCSSText("-webkit-shape-outside", "inset(10px round 10px 20px 30px 20px)") is "inset(10px round 10px 20px 30px)"
     59PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 10px 20px 30px 20px)") is "inset(10px round 10px 20px 30px)"
     60PASS getCSSText("-webkit-shape-outside", "inset(10px round 10px 20px 10px 20px)") is "inset(10px round 10px 20px)"
     61PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 10px 20px 10px 20px)") is "inset(10px round 10px 20px)"
     62PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px)") is "inset(10px 20px 30px 40px round 5px 6px)"
     63PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px)") is "inset(10px 20px 30px 40px round 5px 6px)"
    5664PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)") is "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)"
    5765PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)") is "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)"
    58 PASS getCSSText("-webkit-shape-outside", "inset(calc(25%*3 - 10in) 0 0 0)") is "inset(calc(75% - 10in) 0px 0px 0px)"
    59 PASS getComputedStyleValue("-webkit-shape-outside", "inset(calc(25%*3 - 10in) 0 0 0)") is "inset(calc(75% - 960px) 0px 0px 0px round 0px 0px 0px 0px / 0px 0px 0px 0px)"
     66PASS getCSSText("-webkit-shape-outside", "inset(10px round 0px / 10px)") is "inset(10px round 0px / 10px)"
     67PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 0px / 10px)") is "inset(10px round 0px / 10px)"
     68PASS getCSSText("-webkit-shape-outside", "inset(calc(25%*3 - 10in) 0 0 0)") is "inset(calc(75% - 10in) 0px 0px)"
     69PASS getComputedStyleValue("-webkit-shape-outside", "inset(calc(25%*3 - 10in) 0 0 0)") is "inset(calc(75% - 960px) 0px 0px)"
    6070PASS getCSSText("-webkit-shape-outside", "circle()") is "circle(at 50% 50%)"
    6171PASS getComputedStyleValue("-webkit-shape-outside", "circle()") is "circle(closest-side at 50% 50%)"
  • trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js

    r166894 r167132  
    88    "none",
    99
    10     ["inset(10px)", "inset(10px 10px 10px 10px)", "inset(10px 10px 10px 10px round 0px 0px 0px 0px / 0px 0px 0px 0px)"],
    11     ["inset(10px 9px)", "inset(10px 9px 10px 9px)", "inset(10px 9px 10px 9px round 0px 0px 0px 0px / 0px 0px 0px 0px)"],
    12     ["inset(10px 9px 8px)", "inset(10px 9px 8px 9px)", "inset(10px 9px 8px 9px round 0px 0px 0px 0px / 0px 0px 0px 0px)"],
    13     ["inset(10px 20px 30px 40px)", "inset(10px 20px 30px 40px)", "inset(10px 20px 30px 40px round 0px 0px 0px 0px / 0px 0px 0px 0px)"],
    14     ["inset(10px round 9px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 9px 9px 9px 9px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 9px 9px 9px 9px)"],
    15     ["inset(10px round 9px / 9px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 9px 9px 9px 9px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 9px 9px 9px 9px)"],
    16     ["inset(10px round 9px / 8px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 8px 8px 8px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 8px 8px 8px)"],
    17     ["inset(10px round 9px / 8px 7px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 8px 7px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 8px 7px)"],
    18     ["inset(10px round 9px / 8px 7px 6px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 6px 7px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 6px 7px)"],
    19     ["inset(10px round 9px / 8px 7px 6px 5px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 6px 5px)", "inset(10px 10px 10px 10px round 9px 9px 9px 9px / 8px 7px 6px 5px)"],
    20     ["inset(10px round 9px 8px / 7px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 7px 7px 7px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 7px 7px 7px)"],
    21     ["inset(10px round 9px 8px / 7px 6px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 7px 6px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 7px 6px)"],
    22     ["inset(10px round 9px 8px / 7px 6px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 7px 6px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 7px 6px)"],
    23     ["inset(10px round 9px 8px / 7px 6px 5px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 5px 6px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 5px 6px)"],
    24     ["inset(10px round 9px 8px / 7px 6px 5px 4px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 5px 4px)", "inset(10px 10px 10px 10px round 9px 8px 9px 8px / 7px 6px 5px 4px)"],
    25     ["inset(10px round 9px 8px 7px / 6px)", "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 6px 6px 6px)", "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 6px 6px 6px)"],
    26     ["inset(10px round 9px 8px 7px / 6px 5px)", "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 6px 5px)", "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 6px 5px)"],
    27     ["inset(10px round 9px 8px 7px / 6px 5px 4px)", "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 4px 5px)", "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 4px 5px)"],
    28     ["inset(10px round 9px 8px 7px / 6px 5px 4px 3px)", "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 4px 3px)", "inset(10px 10px 10px 10px round 9px 8px 7px 8px / 6px 5px 4px 3px)"],
    29     ["inset(10px round 9px 8px 7px 6px / 5px)", "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 5px 5px 5px)", "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 5px 5px 5px)"],
    30     ["inset(10px round 9px 8px 7px 6px / 5px 4px)", "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 5px 4px)", "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 5px 4px)"],
    31     ["inset(10px round 9px 8px 7px 6px / 5px 4px 3px)", "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 3px 4px)", "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 3px 4px)"],
    32     ["inset(10px round 9px 8px 7px 6px / 5px 4px 3px 2px)", "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 3px 2px)", "inset(10px 10px 10px 10px round 9px 8px 7px 6px / 5px 4px 3px 2px)"],
    33     ["inset(10px 20px 30px 40px round 5px 6px)", "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)", "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)"],
     10    "inset(10px)",
     11    "inset(10px 9px)",
     12    "inset(10px 9px 8px)",
     13    "inset(10px 20px 30px 40px)",
     14    ["inset(10px 20px 30px 20px)", "inset(10px 20px 30px)"],
     15    ["inset(10px 20px 10px 20px)", "inset(10px 20px)"],
     16    "inset(10px round 9px)",
     17    "inset(10px round 0px / 0px 10px)",
     18    ["inset(10px round 9px / 9px)", "inset(10px round 9px)"],
     19    "inset(10px round 9px / 8px)",
     20    "inset(10px round 9px / 8px 7px)",
     21    "inset(10px round 9px / 8px 7px 6px)",
     22    "inset(10px round 9px / 8px 7px 6px 5px)",
     23    "inset(10px round 9px 8px / 7px)",
     24    "inset(10px round 9px 8px / 7px 6px)",
     25    "inset(10px round 9px 8px / 7px 6px 5px)",
     26    "inset(10px round 9px 8px / 7px 6px 5px 4px)",
     27    "inset(10px round 9px 8px 7px / 6px)",
     28    "inset(10px round 9px 8px 7px / 6px 5px)",
     29    "inset(10px round 9px 8px 7px / 6px 5px 4px)",
     30    "inset(10px round 9px 8px 7px / 6px 5px 4px 3px)",
     31    "inset(10px round 9px 8px 7px 6px / 5px)",
     32    "inset(10px round 9px 8px 7px 6px / 5px 4px)",
     33    "inset(10px round 9px 8px 7px 6px / 5px 4px 3px)",
     34    "inset(10px round 9px 8px 7px 6px / 5px 4px 3px 2px)",
     35    ["inset(10px round 10px 20px 30px 20px)", "inset(10px round 10px 20px 30px)"],
     36    ["inset(10px round 10px 20px 10px 20px)", "inset(10px round 10px 20px)"],
     37    "inset(10px 20px 30px 40px round 5px 6px)",
    3438    "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)",
    35 
    36     ["inset(calc(25%*3 - 10in) 0 0 0)", "inset(calc(75% - 10in) 0px 0px 0px)", "inset(calc(75% - 960px) 0px 0px 0px round 0px 0px 0px 0px / 0px 0px 0px 0px)"],
     39    "inset(10px round 0px / 10px)",
     40
     41    ["inset(calc(25%*3 - 10in) 0 0 0)", "inset(calc(75% - 10in) 0px 0px)", "inset(calc(75% - 960px) 0px 0px)"],
    3742
    3843    ["circle()", "circle(at 50% 50%)", "circle(closest-side at 50% 50%)"],
  • trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt

    r165638 r167132  
    1212Moving Text
    1313Moving Text
    14 PASS - "webkitShapeOutside" property for "inset-box" element at 1s saw something close to: inset(10% 10% 10% 10% round 0px 0px 0px 0px / 0px 0px 0px 0px)
     14PASS - "webkitShapeOutside" property for "inset-box" element at 1s saw something close to: inset(10%)
    1515PASS - "webkitShapeOutside" property for "circle-box" element at 1s saw something close to: circle(35% at 35% 35%)
    1616PASS - "webkitShapeOutside" property for "ellipse-box" element at 1s saw something close to: ellipse(35% 30% at 35% 35%)
  • trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation.html

    r165638 r167132  
    136136    const expectedValues = [
    137137      // [animation-name, time, element-id, property, expected-value, tolerance]
    138       ["inset-anim",  1, "inset-box", "webkitShapeOutside", "inset(10% 10% 10% 10% round 0px 0px 0px 0px / 0px 0px 0px 0px)", 0.05],
     138      ["inset-anim",  1, "inset-box", "webkitShapeOutside", "inset(10%)", 0.05],
    139139      ["circle-anim",  1, "circle-box", "webkitShapeOutside", "circle(35% at 35% 35%)", 0.05],
    140140      ["ellipse-anim",  1, "ellipse-box", "webkitShapeOutside", "ellipse(35% 30% at 35% 35%)", 0.05],
  • trunk/Source/WebCore/ChangeLog

    r167131 r167132  
     12014-04-11  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Shapes] inset args and radial args should serialize to the simplest form
     4        https://bugs.webkit.org/show_bug.cgi?id=129825
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Modify inset serialization to omit components where possible. The insets simplify
     9        according to the margin shorthand, while the corner radii simplify according to
     10        the border-radius shorthand.
     11
     12        Modifying existing parsing tests.
     13
     14        * css/CSSBasicShapes.cpp:
     15        (WebCore::buildInsetRadii): Add the necessary radii, omitting components where possible.
     16        (WebCore::buildInsetString): Omit components where possible.
     17
    1182014-04-11  Praveen R Jadhav  <praveen.j@samsung.com>
    219
  • trunk/Source/WebCore/css/CSSBasicShapes.cpp

    r165843 r167132  
    261261}
    262262
     263static bool buildInsetRadii(Vector<String>& radii, const String& topLeftRadius, const String& topRightRadius, const String& bottomRightRadius, const String& bottomLeftRadius)
     264{
     265    bool showBottomLeft = topRightRadius != bottomLeftRadius;
     266    bool showBottomRight = showBottomLeft || (bottomRightRadius != topLeftRadius);
     267    bool showTopRight = showBottomRight || (topRightRadius != topLeftRadius);
     268
     269    radii.append(topLeftRadius);
     270    if (showTopRight)
     271        radii.append(topRightRadius);
     272    if (showBottomRight)
     273        radii.append(bottomRightRadius);
     274    if (showBottomLeft)
     275        radii.append(bottomLeftRadius);
     276
     277    return radii.size() == 1 && radii[0] == "0px";
     278}
     279
    263280static String buildInsetString(const String& top, const String& right, const String& bottom, const String& left,
    264281    const String& topLeftRadiusWidth, const String& topLeftRadiusHeight,
     
    274291    result.appendLiteral(opening);
    275292    result.append(top);
    276     if (!right.isNull()) {
     293
     294    bool showLeftArg = !left.isNull() && left != right;
     295    bool showBottomArg = !bottom.isNull() && (bottom != top || showLeftArg);
     296    bool showRightArg = !right.isNull() && (right != top || showBottomArg);
     297    if (showRightArg) {
    277298        result.appendLiteral(separator);
    278299        result.append(right);
    279300    }
    280     if (!bottom.isNull()) {
     301    if (showBottomArg) {
    281302        result.appendLiteral(separator);
    282303        result.append(bottom);
    283304    }
    284     if (!left.isNull()) {
     305    if (showLeftArg) {
    285306        result.appendLiteral(separator);
    286307        result.append(left);
     
    288309
    289310    if (!topLeftRadiusWidth.isNull() && !topLeftRadiusHeight.isNull()) {
    290         result.appendLiteral(separator);
    291         result.appendLiteral(cornersSeparator);
    292         result.appendLiteral(separator);
    293 
    294         result.append(topLeftRadiusWidth);
    295         result.appendLiteral(separator);
    296         result.append(topRightRadiusWidth);
    297         result.appendLiteral(separator);
    298         result.append(bottomRightRadiusWidth);
    299         result.appendLiteral(separator);
    300         result.append(bottomLeftRadiusWidth);
    301 
    302         result.appendLiteral(separator);
    303         result.append('/');
    304         result.appendLiteral(separator);
    305 
    306         result.append(topLeftRadiusHeight);
    307         result.appendLiteral(separator);
    308         result.append(topRightRadiusHeight);
    309         result.appendLiteral(separator);
    310         result.append(bottomRightRadiusHeight);
    311         result.appendLiteral(separator);
    312         result.append(bottomLeftRadiusHeight);
     311        Vector<String> horizontalRadii;
     312        bool areDefaultCornerRadii = buildInsetRadii(horizontalRadii, topLeftRadiusWidth, topRightRadiusWidth, bottomRightRadiusWidth, bottomLeftRadiusWidth);
     313
     314        Vector<String> verticalRadii;
     315        areDefaultCornerRadii &= buildInsetRadii(verticalRadii, topLeftRadiusHeight, topRightRadiusHeight, bottomRightRadiusHeight, bottomLeftRadiusHeight);
     316
     317        if (!areDefaultCornerRadii) {
     318            result.appendLiteral(separator);
     319            result.appendLiteral(cornersSeparator);
     320
     321            for (size_t i = 0; i < horizontalRadii.size(); ++i) {
     322                result.appendLiteral(separator);
     323                result.append(horizontalRadii[i]);
     324            }
     325
     326            if (verticalRadii.size() != horizontalRadii.size()
     327                || !VectorComparer<false, String>::compare(verticalRadii.data(), horizontalRadii.data(), verticalRadii.size())) {
     328                result.appendLiteral(separator);
     329                result.appendLiteral("/");
     330
     331                for (size_t i = 0; i < verticalRadii.size(); ++i) {
     332                    result.appendLiteral(separator);
     333                    result.append(verticalRadii[i]);
     334                }
     335            }
     336        }
    313337    }
    314338    result.append(')');
Note: See TracChangeset for help on using the changeset viewer.