+2012-04-05 Hans Muller <hmuller@adobe.com>
+
+ CSS Exclusions polygon shape arguments should be comma separated
+ https://bugs.webkit.org/show_bug.cgi?id=82368
+
+ Reviewed by Ryosuke Niwa.
+
+ Updated the tests to match the polygon syntax defined by the draft exclusions
+ spec - http://dev.w3.org/csswg/css3-exclusions.
+
+ * fast/exclusions/parsing-wrap-shape-inside-expected.txt:
+ * fast/exclusions/parsing-wrap-shape-outside-expected.txt:
+ * fast/exclusions/script-tests/parsing-wrap-shape-inside.js:
+ * fast/exclusions/script-tests/parsing-wrap-shape-outside.js:
+
2012-04-05 Ami Fischman <fischman@chromium.org>
http/tests/media/media-can-load-when-hidden.html doesn't need to be an HTTP test, and is racy
PASS testComputedStyle("circle(10px, 20px, 30px)") is "circle(10px, 20px, 30px)"
PASS testCSSText("ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
PASS testComputedStyle("ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
-PASS testCSSText("polygon(10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testComputedStyle("polygon(10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testCSSText("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testComputedStyle("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testCSSText("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testComputedStyle("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
+PASS testCSSText("polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
+PASS testComputedStyle("polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
+PASS testCSSText("polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)") is "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"
+PASS testComputedStyle("polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)") is "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"
+PASS testCSSText("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
+PASS testComputedStyle("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
PASS testNotInherited("auto", "rectangle(10px, 20px, 30px, 40px)") is "parent: auto, child: rectangle(10px, 20px, 30px, 40px)"
PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial") is "parent: rectangle(10px, 20px, 30px, 40px), child: auto"
PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "") is "parent: rectangle(10px, 20px, 30px, 40px), child: auto"
PASS testComputedStyle("ellipse(10px 20px 30px 40px)") is "auto"
PASS testCSSText("polygon()") is ""
PASS testComputedStyle("polygon()") is "auto"
-PASS testCSSText("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)") is ""
-PASS testComputedStyle("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)") is "auto"
-PASS testCSSText("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)") is ""
-PASS testComputedStyle("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)") is "auto"
+PASS testCSSText("polygon(evenodd 10px 20px, 30px 40px, 40px 50px)") is ""
+PASS testComputedStyle("polygon(evenodd 10px 20px, 30px 40px, 40px 50px)") is "auto"
+PASS testCSSText("polygon(nonzero 10px 20px, 30px 40px, 40px 50px)") is ""
+PASS testComputedStyle("polygon(nonzero 10px 20px, 30px 40px, 40px 50px)") is "auto"
PASS testCSSText("polygon(nonzero)") is ""
PASS testComputedStyle("polygon(nonzero)") is "auto"
PASS testCSSText("polygon(evenodd)") is ""
PASS testComputedStyle("circle(10px, 20px, 30px)") is "circle(10px, 20px, 30px)"
PASS testCSSText("ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
PASS testComputedStyle("ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
-PASS testCSSText("polygon(10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testComputedStyle("polygon(10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testCSSText("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testComputedStyle("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testCSSText("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
-PASS testComputedStyle("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
+PASS testCSSText("polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
+PASS testComputedStyle("polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
+PASS testCSSText("polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)") is "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"
+PASS testComputedStyle("polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)") is "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"
+PASS testCSSText("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
+PASS testComputedStyle("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
PASS testNotInherited("auto", "rectangle(10px, 20px, 30px, 40px)") is "parent: auto, child: rectangle(10px, 20px, 30px, 40px)"
PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial") is "parent: rectangle(10px, 20px, 30px, 40px), child: auto"
PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "") is "parent: rectangle(10px, 20px, 30px, 40px), child: auto"
PASS testComputedStyle("ellipse(10px 20px 30px 40px)") is "auto"
PASS testCSSText("polygon()") is ""
PASS testComputedStyle("polygon()") is "auto"
-PASS testCSSText("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)") is ""
-PASS testComputedStyle("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)") is "auto"
-PASS testCSSText("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)") is ""
-PASS testComputedStyle("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)") is "auto"
+PASS testCSSText("polygon(evenodd 10px 20px, 30px 40px, 40px 50px)") is ""
+PASS testComputedStyle("polygon(evenodd 10px 20px, 30px 40px, 40px 50px)") is "auto"
+PASS testCSSText("polygon(nonzero 10px 20px, 30px 40px, 40px 50px)") is ""
+PASS testComputedStyle("polygon(nonzero 10px 20px, 30px 40px, 40px 50px)") is "auto"
PASS testCSSText("polygon(nonzero)") is ""
PASS testComputedStyle("polygon(nonzero)") is "auto"
PASS testCSSText("polygon(evenodd)") is ""
test("ellipse(10px, 20px, 30px, 40px)", "ellipse(10px, 20px, 30px, 40px)");
-test("polygon(10px, 20px 30px, 40px 40px, 50px)", "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)");
-test("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)", "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)");
-test("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)", "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)");
+test("polygon(10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)");
+test("polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)", "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)");
+test("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)");
shouldBeEqualToString('testNotInherited("auto", "rectangle(10px, 20px, 30px, 40px)")', "parent: auto, child: rectangle(10px, 20px, 30px, 40px)");
shouldBeEqualToString('testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial")', "parent: rectangle(10px, 20px, 30px, 40px), child: auto");
negative_test("ellipse(10px 20px 30px 40px)");
negative_test("polygon()");
-negative_test("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)");
-negative_test("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)");
+negative_test("polygon(evenodd 10px 20px, 30px 40px, 40px 50px)");
+negative_test("polygon(nonzero 10px 20px, 30px 40px, 40px 50px)");
negative_test("polygon(nonzero)");
negative_test("polygon(evenodd)");
negative_test("polygon(10px)");
test("ellipse(10px, 20px, 30px, 40px)", "ellipse(10px, 20px, 30px, 40px)");
-test("polygon(10px, 20px 30px, 40px 40px, 50px)", "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)");
-test("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)", "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)");
-test("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)", "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)");
+test("polygon(10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)");
+test("polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)", "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)");
+test("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)");
shouldBeEqualToString('testNotInherited("auto", "rectangle(10px, 20px, 30px, 40px)")', "parent: auto, child: rectangle(10px, 20px, 30px, 40px)");
shouldBeEqualToString('testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial")', "parent: rectangle(10px, 20px, 30px, 40px), child: auto");
negative_test("ellipse(10px 20px 30px 40px)");
negative_test("polygon()");
-negative_test("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)");
-negative_test("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)");
+negative_test("polygon(evenodd 10px 20px, 30px 40px, 40px 50px)");
+negative_test("polygon(nonzero 10px 20px, 30px 40px, 40px 50px)");
negative_test("polygon(nonzero)");
negative_test("polygon(evenodd)");
negative_test("polygon(10px)");
+2012-04-05 Hans Muller <hmuller@adobe.com>
+
+ CSS Exclusions polygon shape arguments should be comma separated
+ https://bugs.webkit.org/show_bug.cgi?id=82368
+
+ Reviewed by Ryosuke Niwa.
+
+ Changed the CSS Parser to accept a conventional comma separated argument list for the
+ polygon exclusion shape. The syntax had used spaces to separate x,y coordinates, like:
+ polygon(10px,20px 30px,40px). Now commas separate points: polygon(10px 20px, 30px 40px).
+ This change is per the draft exclusions spec, http://dev.w3.org/csswg/css3-exclusions.
+ Additional relevant information about CSS argument list syntax can be found
+ here: http://dev.w3.org/csswg/css3-values/#component-whitespace.
+
+ Factored comma recognition idiom in CSSParser.cpp into isComma() utility function.
+
+ The existing tests have been updated.
+
+ * css/CSSParser.cpp:
+ (WebCore::isComma)
+ (WebCore::CSSParser::parseFillPosition)
+ (WebCore::CSSParser::parseFillRepeat)
+ (WebCore::CSSParser::parseFillProperty)
+ (WebCore::CSSParser::parseCubicBezierTimingFunctionValue)
+ (WebCore::CSSParser::parseAnimationTimingFunction)
+ (WebCore::CSSParser::parseAnimationProperty)
+ (WebCore::CSSParser::parseExclusionShapePolygon)
+ (WebCore::CSSParser::parseDeprecatedGradient)
+ (WebCore::CSSParser::parseRadialGradient)
+ (WebCore::CSSParser::parseGradientColorStops)
+ (WebCore::CSSParser::parseImageSet)
+ (WebCore::filterInfoForName)
+ (WebCore::CSSParser::parseCustomFilter)
+ (WebCore::CSSParser::parseFontFeatureSettings)
+
+ * css/CSSWrapShapes.cpp:
+ (WebCore::CSSWrapShapePolygon::cssText):
+
2012-04-05 Joshua Bell <jsbell@chromium.org>
IndexedDB: Support string.length in keyPaths
return 0;
}
+static inline bool isComma(CSSParserValue* value)
+{
+ return value && value->unit == CSSParserValue::Operator && value->iValue == ',';
+}
+
+
void CSSParser::checkForOrphanedUnits()
{
if (inStrictMode() || inShorthand())
value = valueList->next();
// First check for the comma. If so, we are finished parsing this value or value pair.
- if (value && value->unit == CSSParserValue::Operator && value->iValue == ',')
+ if (isComma(value))
value = 0;
if (value) {
value = m_valueList->next();
// First check for the comma. If so, we are finished parsing this value or value pair.
- if (value && value->unit == CSSParserValue::Operator && value->iValue == ',')
+ if (isComma(value))
value = 0;
if (value)
RefPtr<CSSValue> currValue2;
if (allowComma) {
- if (val->unit != CSSParserValue::Operator || val->iValue != ',')
+ if (!isComma(val))
return false;
m_valueList->next();
allowComma = false;
if (!v)
// The last number in the function has no comma after it, so we're done.
return true;
- if (v->unit != CSSParserValue::Operator && v->iValue != ',')
+ if (!isComma(v))
return false;
v = args->next();
return true;
if (v) {
// There is a comma so we need to parse the second value
- if (v->unit != CSSParserValue::Operator && v->iValue != ',')
+ if (!isComma(v))
return 0;
v = args->next();
if (v->id != CSSValueStart && v->id != CSSValueEnd)
while ((val = m_valueList->current())) {
RefPtr<CSSValue> currValue;
if (allowComma) {
- if (val->unit != CSSParserValue::Operator || val->iValue != ',')
+ if (!isComma(val))
return false;
m_valueList->next();
allowComma = false;
if (argument->id == CSSValueEvenodd || argument->id == CSSValueNonzero) {
shape->setWindRule(argument->id == CSSValueEvenodd ? RULE_EVENODD : RULE_NONZERO);
- CSSParserValue* comma = args->next();
- if (!comma || comma->unit != CSSParserValue::Operator || comma->iValue != ',')
+ if (!isComma(args->next()))
return 0;
argument = args->next();
size -= 2;
}
- // <length>, <length> ... <length>, <length> -> each pair has 3 elements
- if (!size || (size % 3))
+ // <length> <length>, ... <length> <length> -> each pair has 3 elements except the last one
+ if (!size || (size % 3) - 2)
return 0;
CSSParserValue* argumentX = argument;
if (!validUnit(argumentX, FLength))
return 0;
- CSSParserValue* comma = args->next();
- if (!comma || comma->unit != CSSParserValue::Operator || comma->iValue != ',')
- return 0;
-
CSSParserValue* argumentY = args->next();
if (!argumentY || !validUnit(argumentY, FLength))
return 0;
shape->appendPoint(xLength.release(), yLength.release());
- argumentX = args->next();
+ CSSParserValue* commaOrNull = args->next();
+ if (!commaOrNull)
+ argumentX = 0;
+ else if (!isComma(commaOrNull))
+ return 0;
+ else
+ argumentX = args->next();
}
return shape;
// Comma.
a = args->next();
- if (!a || a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
// Next comes the starting point for the gradient as an x y pair. There is no
// Comma after the first point.
a = args->next();
- if (!a || a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
// For radial gradients only, we now expect a numeric radius.
// Comma after the first radius.
a = args->next();
- if (!a || a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
}
if (gradientType == CSSRadialGradient) {
// Comma after the second point.
a = args->next();
- if (!a || a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
a = args->next();
a = args->next();
while (a) {
// Look for the comma before the next stop.
- if (a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
// Now examine the stop itself.
if (centerX || centerY) {
// Comma
- if (a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
a = args->next();
while (a) {
// Look for the comma before the next stop.
if (expectComma) {
- if (a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
a = valueList->next();
a = args->next();
// Skip a comma
- if (a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
a = args->next();
a = args->next();
// Skip a comma
- if (a->unit != CSSParserValue::Operator || a->iValue != ',')
+ if (!isComma(a))
return false;
a = args->next();
break;
// If there are more arguments, they should be after a comma.
- if (arg->unit != CSSParserValue::Operator || arg->iValue != ',')
+ if (!isComma(arg))
return 0;
// Skip the comma and move on to the next argument.
static bool acceptCommaOperator(CSSParserValueList* argsList)
{
if (CSSParserValue* arg = argsList->current()) {
- if (arg->unit != CSSParserValue::Operator || arg->iValue != ',')
+ if (!isComma(arg))
return false;
argsList->next();
}
RefPtr<CSSValueList> paramValueList = CSSValueList::createSpaceSeparated();
while ((arg = argsList->current())) {
// If we hit a comma it means we finished this parameter's values.
- if (arg->unit == CSSParserValue::Operator && arg->iValue == ',')
+ if (isComma(arg))
break;
if (!validUnit(arg, FNumber, CSSStrictMode))
return 0;
// If the list isn't parsed fully, the current value should be comma.
value = m_valueList->current();
- if (value && !(value->unit == CSSParserValue::Operator && value->iValue == ','))
+ if (value && !isComma(value))
return false;
}
if (settings->length()) {
DEFINE_STATIC_LOCAL(const String, polygonParenEvenOdd, ("polygon(evenodd, "));
DEFINE_STATIC_LOCAL(const String, polygonParenNonZero, ("polygon(nonzero, "));
DEFINE_STATIC_LOCAL(const String, comma, (", "));
+ DEFINE_STATIC_LOCAL(const String, space, (" "));
StringBuilder result;
result.reserveCapacity(32);
for (unsigned i = 0; i < m_values.size(); i += 2) {
if (i)
- result.append(' ');
+ result.append(comma);
result.append(m_values.at(i)->cssText());
- result.append(comma);
+ result.append(space);
result.append(m_values.at(i + 1)->cssText());
}