Changeset 151517 in webkit
- Timestamp:
- Jun 12, 2013 11:59:58 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r151511 r151517 1 2013-06-12 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 [CSS Shapes] rectangle and inset-rectangle do not properly handle rx and ry 4 https://bugs.webkit.org/show_bug.cgi?id=116745 5 6 Reviewed by Dirk Schulze. 7 8 Update tests to check for the rx and ry conditions. 9 10 * fast/exclusions/parsing/parsing-shape-inside-expected.txt: New results. 11 * fast/exclusions/parsing/parsing-shape-outside-expected.txt: New results. 12 * fast/exclusions/parsing/script-tests/parsing-shape-inside.js: Update 13 to reflect that the computed value now always has rx and ry. 14 * fast/exclusions/parsing/script-tests/parsing-shape-outside.js: Ditto. 15 * fast/exclusions/parsing/script-tests/parsing-test-utils.js: Ditto. 16 * fast/exclusions/resources/rounded-rectangle.js: 17 (genLeftRightRoundedRectFloatShapeOutsideRefTest): Factor out left and 18 right into separate methods so that they can be used in tests that 19 only have left floats or only right floats. 20 (genLeftRoundedRectFloatShapeOutsideRefTest): Ditto. 21 (genRightRoundedRectFloatShapeOutsideRefTest): Ditto. 22 * fast/exclusions/shape-inside/shape-inside-animation-expected.txt: New results. 23 * fast/exclusions/shape-inside/shape-inside-animation.html: Change to 24 reflect new computed style value. 25 * fast/exclusions/shape-inside/shape-inside-rounded-rectangle-large-radius-expected.html: Added. 26 * fast/exclusions/shape-inside/shape-inside-rounded-rectangle-large-radius.html: Added. 27 * fast/exclusions/shape-outside-floats/shape-outside-floats-rounded-rectangle-large-radius-expected.html: Added. 28 * fast/exclusions/shape-outside-floats/shape-outside-floats-rounded-rectangle-large-radius.html: Added. 29 Note that the expected test here uses shape-inside, because we 30 really are just testing that the behavior is the same as a 31 shape-inside with rx and ry set to 50%, and it turned out to be 32 very hard to construct an expected result that didn't use 33 shape-inside and wasn't off by a pixel. 34 * css3/masking/clip-path-animation.html: Update expected value. 35 * css3/masking/clip-path-animation-expected.txt: New results. 36 1 37 2013-06-12 Csaba Osztrogonác <ossy@webkit.org> 2 38 -
trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt
r134736 r151517 1 1 2 PASS - "webkitClipPath" property for "rectangle-box" element at 1s saw something close to: rectangle(10%, 10%, 80%, 80% )2 PASS - "webkitClipPath" property for "rectangle-box" element at 1s saw something close to: rectangle(10%, 10%, 80%, 80%, 0px, 0px) 3 3 PASS - "webkitClipPath" property for "circle-box" element at 1s saw something close to: circle(35%, 35%, 35%) 4 4 PASS - "webkitClipPath" property for "ellipse-box" element at 1s saw something close to: ellipse(35%, 35%, 35%, 30%) -
trunk/LayoutTests/css3/masking/clip-path-animation.html
r134736 r151517 54 54 const expectedValues = [ 55 55 // [animation-name, time, element-id, property, expected-value, tolerance] 56 ["rectangle-anim", 1, "rectangle-box", "webkitClipPath", "rectangle(10%, 10%, 80%, 80% )", 0.05],56 ["rectangle-anim", 1, "rectangle-box", "webkitClipPath", "rectangle(10%, 10%, 80%, 80%, 0px, 0px)", 0.05], 57 57 ["circle-anim", 1, "circle-box", "webkitClipPath", "circle(35%, 35%, 35%)", 0.05], 58 58 ["ellipse-anim", 1, "ellipse-box", "webkitClipPath", "ellipse(35%, 35%, 35%, 30%)", 0.05], -
trunk/LayoutTests/fast/exclusions/parsing/parsing-shape-inside-expected.txt
r150904 r151517 7 7 PASS getComputedStyleValue("-webkit-shape-inside", "auto") is "auto" 8 8 PASS getCSSText("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px)" 9 PASS getComputedStyleValue("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px )"9 PASS getComputedStyleValue("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 10 10 PASS getCSSText("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px, 5px)") is "rectangle(10px, 20px, 30px, 40px, 5px)" 11 PASS getComputedStyleValue("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px, 5px)") is "rectangle(10px, 20px, 30px, 40px, 5px )"11 PASS getComputedStyleValue("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px, 5px)") is "rectangle(10px, 20px, 30px, 40px, 5px, 5px)" 12 12 PASS getCSSText("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "rectangle(10px, 20px, 30px, 40px, 5px, 10px)" 13 13 PASS getComputedStyleValue("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "rectangle(10px, 20px, 30px, 40px, 5px, 10px)" 14 14 PASS getCSSText("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px)") is "inset-rectangle(10px, 20px, 30px, 40px)" 15 PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px)") is "inset-rectangle(10px, 20px, 30px, 40px )"15 PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px)") is "inset-rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 16 16 PASS getCSSText("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 5px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px)" 17 PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 5px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px )"17 PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 5px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 5px)" 18 18 PASS getCSSText("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)" 19 19 PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)" … … 98 98 PASS getCSSText("-webkit-shape-inside", "polygon(10px, 20px, 30px, 40px, 40px, 50px)") is "" 99 99 PASS getComputedStyleValue("-webkit-shape-inside", "polygon(10px, 20px, 30px, 40px, 40px, 50px)") is "outside-shape" 100 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "auto", "rectangle(10px, 20px, 30px, 40px)") is "parent: auto, child: rectangle(10px, 20px, 30px, 40px )"101 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "outside-shape", "rectangle(10px, 20px, 30px, 40px)") is "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px )"102 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "initial") is "parent: rectangle(10px, 20px, 30px, 40px ), child: outside-shape"103 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "") is "parent: rectangle(10px, 20px, 30px, 40px ), child: outside-shape"104 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "inherit") is "parent: rectangle(10px, 20px, 30px, 40px ), child: rectangle(10px, 20px, 30px, 40px)"100 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "auto", "rectangle(10px, 20px, 30px, 40px)") is "parent: auto, child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 101 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "outside-shape", "rectangle(10px, 20px, 30px, 40px)") is "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 102 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "initial") is "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: outside-shape" 103 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "") is "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: outside-shape" 104 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "inherit") is "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 105 105 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "", "inherit") is "parent: outside-shape, child: outside-shape" 106 106 PASS getParentAndChildComputedStylesString("-webkit-shape-inside", "auto", "inherit") is "parent: auto, child: auto" -
trunk/LayoutTests/fast/exclusions/parsing/parsing-shape-outside-expected.txt
r150904 r151517 7 7 PASS getComputedStyleValue("-webkit-shape-outside", "auto") is "auto" 8 8 PASS getCSSText("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px)" 9 PASS getComputedStyleValue("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px )"9 PASS getComputedStyleValue("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 10 10 PASS getCSSText("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px, 5px)") is "rectangle(10px, 20px, 30px, 40px, 5px)" 11 PASS getComputedStyleValue("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px, 5px)") is "rectangle(10px, 20px, 30px, 40px, 5px )"11 PASS getComputedStyleValue("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px, 5px)") is "rectangle(10px, 20px, 30px, 40px, 5px, 5px)" 12 12 PASS getCSSText("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "rectangle(10px, 20px, 30px, 40px, 5px, 10px)" 13 13 PASS getComputedStyleValue("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "rectangle(10px, 20px, 30px, 40px, 5px, 10px)" 14 14 PASS getCSSText("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px)") is "inset-rectangle(10px, 20px, 30px, 40px)" 15 PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px)") is "inset-rectangle(10px, 20px, 30px, 40px )"15 PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px)") is "inset-rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 16 16 PASS getCSSText("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 5px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px)" 17 PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 5px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px )"17 PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 5px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 5px)" 18 18 PASS getCSSText("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)" 19 19 PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)" … … 98 98 PASS getCSSText("-webkit-shape-outside", "outside-shape") is "" 99 99 PASS getComputedStyleValue("-webkit-shape-outside", "outside-shape") is "auto" 100 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "auto", "rectangle(10px, 20px, 30px, 40px)") is "parent: auto, child: rectangle(10px, 20px, 30px, 40px )"101 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "initial") is "parent: rectangle(10px, 20px, 30px, 40px ), child: auto"102 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "") is "parent: rectangle(10px, 20px, 30px, 40px ), child: auto"103 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "inherit") is "parent: rectangle(10px, 20px, 30px, 40px ), child: rectangle(10px, 20px, 30px, 40px)"100 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "auto", "rectangle(10px, 20px, 30px, 40px)") is "parent: auto, child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 101 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "initial") is "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: auto" 102 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "") is "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: auto" 103 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "inherit") is "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)" 104 104 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "", "inherit") is "parent: auto, child: auto" 105 105 PASS getParentAndChildComputedStylesString("-webkit-shape-outside", "auto", "inherit") is "parent: auto, child: auto" -
trunk/LayoutTests/fast/exclusions/parsing/script-tests/parsing-shape-inside.js
r151247 r151517 9 9 var value = (elt instanceof Array) ? elt[0] : elt; 10 10 var expectedValue = (elt instanceof Array) ? elt[1] : elt; 11 var computedValue = (elt instanceof Array && elt.length > 2) ? elt[2] : expectedValue; 11 12 testShapeSpecifiedProperty("-webkit-shape-inside", value, expectedValue); 12 testShapeComputedProperty("-webkit-shape-inside", value, expectedValue);13 testShapeComputedProperty("-webkit-shape-inside", value, computedValue); 13 14 }); 14 15 … … 22 23 testNotInheritedShapeProperty, 23 24 [// [property, parentValue, childValue, expectedValue] 24 ["-webkit-shape-inside", "auto", "rectangle(10px, 20px, 30px, 40px)", "parent: auto, child: rectangle(10px, 20px, 30px, 40px )"],25 ["-webkit-shape-inside", "outside-shape", "rectangle(10px, 20px, 30px, 40px)", "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px )"],26 ["-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "initial", "parent: rectangle(10px, 20px, 30px, 40px ), child: outside-shape"],27 ["-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "", "parent: rectangle(10px, 20px, 30px, 40px ), child: outside-shape"],28 ["-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "inherit", "parent: rectangle(10px, 20px, 30px, 40px ), child: rectangle(10px, 20px, 30px, 40px)"],25 ["-webkit-shape-inside", "auto", "rectangle(10px, 20px, 30px, 40px)", "parent: auto, child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 26 ["-webkit-shape-inside", "outside-shape", "rectangle(10px, 20px, 30px, 40px)", "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 27 ["-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "initial", "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: outside-shape"], 28 ["-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "", "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: outside-shape"], 29 ["-webkit-shape-inside", "rectangle(10px, 20px, 30px, 40px)", "inherit", "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 29 30 ["-webkit-shape-inside", "", "inherit", "parent: outside-shape, child: outside-shape"], 30 31 ["-webkit-shape-inside", "auto", "inherit", "parent: auto, child: auto"]] -
trunk/LayoutTests/fast/exclusions/parsing/script-tests/parsing-shape-outside.js
r151247 r151517 9 9 var value = (elt instanceof Array) ? elt[0] : elt; 10 10 var expectedValue = (elt instanceof Array) ? elt[1] : elt; 11 var computedValue = (elt instanceof Array && elt.length > 2) ? elt[2] : expectedValue; 11 12 testShapeSpecifiedProperty("-webkit-shape-outside", value, expectedValue); 12 testShapeComputedProperty("-webkit-shape-outside", value, expectedValue);13 testShapeComputedProperty("-webkit-shape-outside", value, computedValue); 13 14 }); 14 15 … … 24 25 testNotInheritedShapeProperty, 25 26 [// [property, parentValue, childValue, expectedValue] 26 ["-webkit-shape-outside", "auto", "rectangle(10px, 20px, 30px, 40px)", "parent: auto, child: rectangle(10px, 20px, 30px, 40px )"],27 ["-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "initial", "parent: rectangle(10px, 20px, 30px, 40px ), child: auto"],28 ["-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "", "parent: rectangle(10px, 20px, 30px, 40px ), child: auto"],29 ["-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "inherit", "parent: rectangle(10px, 20px, 30px, 40px ), child: rectangle(10px, 20px, 30px, 40px)"],27 ["-webkit-shape-outside", "auto", "rectangle(10px, 20px, 30px, 40px)", "parent: auto, child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 28 ["-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "initial", "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: auto"], 29 ["-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "", "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: auto"], 30 ["-webkit-shape-outside", "rectangle(10px, 20px, 30px, 40px)", "inherit", "parent: rectangle(10px, 20px, 30px, 40px, 0px, 0px), child: rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 30 31 ["-webkit-shape-outside", "", "inherit", "parent: auto, child: auto"], 31 32 ["-webkit-shape-outside", "auto", "inherit", "parent: auto, child: auto"]] -
trunk/LayoutTests/fast/exclusions/parsing/script-tests/parsing-test-utils.js
r150904 r151517 1 1 // Valid values for both shape-inside and shape-outside. Two values are specified when the shape property value 2 // differs from the specified value. 2 // differs from the specified value. Three values are specified when the computed shape property value differs 3 // from the specified value. 4 // eg: "specified value/CSS Text value/computed style value" 5 // or: ["specified value", "CSS Text value/computed style value"] 6 // or: ["specified value", "CSS Text value", "Computed style value"] 3 7 var validShapeValues = [ 4 8 "auto", 5 "rectangle(10px, 20px, 30px, 40px)",6 "rectangle(10px, 20px, 30px, 40px, 5px)",9 ["rectangle(10px, 20px, 30px, 40px)", "rectangle(10px, 20px, 30px, 40px)", "rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 10 ["rectangle(10px, 20px, 30px, 40px, 5px)", "rectangle(10px, 20px, 30px, 40px, 5px)", "rectangle(10px, 20px, 30px, 40px, 5px, 5px)"], 7 11 "rectangle(10px, 20px, 30px, 40px, 5px, 10px)", 8 12 9 "inset-rectangle(10px, 20px, 30px, 40px)",10 "inset-rectangle(10px, 20px, 30px, 40px, 5px)",13 ["inset-rectangle(10px, 20px, 30px, 40px)", "inset-rectangle(10px, 20px, 30px, 40px)", "inset-rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 14 ["inset-rectangle(10px, 20px, 30px, 40px, 5px)", "inset-rectangle(10px, 20px, 30px, 40px, 5px)", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 5px)"], 11 15 "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)", 12 16 -
trunk/LayoutTests/fast/exclusions/resources/rounded-rectangle.js
r150032 r151517 31 31 function genLeftRightRoundedRectFloatShapeOutsideRefTest(args) 32 32 { 33 genLeftRoundedRectFloatShapeOutsideRefTest(args); 34 genRightRoundedRectFloatShapeOutsideRefTest(args); 35 } 36 37 function genLeftRoundedRectFloatShapeOutsideRefTest(args) 38 { 33 39 var leftRoundedRect = args.roundedRect; 34 40 var leftRoundedRectIntervals = scanConvertRoundedRectangleOutside(leftRoundedRect, args.containerHeight, args.lineHeight); … … 39 45 }); 40 46 document.getElementById("left-" + args.insertElementIdSuffix).insertAdjacentHTML('afterend', leftFloatDivs.join("\n")); 47 } 41 48 49 function genRightRoundedRectFloatShapeOutsideRefTest(args) 50 { 42 51 var rightRoundedRect = Object.create(args.roundedRect); 43 52 rightRoundedRect.x = args.containerWidth - args.roundedRect.width; -
trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-animation-expected.txt
r134736 r151517 1 1 Moving Text Moving Text Moving Text Moving Text 2 PASS - "webkitShapeInside" property for "rectangle-box" element at 1s saw something close to: rectangle(10%, 10%, 80%, 80% )2 PASS - "webkitShapeInside" property for "rectangle-box" element at 1s saw something close to: rectangle(10%, 10%, 80%, 80%, 0px, 0px) 3 3 PASS - "webkitShapeInside" property for "circle-box" element at 1s saw something close to: circle(35%, 35%, 35%) 4 4 PASS - "webkitShapeInside" property for "ellipse-box" element at 1s saw something close to: ellipse(35%, 35%, 35%, 30%) -
trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-animation.html
r151247 r151517 57 57 const expectedValues = [ 58 58 // [animation-name, time, element-id, property, expected-value, tolerance] 59 ["rectangle-anim", 1, "rectangle-box", "webkitShapeInside", "rectangle(10%, 10%, 80%, 80% )", 0.05],59 ["rectangle-anim", 1, "rectangle-box", "webkitShapeInside", "rectangle(10%, 10%, 80%, 80%, 0px, 0px)", 0.05], 60 60 ["circle-anim", 1, "circle-box", "webkitShapeInside", "circle(35%, 35%, 35%)", 0.05], 61 61 ["ellipse-anim", 1, "ellipse-box", "webkitShapeInside", "ellipse(35%, 35%, 35%, 30%)", 0.05], -
trunk/Source/WebCore/ChangeLog
r151516 r151517 1 2013-06-12 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 [CSS Shapes] rectangle and inset-rectangle do not properly handle rx and ry 4 https://bugs.webkit.org/show_bug.cgi?id=116745 5 6 Reviewed by Dirk Schulze. 7 8 If ry is not supplied, it now defaults to the rx value. Also, if rx 9 and ry are not supplied, they default to 0px. This also has the effect 10 that the computed style for any rectangle or inset-rectangle now 11 contains all six parameters. 12 13 If rx > width/2 then it is clamped to width/2, and if ry > height/2, 14 then it is clamped to height/2. This happens at layout time because 15 given mixed units and relative units, that is the only time this 16 determination can be made. 17 18 Tests: fast/exclusions/shape-inside/shape-inside-rounded-rectangle-large-radius.html 19 fast/exclusions/shape-outside-floats/shape-outside-floats-rounded-rectangle-large-radius.html 20 21 * css/BasicShapeFunctions.cpp: 22 (WebCore::valueForBasicShape): Remove checks for undefined, since rx 23 and ry cannot be undefined in BasicShapes anymore. 24 (WebCore::basicShapeForValue): If radii are undefined in CSS, set 25 default values in the BasicShape, per the spec. 26 * rendering/ExclusionShape.cpp: 27 (WebCore::ensureRadiiDoNotOverlap): Utility method to ensure radii 28 don't overlap. 29 (WebCore::ExclusionShape::createExclusionShape): Remove defaulting to 30 zero, clamp radii per the spec. 31 * rendering/style/BasicShapes.cpp: 32 (WebCore::BasicShapeRectangle::path): Remove defaulting. 33 (WebCore::BasicShapeRectangle::blend): Ditto. 34 (WebCore::BasicShapeInsetRectangle::path): Ditto. 35 (WebCore::BasicShapeInsetRectangle::blend): Ditto. 36 * rendering/style/BasicShapes.h: 37 (WebCore::BasicShapeRectangle::BasicShapeRectangle): Remove defaulting 38 to undefined for radii. 39 (WebCore::BasicShapeRectangle::setCornerRadiusX): Add assert to 40 prevent undefined. 41 (WebCore::BasicShapeRectangle::setCornerRadiusY): Add assert to 42 prevent undefined. 43 (WebCore::BasicShapeInsetRectangle::BasicShapeInsetRectangle): Ditto. 44 (WebCore::BasicShapeInsetRectangle::setCornerRadiusX): Add assert to 45 prevent undefined. 46 (WebCore::BasicShapeInsetRectangle::setCornerRadiusY): Add assert to 47 prevent undefined. 48 1 49 2013-06-11 Brent Fulgham <bfulgham@apple.com> 2 50 -
trunk/Source/WebCore/css/BasicShapeFunctions.cpp
r150917 r151517 51 51 rectangleValue->setWidth(cssValuePool().createValue(rectangle->width())); 52 52 rectangleValue->setHeight(cssValuePool().createValue(rectangle->height())); 53 if (!rectangle->cornerRadiusX().isUndefined()) { 54 rectangleValue->setRadiusX(cssValuePool().createValue(rectangle->cornerRadiusX())); 55 if (!rectangle->cornerRadiusY().isUndefined()) 56 rectangleValue->setRadiusY(cssValuePool().createValue(rectangle->cornerRadiusY())); 57 } 53 rectangleValue->setRadiusX(cssValuePool().createValue(rectangle->cornerRadiusX())); 54 rectangleValue->setRadiusY(cssValuePool().createValue(rectangle->cornerRadiusY())); 58 55 59 56 basicShapeValue = rectangleValue.release(); … … 103 100 rectangleValue->setBottom(cssValuePool().createValue(rectangle->bottom())); 104 101 rectangleValue->setLeft(cssValuePool().createValue(rectangle->left())); 105 if (!rectangle->cornerRadiusX().isUndefined()) { 106 rectangleValue->setRadiusX(cssValuePool().createValue(rectangle->cornerRadiusX())); 107 if (!rectangle->cornerRadiusY().isUndefined()) 108 rectangleValue->setRadiusY(cssValuePool().createValue(rectangle->cornerRadiusY())); 109 } 102 rectangleValue->setRadiusX(cssValuePool().createValue(rectangle->cornerRadiusX())); 103 rectangleValue->setRadiusY(cssValuePool().createValue(rectangle->cornerRadiusY())); 110 104 111 105 basicShapeValue = rectangleValue.release(); … … 137 131 rect->setHeight(convertToLength(style, rootStyle, rectValue->height())); 138 132 if (rectValue->radiusX()) { 139 rect->setCornerRadiusX(convertToLength(style, rootStyle, rectValue->radiusX())); 133 Length radiusX = convertToLength(style, rootStyle, rectValue->radiusX()); 134 rect->setCornerRadiusX(radiusX); 140 135 if (rectValue->radiusY()) 141 136 rect->setCornerRadiusY(convertToLength(style, rootStyle, rectValue->radiusY())); 137 else 138 rect->setCornerRadiusY(radiusX); 139 } else { 140 rect->setCornerRadiusX(Length(0, Fixed)); 141 rect->setCornerRadiusY(Length(0, Fixed)); 142 142 } 143 143 basicShape = rect.release(); … … 188 188 rect->setLeft(convertToLength(style, rootStyle, rectValue->left())); 189 189 if (rectValue->radiusX()) { 190 rect->setCornerRadiusX(convertToLength(style, rootStyle, rectValue->radiusX())); 190 Length radiusX = convertToLength(style, rootStyle, rectValue->radiusX()); 191 rect->setCornerRadiusX(radiusX); 191 192 if (rectValue->radiusY()) 192 193 rect->setCornerRadiusY(convertToLength(style, rootStyle, rectValue->radiusY())); 194 else 195 rect->setCornerRadiusY(radiusX); 196 } else { 197 rect->setCornerRadiusX(Length(0, Fixed)); 198 rect->setCornerRadiusY(Length(0, Fixed)); 193 199 } 194 200 basicShape = rect.release(); -
trunk/Source/WebCore/rendering/shapes/Shape.cpp
r151402 r151517 91 91 } 92 92 93 static inline void ensureRadiiDoNotOverlap(FloatRect &bounds, FloatSize &radii) 94 { 95 float widthRatio = bounds.width() / (2 * radii.width()); 96 float heightRatio = bounds.height() / (2 * radii.height()); 97 float reductionRatio = std::min<float>(widthRatio, heightRatio); 98 if (reductionRatio < 1) { 99 radii.setWidth(reductionRatio * radii.width()); 100 radii.setHeight(reductionRatio * radii.height()); 101 } 102 } 103 93 104 PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, Length margin, Length padding) 94 105 { … … 109 120 floatValueForLength(rectangle->width(), boxWidth), 110 121 floatValueForLength(rectangle->height(), boxHeight)); 111 Length radiusXLength = rectangle->cornerRadiusX();112 Length radiusYLength = rectangle->cornerRadiusY();113 122 FloatSize cornerRadii( 114 radiusXLength.isUndefined() ? 0 : floatValueForLength(radiusXLength, boxWidth), 115 radiusYLength.isUndefined() ? 0 : floatValueForLength(radiusYLength, boxHeight)); 123 floatValueForLength(rectangle->cornerRadiusX(), boxWidth), 124 floatValueForLength(rectangle->cornerRadiusY(), boxHeight)); 125 ensureRadiiDoNotOverlap(bounds, cornerRadii); 116 126 FloatRect logicalBounds = physicalRectToLogical(bounds, logicalBoxSize.height(), writingMode); 117 127 … … 170 180 boxWidth - left - floatValueForLength(rectangle->right(), boxWidth), 171 181 boxHeight - top - floatValueForLength(rectangle->bottom(), boxHeight)); 172 Length radiusXLength = rectangle->cornerRadiusX();173 Length radiusYLength = rectangle->cornerRadiusY();174 182 FloatSize cornerRadii( 175 radiusXLength.isUndefined() ? 0 : floatValueForLength(radiusXLength, boxWidth), 176 radiusYLength.isUndefined() ? 0 : floatValueForLength(radiusYLength, boxHeight)); 183 floatValueForLength(rectangle->cornerRadiusX(), boxWidth), 184 floatValueForLength(rectangle->cornerRadiusY(), boxHeight)); 185 ensureRadiiDoNotOverlap(bounds, cornerRadii); 177 186 FloatRect logicalBounds = physicalRectToLogical(bounds, logicalBoxSize.height(), writingMode); 178 187 -
trunk/Source/WebCore/rendering/style/BasicShapes.cpp
r151286 r151517 63 63 ), 64 64 FloatSize( 65 m_cornerRadiusX.isUndefined() ? 0 :floatValueForLength(m_cornerRadiusX, boundingBox.width()),66 m_cornerRadiusY.isUndefined() ? 0 :floatValueForLength(m_cornerRadiusY, boundingBox.height())65 floatValueForLength(m_cornerRadiusX, boundingBox.width()), 66 floatValueForLength(m_cornerRadiusY, boundingBox.height()) 67 67 ) 68 68 ); … … 79 79 result->setWidth(m_width.blend(o->width(), progress)); 80 80 result->setHeight(m_height.blend(o->height(), progress)); 81 if (!m_cornerRadiusX.isUndefined() && !o->cornerRadiusX().isUndefined()) 82 result->setCornerRadiusX(m_cornerRadiusX.blend(o->cornerRadiusX(), progress)); 83 if (!m_cornerRadiusY.isUndefined() && !o->cornerRadiusY().isUndefined()) 84 result->setCornerRadiusY(m_cornerRadiusY.blend(o->cornerRadiusY(), progress)); 81 result->setCornerRadiusX(m_cornerRadiusX.blend(o->cornerRadiusX(), progress)); 82 result->setCornerRadiusY(m_cornerRadiusY.blend(o->cornerRadiusY(), progress)); 85 83 return result.release(); 86 84 } … … 195 193 ), 196 194 FloatSize( 197 m_cornerRadiusX.isUndefined() ? 0 :floatValueForLength(m_cornerRadiusX, boundingBox.width()),198 m_cornerRadiusY.isUndefined() ? 0 :floatValueForLength(m_cornerRadiusY, boundingBox.height())195 floatValueForLength(m_cornerRadiusX, boundingBox.width()), 196 floatValueForLength(m_cornerRadiusY, boundingBox.height()) 199 197 ) 200 198 ); … … 211 209 result->setBottom(m_bottom.blend(o->bottom(), progress)); 212 210 result->setLeft(m_left.blend(o->left(), progress)); 213 if (!m_cornerRadiusX.isUndefined() && !o->cornerRadiusX().isUndefined()) 214 result->setCornerRadiusX(m_cornerRadiusX.blend(o->cornerRadiusX(), progress)); 215 if (!m_cornerRadiusY.isUndefined() && !o->cornerRadiusY().isUndefined()) 216 result->setCornerRadiusY(m_cornerRadiusY.blend(o->cornerRadiusY(), progress)); 217 return result.release(); 218 } 219 } 211 result->setCornerRadiusX(m_cornerRadiusX.blend(o->cornerRadiusX(), progress)); 212 result->setCornerRadiusY(m_cornerRadiusY.blend(o->cornerRadiusY(), progress)); 213 return result.release(); 214 } 215 } -
trunk/Source/WebCore/rendering/style/BasicShapes.h
r150917 r151517 80 80 void setWidth(Length width) { m_width = width; } 81 81 void setHeight(Length height) { m_height = height; } 82 void setCornerRadiusX(Length radiusX) { m_cornerRadiusX = radiusX; } 83 void setCornerRadiusY(Length radiusY) { m_cornerRadiusY = radiusY; } 82 void setCornerRadiusX(Length radiusX) 83 { 84 ASSERT(!radiusX.isUndefined()); 85 m_cornerRadiusX = radiusX; 86 } 87 void setCornerRadiusY(Length radiusY) 88 { 89 ASSERT(!radiusY.isUndefined()); 90 m_cornerRadiusY = radiusY; 91 } 84 92 85 93 virtual void path(Path&, const FloatRect&) OVERRIDE; … … 88 96 virtual Type type() const { return BasicShapeRectangleType; } 89 97 private: 90 BasicShapeRectangle() 91 : m_cornerRadiusX(Undefined) 92 , m_cornerRadiusY(Undefined) 93 { } 98 BasicShapeRectangle() { } 94 99 95 100 Length m_y; … … 193 198 void setBottom(Length bottom) { m_bottom = bottom; } 194 199 void setLeft(Length left) { m_left = left; } 195 void setCornerRadiusX(Length radiusX) { m_cornerRadiusX = radiusX; } 196 void setCornerRadiusY(Length radiusY) { m_cornerRadiusY = radiusY; } 200 void setCornerRadiusX(Length radiusX) 201 { 202 ASSERT(!radiusX.isUndefined()); 203 m_cornerRadiusX = radiusX; 204 } 205 void setCornerRadiusY(Length radiusY) 206 { 207 ASSERT(!radiusY.isUndefined()); 208 m_cornerRadiusY = radiusY; 209 } 197 210 198 211 virtual void path(Path&, const FloatRect&) OVERRIDE; … … 201 214 virtual Type type() const { return BasicShapeInsetRectangleType; } 202 215 private: 203 BasicShapeInsetRectangle() 204 : m_cornerRadiusX(Undefined) 205 , m_cornerRadiusY(Undefined) 206 { } 216 BasicShapeInsetRectangle() { } 207 217 208 218 Length m_right;
Note: See TracChangeset
for help on using the changeset viewer.