https://bugs.webkit.org/show_bug.cgi?id=91761
Patch by Bem Jones-Bey <bjonesbe@adobe.com> on 2012-07-23
Reviewed by Andreas Kling.
Source/WebCore:
CSS exclusion shapes that are specified with negative radiuses or
height/width are now considered invalid and ignored.
Tests added to
LayoutTests/fast/exclusions/parsing-wrap-shape-lengths.html
* css/CSSParser.cpp:
(WebCore::CSSParser::parseExclusionShapeRectangle):
(WebCore::CSSParser::parseExclusionShapeCircle):
(WebCore::CSSParser::parseExclusionShapeEllipse):
LayoutTests:
Test that negative heights. widths, and radiuses are ignored.
* fast/exclusions/parsing-wrap-shape-lengths-expected.txt:
* fast/exclusions/parsing-wrap-shape-lengths.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123405
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-23 Bem Jones-Bey <bjonesbe@adobe.com>
+
+ [CSS Exclusions] SVG shape errors should invalidate exclusion shapes
+ https://bugs.webkit.org/show_bug.cgi?id=91761
+
+ Reviewed by Andreas Kling.
+
+ Test that negative heights. widths, and radiuses are ignored.
+
+ * fast/exclusions/parsing-wrap-shape-lengths-expected.txt:
+ * fast/exclusions/parsing-wrap-shape-lengths.html:
+
2012-07-23 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
[Qt] css3/selectors3 rebaseline after new test fonts
PASS computedStyle("-webkit-shape-inside", "circle(1px, 1px, 1p)") is "auto"
PASS innerStyle("-webkit-shape-inside", "circle(1px, 1px, calc())") is null
PASS computedStyle("-webkit-shape-inside", "circle(1px, 1px, calc())") is "auto"
+PASS innerStyle("-webkit-shape-inside", "circle(-1.5px, +1.5px, -1.5px)") is null
+PASS computedStyle("-webkit-shape-inside", "circle(-1.5px, +1.5px, -1.5px)") is "auto"
+PASS innerStyle("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, 1px, -1pt, 1pc)") is null
+PASS computedStyle("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, 1px, -1pt, 1pc)") is "auto"
+PASS innerStyle("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, 1px, 1pt, -1pc)") is null
+PASS computedStyle("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, 1px, 1pt, -1pc)") is "auto"
+PASS innerStyle("-webkit-shape-inside", "ellipse(1em, 1em, -1em, 1em)") is null
+PASS computedStyle("-webkit-shape-inside", "ellipse(1em, 1em, -1em, 1em)") is "auto"
+PASS innerStyle("-webkit-shape-inside", "ellipse(1em, 1em, 1em, -1em)") is null
+PASS computedStyle("-webkit-shape-inside", "ellipse(1em, 1em, 1em, -1em)") is "auto"
+PASS innerStyle("-webkit-shape-inside", "rectangle(1cm, 1mm, -1in, 1px, 1pt, 1pc)") is null
+PASS computedStyle("-webkit-shape-inside", "rectangle(1cm, 1mm, -1in, 1px, 1pt, 1pc)") is "auto"
+PASS innerStyle("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)") is null
+PASS computedStyle("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)") is "auto"
PASS successfullyParsed is true
TEST COMPLETE
negativeTest("-webkit-shape-inside", "circle(1px, 1px, px)");
negativeTest("-webkit-shape-inside", "circle(1px, 1px, 1p)");
negativeTest("-webkit-shape-inside", "circle(1px, 1px, calc())");
+
+// reject negative radiuses
+negativeTest("-webkit-shape-inside", "circle(-1.5px, +1.5px, -1.5px)");
+negativeTest("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, 1px, -1pt, 1pc)");
+negativeTest("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, 1px, 1pt, -1pc)");
+negativeTest("-webkit-shape-inside", "ellipse(1em, 1em, -1em, 1em)");
+negativeTest("-webkit-shape-inside", "ellipse(1em, 1em, 1em, -1em)");
+
+// reject negative height and width
+negativeTest("-webkit-shape-inside", "rectangle(1cm, 1mm, -1in, 1px, 1pt, 1pc)");
+negativeTest("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)");
+
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
+2012-07-23 Bem Jones-Bey <bjonesbe@adobe.com>
+
+ [CSS Exclusions] SVG shape errors should invalidate exclusion shapes
+ https://bugs.webkit.org/show_bug.cgi?id=91761
+
+ Reviewed by Andreas Kling.
+
+ CSS exclusion shapes that are specified with negative radiuses or
+ height/width are now considered invalid and ignored.
+
+ Tests added to
+ LayoutTests/fast/exclusions/parsing-wrap-shape-lengths.html
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseExclusionShapeRectangle):
+ (WebCore::CSSParser::parseExclusionShapeCircle):
+ (WebCore::CSSParser::parseExclusionShapeEllipse):
+
2012-07-23 Tien-Ren Chen <trchen@chromium.org>
[chromium] Implement scrollbar theme for Android
unsigned argumentNumber = 0;
CSSParserValue* argument = args->current();
while (argument) {
- if (!validUnit(argument, FLength | FPercent))
+ Units unitFlags = FLength | FPercent;
+ if (argumentNumber > 1) {
+ // Arguments width, height, rx, and ry cannot be negative.
+ unitFlags = unitFlags | FNonNeg;
+ }
+ if (!validUnit(argument, unitFlags))
return 0;
RefPtr<CSSPrimitiveValue> length = createPrimitiveNumericValue(argument);
unsigned argumentNumber = 0;
CSSParserValue* argument = args->current();
while (argument) {
- if (!validUnit(argument, FLength | FPercent))
+ Units unitFlags = FLength | FPercent;
+ if (argumentNumber == 2) {
+ // Argument radius cannot be negative.
+ unitFlags = unitFlags | FNonNeg;
+ }
+
+ if (!validUnit(argument, unitFlags))
return 0;
RefPtr<CSSPrimitiveValue> length = createPrimitiveNumericValue(argument);
unsigned argumentNumber = 0;
CSSParserValue* argument = args->current();
while (argument) {
- if (!validUnit(argument, FLength | FPercent))
+ Units unitFlags = FLength | FPercent;
+ if (argumentNumber > 1) {
+ // Arguments radiusX and radiusY cannot be negative.
+ unitFlags = unitFlags | FNonNeg;
+ }
+ if (!validUnit(argument, unitFlags))
return 0;
RefPtr<CSSPrimitiveValue> length = createPrimitiveNumericValue(argument);