Changeset 169406 in webkit
- Timestamp:
- May 27, 2014 5:28:52 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r169404 r169406 1 2014-05-27 Zoltan Horvath <zoltan@webkit.org> 2 3 [CSS Shapes] serialization of the computed value should omit the default radii 4 https://bugs.webkit.org/show_bug.cgi?id=132747 5 6 Reviewed by Darin Adler. 7 8 * fast/shapes/parsing/parsing-shape-outside-expected.txt: 9 * fast/shapes/parsing/parsing-test-utils.js: 10 1 11 2014-05-27 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt
r167936 r169406 71 71 PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 10px 10px 10px round calc(25%*3 - 10in))") is "inset(10px round calc(75% - 960px))" 72 72 PASS getCSSText("-webkit-shape-outside", "circle()") is "circle(at 50% 50%)" 73 PASS getComputedStyleValue("-webkit-shape-outside", "circle()") is "circle( closest-sideat 50% 50%)"73 PASS getComputedStyleValue("-webkit-shape-outside", "circle()") is "circle(at 50% 50%)" 74 74 PASS getCSSText("-webkit-shape-outside", "circle(farthest-side)") is "circle(farthest-side at 50% 50%)" 75 75 PASS getComputedStyleValue("-webkit-shape-outside", "circle(farthest-side)") is "circle(farthest-side at 50% 50%)" 76 PASS getCSSText("-webkit-shape-outside", "circle(closest-side)") is "circle(closest-side at 50% 50%)" 77 PASS getComputedStyleValue("-webkit-shape-outside", "circle(closest-side)") is "circle(closest-side at 50% 50%)" 76 PASS getCSSText("-webkit-shape-outside", "circle()") is "circle(at 50% 50%)" 77 PASS getComputedStyleValue("-webkit-shape-outside", "circle()") is "circle(at 50% 50%)" 78 PASS getCSSText("-webkit-shape-outside", "circle(closest-side at 50px 50px)") is "circle(at 50px 50px)" 79 PASS getComputedStyleValue("-webkit-shape-outside", "circle(closest-side at 50px 50px)") is "circle(at 50px 50px)" 78 80 PASS getCSSText("-webkit-shape-outside", "circle(10px)") is "circle(10px at 50% 50%)" 79 81 PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px)") is "circle(10px at 50% 50%)" … … 83 85 PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px at 10px 10px)") is "circle(10px at 10px 10px)" 84 86 PASS getCSSText("-webkit-shape-outside", "circle(at 10px)") is "circle(at 10px 50%)" 85 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px)") is "circle( closest-sideat 10px 50%)"87 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px)") is "circle(at 10px 50%)" 86 88 PASS getCSSText("-webkit-shape-outside", "circle(at 10px 10px)") is "circle(at 10px 10px)" 87 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px 10px)") is "circle( closest-sideat 10px 10px)"89 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px 10px)") is "circle(at 10px 10px)" 88 90 PASS getCSSText("-webkit-shape-outside", "circle(at top left)") is "circle(at 0% 0%)" 89 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at top left)") is "circle( closest-sideat 0% 0%)"91 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at top left)") is "circle(at 0% 0%)" 90 92 PASS getCSSText("-webkit-shape-outside", "circle(at right bottom)") is "circle(at 100% 100%)" 91 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at right bottom)") is "circle( closest-sideat 100% 100%)"93 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at right bottom)") is "circle(at 100% 100%)" 92 94 PASS getCSSText("-webkit-shape-outside", "circle(10px at left top 10px)") is "circle(10px at 0% 10px)" 93 95 PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px at left top 10px)") is "circle(10px at 0% 10px)" … … 101 103 PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px at right 10px bottom 10px)") is "circle(10px at right 10px bottom 10px)" 102 104 PASS getCSSText("-webkit-shape-outside", "ellipse()") is "ellipse(at 50% 50%)" 103 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse()") is "ellipse( closest-side closest-sideat 50% 50%)"105 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse()") is "ellipse(at 50% 50%)" 104 106 PASS getCSSText("-webkit-shape-outside", "ellipse(10px)") is "ellipse(10px at 50% 50%)" 105 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px)") is "ellipse(10px closest-sideat 50% 50%)"107 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px)") is "ellipse(10px at 50% 50%)" 106 108 PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px)") is "ellipse(10px 20px at 50% 50%)" 107 109 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px)") is "ellipse(10px 20px at 50% 50%)" 108 110 PASS getCSSText("-webkit-shape-outside", "ellipse(10px at 10px)") is "ellipse(10px at 10px 50%)" 109 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at 10px)") is "ellipse(10px closest-sideat 10px 50%)"111 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at 10px)") is "ellipse(10px at 10px 50%)" 110 112 PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px at 10px)") is "ellipse(10px 20px at 10px 50%)" 111 113 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px at 10px)") is "ellipse(10px 20px at 10px 50%)" 112 114 PASS getCSSText("-webkit-shape-outside", "ellipse(10px at 10px 10px)") is "ellipse(10px at 10px 10px)" 113 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at 10px 10px)") is "ellipse(10px closest-sideat 10px 10px)"115 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at 10px 10px)") is "ellipse(10px at 10px 10px)" 114 116 PASS getCSSText("-webkit-shape-outside", "ellipse(at 10px)") is "ellipse(at 10px 50%)" 115 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at 10px)") is "ellipse( closest-side closest-sideat 10px 50%)"117 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at 10px)") is "ellipse(at 10px 50%)" 116 118 PASS getCSSText("-webkit-shape-outside", "ellipse(at 10px 10px)") is "ellipse(at 10px 10px)" 117 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at 10px 10px)") is "ellipse( closest-side closest-sideat 10px 10px)"119 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at 10px 10px)") is "ellipse(at 10px 10px)" 118 120 PASS getCSSText("-webkit-shape-outside", "ellipse(at top left)") is "ellipse(at 0% 0%)" 119 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at top left)") is "ellipse( closest-side closest-sideat 0% 0%)"121 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at top left)") is "ellipse(at 0% 0%)" 120 122 PASS getCSSText("-webkit-shape-outside", "ellipse(at right bottom)") is "ellipse(at 100% 100%)" 121 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at right bottom)") is "ellipse( closest-side closest-sideat 100% 100%)"123 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at right bottom)") is "ellipse(at 100% 100%)" 122 124 PASS getCSSText("-webkit-shape-outside", "ellipse(10px at left top 10px)") is "ellipse(10px at 0% 10px)" 123 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at left top 10px)") is "ellipse(10px closest-sideat 0% 10px)"125 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at left top 10px)") is "ellipse(10px at 0% 10px)" 124 126 PASS getCSSText("-webkit-shape-outside", "ellipse(10px at top 10px left 10px)") is "ellipse(10px at 10px 10px)" 125 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at top 10px left 10px)") is "ellipse(10px closest-sideat 10px 10px)"127 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at top 10px left 10px)") is "ellipse(10px at 10px 10px)" 126 128 PASS getCSSText("-webkit-shape-outside", "ellipse(10px at right 10px bottom 10px)") is "ellipse(10px at right 10px bottom 10px)" 127 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at right 10px bottom 10px)") is "ellipse(10px closest-sideat right 10px bottom 10px)"129 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at right 10px bottom 10px)") is "ellipse(10px at right 10px bottom 10px)" 128 130 PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px at left top 10px)") is "ellipse(10px 20px at 0% 10px)" 129 131 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px at left top 10px)") is "ellipse(10px 20px at 0% 10px)" … … 136 138 PASS getCSSText("-webkit-shape-outside", "ellipse(10px 10px at right 0px bottom 0px)") is "ellipse(10px 10px at 100% 100%)" 137 139 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 10px at right 0px bottom 0px)") is "ellipse(10px 10px at 100% 100%)" 140 PASS getCSSText("-webkit-shape-outside", "ellipse(closest-side closest-side at 50px 50px)") is "ellipse(at 50px 50px)" 141 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(closest-side closest-side at 50px 50px)") is "ellipse(at 50px 50px)" 142 PASS getCSSText("-webkit-shape-outside", "ellipse(farthest-side farthest-side at 50px 50px)") is "ellipse(farthest-side farthest-side at 50px 50px)" 143 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(farthest-side farthest-side at 50px 50px)") is "ellipse(farthest-side farthest-side at 50px 50px)" 144 PASS getCSSText("-webkit-shape-outside", "ellipse(closest-side farthest-side at 50px 50px)") is "ellipse(closest-side farthest-side at 50px 50px)" 145 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(closest-side farthest-side at 50px 50px)") is "ellipse(closest-side farthest-side at 50px 50px)" 146 PASS getCSSText("-webkit-shape-outside", "ellipse(farthest-side closest-side at 50px 50px)") is "ellipse(farthest-side at 50px 50px)" 147 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(farthest-side closest-side at 50px 50px)") is "ellipse(farthest-side at 50px 50px)" 138 148 PASS getCSSText("-webkit-shape-outside", "polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(10px 20px, 30px 40px, 40px 50px)" 139 149 PASS getComputedStyleValue("-webkit-shape-outside", "polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(10px 20px, 30px 40px, 40px 50px)" -
trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js
r167936 r169406 42 42 ["inset(10px 10px 10px 10px round calc(25%*3 - 10in))", "inset(10px round calc(75% - 10in))", "inset(10px round calc(75% - 960px))"], 43 43 44 ["circle()", "circle(at 50% 50%)", "circle( closest-sideat 50% 50%)"],44 ["circle()", "circle(at 50% 50%)", "circle(at 50% 50%)"], 45 45 ["circle(farthest-side)", "circle(farthest-side at 50% 50%)", "circle(farthest-side at 50% 50%)"], 46 ["circle(closest-side)", "circle(closest-side at 50% 50%)", "circle(closest-side at 50% 50%)"], 46 ["circle()", "circle(at 50% 50%)", "circle(at 50% 50%)"], 47 ["circle(closest-side at 50px 50px)", "circle(at 50px 50px)", "circle(at 50px 50px)"], 47 48 ["circle(10px)", "circle(10px at 50% 50%)", "circle(10px at 50% 50%)"], 48 49 ["circle(10px at 10px)", "circle(10px at 10px 50%)"], 49 50 "circle(10px at 10px 10px)", 50 ["circle(at 10px)", "circle(at 10px 50%)", "circle( closest-sideat 10px 50%)"],51 ["circle(at 10px 10px)", "circle(at 10px 10px)", "circle( closest-sideat 10px 10px)"],52 ["circle(at top left)", "circle(at 0% 0%)", "circle( closest-sideat 0% 0%)"],53 ["circle(at right bottom)", "circle(at 100% 100%)", "circle( closest-sideat 100% 100%)"],51 ["circle(at 10px)", "circle(at 10px 50%)", "circle(at 10px 50%)"], 52 ["circle(at 10px 10px)", "circle(at 10px 10px)", "circle(at 10px 10px)"], 53 ["circle(at top left)", "circle(at 0% 0%)", "circle(at 0% 0%)"], 54 ["circle(at right bottom)", "circle(at 100% 100%)", "circle(at 100% 100%)"], 54 55 ["circle(10px at left top 10px)", "circle(10px at 0% 10px)", "circle(10px at 0% 10px)"], 55 56 ["circle(10px at top 10px left 10px)", "circle(10px at 10px 10px)", "circle(10px at 10px 10px)"], … … 58 59 ["circle(10px at right 10px bottom 10px)", "circle(10px at right 10px bottom 10px)"], 59 60 60 ["ellipse()", "ellipse(at 50% 50%)", "ellipse(closest-side closest-side at 50% 50%)"], 61 ["ellipse(10px)", "ellipse(10px at 50% 50%)", "ellipse(10px closest-side at 50% 50%)"], 61 62 ["ellipse()", "ellipse(at 50% 50%)", "ellipse(at 50% 50%)"], 63 ["ellipse(10px)", "ellipse(10px at 50% 50%)", "ellipse(10px at 50% 50%)"], 62 64 ["ellipse(10px 20px)", "ellipse(10px 20px at 50% 50%)", "ellipse(10px 20px at 50% 50%)"], 63 ["ellipse(10px at 10px)", "ellipse(10px at 10px 50%)", "ellipse(10px closest-sideat 10px 50%)"],65 ["ellipse(10px at 10px)", "ellipse(10px at 10px 50%)", "ellipse(10px at 10px 50%)"], 64 66 ["ellipse(10px 20px at 10px)", "ellipse(10px 20px at 10px 50%)"], 65 ["ellipse(10px at 10px 10px)", "ellipse(10px at 10px 10px)", "ellipse(10px closest-sideat 10px 10px)"],66 ["ellipse(at 10px)", "ellipse(at 10px 50%)", "ellipse( closest-side closest-sideat 10px 50%)"],67 ["ellipse(at 10px 10px)", "ellipse(at 10px 10px)", "ellipse( closest-side closest-sideat 10px 10px)"],68 ["ellipse(at top left)", "ellipse(at 0% 0%)", "ellipse( closest-side closest-sideat 0% 0%)"],69 ["ellipse(at right bottom)", "ellipse(at 100% 100%)", "ellipse( closest-side closest-sideat 100% 100%)"],70 ["ellipse(10px at left top 10px)", "ellipse(10px at 0% 10px)", "ellipse(10px closest-sideat 0% 10px)"],71 ["ellipse(10px at top 10px left 10px)", "ellipse(10px at 10px 10px)", "ellipse(10px closest-sideat 10px 10px)"],72 ["ellipse(10px at right 10px bottom 10px)", "ellipse(10px at right 10px bottom 10px)", "ellipse(10px closest-sideat right 10px bottom 10px)"],67 ["ellipse(10px at 10px 10px)", "ellipse(10px at 10px 10px)", "ellipse(10px at 10px 10px)"], 68 ["ellipse(at 10px)", "ellipse(at 10px 50%)", "ellipse(at 10px 50%)"], 69 ["ellipse(at 10px 10px)", "ellipse(at 10px 10px)", "ellipse(at 10px 10px)"], 70 ["ellipse(at top left)", "ellipse(at 0% 0%)", "ellipse(at 0% 0%)"], 71 ["ellipse(at right bottom)", "ellipse(at 100% 100%)", "ellipse(at 100% 100%)"], 72 ["ellipse(10px at left top 10px)", "ellipse(10px at 0% 10px)", "ellipse(10px at 0% 10px)"], 73 ["ellipse(10px at top 10px left 10px)", "ellipse(10px at 10px 10px)", "ellipse(10px at 10px 10px)"], 74 ["ellipse(10px at right 10px bottom 10px)", "ellipse(10px at right 10px bottom 10px)", "ellipse(10px at right 10px bottom 10px)"], 73 75 ["ellipse(10px 20px at left top 10px)", "ellipse(10px 20px at 0% 10px)", "ellipse(10px 20px at 0% 10px)"], 74 76 ["ellipse(10px 20px at top 10px left 10px)", "ellipse(10px 20px at 10px 10px)", "ellipse(10px 20px at 10px 10px)"], … … 76 78 ["ellipse(10px 10px at right 10% bottom 10%)", "ellipse(10px 10px at 90% 90%)"], 77 79 ["ellipse(10px 10px at right 0px bottom 0px)", "ellipse(10px 10px at 100% 100%)"], 80 ["ellipse(closest-side closest-side at 50px 50px)", "ellipse(at 50px 50px)", "ellipse(at 50px 50px)"], 81 ["ellipse(farthest-side farthest-side at 50px 50px)", "ellipse(farthest-side farthest-side at 50px 50px)", "ellipse(farthest-side farthest-side at 50px 50px)"], 82 ["ellipse(closest-side farthest-side at 50px 50px)", "ellipse(closest-side farthest-side at 50px 50px)", "ellipse(closest-side farthest-side at 50px 50px)"], 83 ["ellipse(farthest-side closest-side at 50px 50px)", "ellipse(farthest-side at 50px 50px)", "ellipse(farthest-side at 50px 50px)"], 78 84 79 85 ["polygon(10px 20px, 30px 40px, 40px 50px)", "polygon(10px 20px, 30px 40px, 40px 50px)"], -
trunk/Source/WebCore/ChangeLog
r169402 r169406 1 2014-05-27 Zoltan Horvath <zoltan@webkit.org> 2 3 [CSS Shapes] serialization of the computed value should omit the default radii 4 https://bugs.webkit.org/show_bug.cgi?id=132747 5 6 Reviewed by Darin Adler. 7 8 We should omit closest-side value, whereever is possible. Specification: 9 http://www.w3.org/TR/2014/CR-css-shapes-1-20140320/#basic-shape-computed-values 10 This change aligns the behavior to the specification. 11 12 Added new test cases for the shape-outside parsing tests. 13 14 * css/CSSBasicShapes.cpp: 15 (WebCore::buildCircleString): 16 (WebCore::CSSBasicShapeCircle::cssText): 17 (WebCore::CSSBasicShapeEllipse::cssText): 18 1 19 2014-05-27 Commit Queue <commit-queue@webkit.org> 2 20 -
trunk/Source/WebCore/css/CSSBasicShapes.cpp
r167132 r169406 89 89 StringBuilder result; 90 90 result.appendLiteral(opening); 91 if (!radius.isNull()) 91 if (!radius.isNull()) 92 92 result.append(radius); 93 93 … … 114 114 RefPtr<CSSPrimitiveValue> normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop); 115 115 116 return buildCircleString(m_radius ? m_radius->cssText() : String(), 116 String radius; 117 if (m_radius && m_radius->getValueID() != CSSValueClosestSide) 118 radius = m_radius->cssText(); 119 120 return buildCircleString(radius, 117 121 serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->getPairValue()), 118 122 serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()), … … 173 177 RefPtr<CSSPrimitiveValue> normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop); 174 178 175 return buildEllipseString(m_radiusX ? m_radiusX->cssText() : String(), 176 m_radiusY ? m_radiusY->cssText() : String(), 179 String radiusX; 180 String radiusY; 181 if (m_radiusX) { 182 bool shouldSerializeRadiusXValue = m_radiusX->getValueID() != CSSValueClosestSide; 183 bool shouldSerializeRadiusYValue = false; 184 185 if (m_radiusY) { 186 shouldSerializeRadiusYValue = m_radiusY->getValueID() != CSSValueClosestSide; 187 if (shouldSerializeRadiusYValue) 188 radiusY = m_radiusY->cssText(); 189 } 190 if (shouldSerializeRadiusXValue || (!shouldSerializeRadiusXValue && shouldSerializeRadiusYValue)) 191 radiusX = m_radiusX->cssText(); 192 } 193 return buildEllipseString(radiusX, radiusY, 177 194 serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->getPairValue()), 178 195 serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()),
Note: See TracChangeset
for help on using the changeset viewer.