Changeset 252467 in webkit
- Timestamp:
- Nov 14, 2019 2:45:15 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252461 r252467 1 2019-11-14 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 The CSSParser should not consume negative or unit-less lengths for the SVG properties 'r', 'rx' and 'ry' 4 https://bugs.webkit.org/show_bug.cgi?id=204200 5 6 Reviewed by Simon Fraser. 7 8 * svg/css/parse-length-expected.txt: 9 * svg/css/parse-length.html: 10 1 11 2019-11-14 Antoine Quint <graouts@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/ChangeLog
r252461 r252467 1 2019-11-14 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 The CSSParser should not consume negative or unit-less lengths for the SVG properties 'r', 'rx' and 'ry' 4 https://bugs.webkit.org/show_bug.cgi?id=204200 5 6 Reviewed by Simon Fraser. 7 8 * web-platform-tests/svg/geometry/parsing/r-computed-expected.txt: 9 * web-platform-tests/svg/geometry/parsing/r-invalid-expected.txt: 10 * web-platform-tests/svg/geometry/parsing/rx-computed-expected.txt: 11 * web-platform-tests/svg/geometry/parsing/rx-invalid-expected.txt: 12 * web-platform-tests/svg/geometry/parsing/ry-computed-expected.txt: 13 * web-platform-tests/svg/geometry/parsing/ry-invalid-expected.txt: 14 1 15 2019-11-14 Antoine Quint <graouts@apple.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/r-computed-expected.txt
r251777 r252467 3 3 PASS Property r value '0.5em' computes to '20px' 4 4 PASS Property r value 'calc(10px + 0.5em)' computes to '30px' 5 FAIL Property r value 'calc(10px - 0.5em)' computes to '0px' assert_equals: expected "0px" but got "-10px" 5 PASS Property r value 'calc(10px - 0.5em)' computes to '0px' 6 6 PASS Property r value '40%' computes to '40%' 7 7 PASS Property r value 'calc(50% + 60px)' computes to 'calc(50% + 60px)' -
trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/r-invalid-expected.txt
r251777 r252467 1 1 2 FAIL e.style['r'] = "10" should not set the property value assert_equals: expected "" but got "10px" 2 PASS e.style['r'] = "10" should not set the property value 3 3 PASS e.style['r'] = "auto" should not set the property value 4 4 PASS e.style['r'] = "10px 20px" should not set the property value 5 FAIL e.style['r'] = "-1px" should not set the property value assert_equals: expected "" but got "-1px" 6 FAIL e.style['r'] = "-10%" should not set the property value assert_equals: expected "" but got "-10%" 5 PASS e.style['r'] = "-1px" should not set the property value 6 PASS e.style['r'] = "-10%" should not set the property value 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/rx-computed-expected.txt
r251777 r252467 4 4 PASS Property rx value '0.5em' computes to '20px' 5 5 PASS Property rx value 'calc(10px + 0.5em)' computes to '30px' 6 FAIL Property rx value 'calc(10px - 0.5em)' computes to '0px' assert_equals: expected "0px" but got "-10px" 6 PASS Property rx value 'calc(10px - 0.5em)' computes to '0px' 7 7 PASS Property rx value '40%' computes to '40%' 8 8 PASS Property rx value 'calc(50% + 60px)' computes to 'calc(50% + 60px)' -
trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/rx-invalid-expected.txt
r251777 r252467 1 1 2 FAIL e.style['rx'] = "10" should not set the property value assert_equals: expected "" but got "10px" 2 PASS e.style['rx'] = "10" should not set the property value 3 3 PASS e.style['rx'] = "none" should not set the property value 4 4 PASS e.style['rx'] = "10px 20px" should not set the property value 5 FAIL e.style['rx'] = "-1px" should not set the property value assert_equals: expected "" but got "-1px" 5 PASS e.style['rx'] = "-1px" should not set the property value 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/ry-computed-expected.txt
r251777 r252467 4 4 PASS Property ry value '0.5em' computes to '20px' 5 5 PASS Property ry value 'calc(10px + 0.5em)' computes to '30px' 6 FAIL Property ry value 'calc(10px - 0.5em)' computes to '0px' assert_equals: expected "0px" but got "-10px" 6 PASS Property ry value 'calc(10px - 0.5em)' computes to '0px' 7 7 PASS Property ry value '40%' computes to '40%' 8 8 PASS Property ry value 'calc(50% + 60px)' computes to 'calc(50% + 60px)' -
trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/ry-invalid-expected.txt
r251777 r252467 1 1 2 FAIL e.style['ry'] = "10" should not set the property value assert_equals: expected "" but got "10px" 2 PASS e.style['ry'] = "10" should not set the property value 3 3 PASS e.style['ry'] = "none" should not set the property value 4 4 PASS e.style['ry'] = "10px 20px" should not set the property value 5 FAIL e.style['ry'] = "-1px" should not set the property value assert_equals: expected "" but got "-1px" 5 PASS e.style['ry'] = "-1px" should not set the property value 6 6 -
trunk/LayoutTests/svg/css/parse-length-expected.txt
r250103 r252467 62 62 PASS computedStyle("r", "1ex") is "12.800000190734863px" 63 63 PASS computedStyle("r", "20%") is "20%" 64 PASS computedStyle("r", "-200px") is " -200px"64 PASS computedStyle("r", "-200px") is "0px" 65 65 PASS computedStyle("rx", " 100") is "100px" 66 66 PASS computedStyle("rx", "100 ") is "100px" … … 69 69 PASS computedStyle("rx", "1ex") is "12.800000190734863px" 70 70 PASS computedStyle("rx", "20%") is "20%" 71 PASS computedStyle("rx", "-200px") is " -200px"71 PASS computedStyle("rx", "-200px") is "auto" 72 72 PASS computedStyle("ry", " 100") is "100px" 73 73 PASS computedStyle("ry", "100 ") is "100px" … … 76 76 PASS computedStyle("ry", "1ex") is "12.800000190734863px" 77 77 PASS computedStyle("ry", "20%") is "20%" 78 PASS computedStyle("ry", "-200px") is " -200px"78 PASS computedStyle("ry", "-200px") is "auto" 79 79 PASS computedStyle("width", "auto") is "auto" 80 80 PASS computedStyle("width", " 100") is "100px" -
trunk/LayoutTests/svg/css/parse-length.html
r250103 r252467 58 58 testComputed("r", "1ex", "12.800000190734863px"); 59 59 testComputed("r", "20%", "20%"); 60 testComputed("r", "-200px", " -200px");60 testComputed("r", "-200px", "0px"); 61 61 62 62 // Test 'rx'. … … 67 67 testComputed("rx", "1ex", "12.800000190734863px"); 68 68 testComputed("rx", "20%", "20%"); 69 testComputed("rx", "-200px", " -200px");69 testComputed("rx", "-200px", "auto"); 70 70 71 71 // Test 'ry'. … … 76 76 testComputed("ry", "1ex", "12.800000190734863px"); 77 77 testComputed("ry", "20%", "20%"); 78 testComputed("ry", "-200px", " -200px");78 testComputed("ry", "-200px", "auto"); 79 79 80 80 // Test 'width'. -
trunk/Source/WebCore/ChangeLog
r252462 r252467 1 2019-11-14 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 The CSSParser should not consume negative or unit-less lengths for the SVG properties 'r', 'rx' and 'ry' 4 https://bugs.webkit.org/show_bug.cgi?id=204200 5 6 Reviewed by Simon Fraser. 7 8 Both the CSSParser and SVGElement::parseAttribute() should be consistent 9 when parsing these properties. 10 11 The type of these properties is <length-percentage>, which requires specifying 12 the unit for the length: https://www.w3.org/TR/css-values/#length-value. 13 14 * css/parser/CSSParserFastPaths.cpp: 15 (WebCore::isSimpleLengthPropertyID): 16 * css/parser/CSSPropertyParser.cpp: 17 (WebCore::consumeRxOrRy): 18 (WebCore::CSSPropertyParser::parseSingleValue): 19 1 20 2019-11-14 Zalan Bujtas <zalan@apple.com> 2 21 -
trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp
r252392 r252467 65 65 case CSSPropertyPaddingInlineEnd: 66 66 case CSSPropertyPaddingInlineStart: 67 case CSSPropertyR: 68 case CSSPropertyRx: 69 case CSSPropertyRy: 67 70 case CSSPropertyShapeMargin: 68 71 acceptsNegativeNumbers = false; … … 88 91 case CSSPropertyX: 89 92 case CSSPropertyY: 90 case CSSPropertyR:91 case CSSPropertyRx:92 case CSSPropertyRy:93 93 acceptsNegativeNumbers = true; 94 94 return true; -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r252392 r252467 2141 2141 } 2142 2142 2143 static RefPtr<CSSPrimitiveValue> consumeRxOrRy(CSSParserTokenRange& range )2143 static RefPtr<CSSPrimitiveValue> consumeRxOrRy(CSSParserTokenRange& range, CSSParserMode cssParserMode) 2144 2144 { 2145 2145 if (range.peek().id() == CSSValueAuto) 2146 2146 return consumeIdent(range); 2147 return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll, UnitlessQuirk::Forbid);2147 return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative, UnitlessQuirk::Forbid); 2148 2148 } 2149 2149 … … 4111 4111 case CSSPropertyX: 4112 4112 case CSSPropertyY: 4113 return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll, UnitlessQuirk::Forbid); 4113 4114 case CSSPropertyR: 4114 return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll, UnitlessQuirk::Forbid);4115 return consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative, UnitlessQuirk::Forbid); 4115 4116 case CSSPropertyRx: 4116 4117 case CSSPropertyRy: 4117 return consumeRxOrRy(m_range );4118 return consumeRxOrRy(m_range, m_context.mode); 4118 4119 case CSSPropertyCursor: 4119 4120 return consumeCursor(m_range, m_context, inQuirksMode());
Note: See TracChangeset
for help on using the changeset viewer.