Skip to content
Permalink
Browse files
WebKit does not reject some cubic-bezier form values for transition-t…
…iming-function.

https://bugs.webkit.org/show_bug.cgi?id=106369

Reviewed by Dean Jackson.

Source/WebCore:

http://www.w3.org/TR/css3-transitions/#transition-timing-function-property
describes restricitions on cubic-bezier values where the x values of
the curve should be between [0, 1] and y values can exceed this range.
WebKit was not following the specification by allowing x values
exceeding the range.
The spec also says that we should reject the defintion if the condition
is not respected which is what the new code does.

Test: transitions/transitions-parsing.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseAnimationTimingFunction):

LayoutTests:

Extended existing tests to cover the bug. Updated an existing test
which was checking wrong values.

* fast/css/transition-timing-function.html: Change the tested values as
they are considered wrong by the spec.
* fast/css/transition-timing-function-expected.txt:


Canonical link: https://commits.webkit.org/124562@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
darktears committed Jan 8, 2013
1 parent b5644b1 commit 3db848c97bf6ecfbf98d23077b4eea8e44b18795
Showing 7 changed files with 113 additions and 75 deletions.
@@ -1,3 +1,17 @@
2013-01-08 Alexis Menard <alexis@webkit.org>

WebKit does not reject some cubic-bezier form values for transition-timing-function.
https://bugs.webkit.org/show_bug.cgi?id=106369

Reviewed by Dean Jackson.

Extended existing tests to cover the bug. Updated an existing test
which was checking wrong values.

* fast/css/transition-timing-function.html: Change the tested values as
they are considered wrong by the spec.
* fast/css/transition-timing-function-expected.txt:

2013-01-08 Dimitri Glazkov <dglazkov@chromium.org>

[Chromium] Tighten up the actual expectations around webaudio fails..
@@ -5,6 +5,6 @@ PASS: 'ease-out' parsed and serialized successfully.
PASS: 'ease-in-out' parsed and serialized successfully.
PASS: 'cubic-bezier(0, 0, 0, 1)' parsed and serialized successfully.
PASS: 'cubic-bezier(0.1, 0.52, 0.11101, 0.9)' parsed and serialized successfully.
PASS: 'cubic-bezier(1.5, 55, 12.3456, 1000)' parsed and serialized successfully.
PASS: 'cubic-bezier(-1.5, -55, -12.3456, -1000)' parsed and serialized successfully.
PASS: 'cubic-bezier(1, 55, 0.3456, 1000)' parsed and serialized successfully.
PASS: 'cubic-bezier(1, -55, 0.3456, -1000)' parsed and serialized successfully.

@@ -28,6 +28,6 @@
roundTripTransitionTimingFunctionValue("ease-in-out");
roundTripTransitionTimingFunctionValue("cubic-bezier(0, 0, 0, 1)");
roundTripTransitionTimingFunctionValue("cubic-bezier(0.1, 0.52, 0.11101, 0.9)");
roundTripTransitionTimingFunctionValue("cubic-bezier(1.5, 55, 12.3456, 1000)");
roundTripTransitionTimingFunctionValue("cubic-bezier(-1.5, -55, -12.3456, -1000)");
roundTripTransitionTimingFunctionValue("cubic-bezier(1, 55, 0.3456, 1000)");
roundTripTransitionTimingFunctionValue("cubic-bezier(1, -55, 0.3456, -1000)");
</script>
@@ -158,34 +158,6 @@ PASS style.transitionTimingFunction is 'cubic-bezier(0.2, -2, 0.2, 0.4)'
PASS computedStyle.transitionTimingFunction is 'cubic-bezier(0.2, -2, 0.2, 0.4)'
PASS style.webkitTransitionTimingFunction is 'cubic-bezier(0.2, -2, 0.2, 0.4)'
PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(0.2, -2, 0.2, 0.4)'
PASS style.transitionTimingFunction is 'cubic-bezier(3, 0.1, 4, 1)'
PASS computedStyle.transitionTimingFunction is 'cubic-bezier(3, 0.1, 4, 1)'
PASS style.webkitTransitionTimingFunction is 'cubic-bezier(3, 0.1, 4, 1)'
PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(3, 0.1, 4, 1)'
PASS style.transitionTimingFunction is 'cubic-bezier(1, 0.1, 3, 1)'
PASS computedStyle.transitionTimingFunction is 'cubic-bezier(1, 0.1, 3, 1)'
PASS style.webkitTransitionTimingFunction is 'cubic-bezier(1, 0.1, 3, 1)'
PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(1, 0.1, 3, 1)'
PASS style.transitionTimingFunction is 'cubic-bezier(0.1, 0, 4, 0.4)'
PASS computedStyle.transitionTimingFunction is 'cubic-bezier(0.1, 0, 4, 0.4)'
PASS style.webkitTransitionTimingFunction is 'cubic-bezier(0.1, 0, 4, 0.4)'
PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(0.1, 0, 4, 0.4)'
PASS style.transitionTimingFunction is 'cubic-bezier(3, 0, 4, 0.4)'
PASS computedStyle.transitionTimingFunction is 'cubic-bezier(3, 0, 4, 0.4)'
PASS style.webkitTransitionTimingFunction is 'cubic-bezier(3, 0, 4, 0.4)'
PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(3, 0, 4, 0.4)'
PASS style.transitionTimingFunction is 'cubic-bezier(3, 0, 0.2, 0.4)'
PASS computedStyle.transitionTimingFunction is 'cubic-bezier(3, 0, 0.2, 0.4)'
PASS style.webkitTransitionTimingFunction is 'cubic-bezier(3, 0, 0.2, 0.4)'
PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(3, 0, 0.2, 0.4)'
PASS style.transitionTimingFunction is 'cubic-bezier(-0.2, 0, 0.2, 0.4)'
PASS computedStyle.transitionTimingFunction is 'cubic-bezier(-0.2, 0, 0.2, 0.4)'
PASS style.webkitTransitionTimingFunction is 'cubic-bezier(-0.2, 0, 0.2, 0.4)'
PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(-0.2, 0, 0.2, 0.4)'
PASS style.transitionTimingFunction is 'cubic-bezier(0.2, 2, -0.2, 0.4)'
PASS computedStyle.transitionTimingFunction is 'cubic-bezier(0.2, 2, -0.2, 0.4)'
PASS style.webkitTransitionTimingFunction is 'cubic-bezier(0.2, 2, -0.2, 0.4)'
PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(0.2, 2, -0.2, 0.4)'
PASS style.transitionTimingFunction is 'step-start'
PASS computedStyle.transitionTimingFunction is 'steps(1, start)'
PASS style.webkitTransitionTimingFunction is 'step-start'
@@ -251,6 +223,34 @@ PASS style.transitionTimingFunction is ''
PASS computedStyle.transitionTimingFunction is 'ease'
PASS style.webkitTransitionTimingFunction is ''
PASS computedStyle.webkitTransitionTimingFunction is 'ease'
PASS style.transitionTimingFunction is ''
PASS computedStyle.transitionTimingFunction is 'ease'
PASS style.webkitTransitionTimingFunction is ''
PASS computedStyle.webkitTransitionTimingFunction is 'ease'
PASS style.transitionTimingFunction is ''
PASS computedStyle.transitionTimingFunction is 'ease'
PASS style.webkitTransitionTimingFunction is ''
PASS computedStyle.webkitTransitionTimingFunction is 'ease'
PASS style.transitionTimingFunction is ''
PASS computedStyle.transitionTimingFunction is 'ease'
PASS style.webkitTransitionTimingFunction is ''
PASS computedStyle.webkitTransitionTimingFunction is 'ease'
PASS style.transitionTimingFunction is ''
PASS computedStyle.transitionTimingFunction is 'ease'
PASS style.webkitTransitionTimingFunction is ''
PASS computedStyle.webkitTransitionTimingFunction is 'ease'
PASS style.transitionTimingFunction is ''
PASS computedStyle.transitionTimingFunction is 'ease'
PASS style.webkitTransitionTimingFunction is ''
PASS computedStyle.webkitTransitionTimingFunction is 'ease'
PASS style.transitionTimingFunction is ''
PASS computedStyle.transitionTimingFunction is 'ease'
PASS style.webkitTransitionTimingFunction is ''
PASS computedStyle.webkitTransitionTimingFunction is 'ease'
PASS style.transitionTimingFunction is ''
PASS computedStyle.transitionTimingFunction is 'ease'
PASS style.webkitTransitionTimingFunction is ''
PASS computedStyle.webkitTransitionTimingFunction is 'ease'
Valid transition-delay values.
PASS computedStyle.transitionDelay is '0s'
PASS computedStyle.webkitTransitionDelay is '0s'
@@ -273,48 +273,6 @@
shouldBe("style.webkitTransitionTimingFunction", "'cubic-bezier(0.2, -2, 0.2, 0.4)'");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(0.2, -2, 0.2, 0.4)'");

style.transitionTimingFunction = "cubic-bezier(3, 0.1, 4, 1)";
shouldBe("style.transitionTimingFunction", "'cubic-bezier(3, 0.1, 4, 1)'");
shouldBe("computedStyle.transitionTimingFunction", "'cubic-bezier(3, 0.1, 4, 1)'");
shouldBe("style.webkitTransitionTimingFunction", "'cubic-bezier(3, 0.1, 4, 1)'");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(3, 0.1, 4, 1)'");

style.transitionTimingFunction = "cubic-bezier(1, 0.1, 3, 1)";
shouldBe("style.transitionTimingFunction", "'cubic-bezier(1, 0.1, 3, 1)'");
shouldBe("computedStyle.transitionTimingFunction", "'cubic-bezier(1, 0.1, 3, 1)'");
shouldBe("style.webkitTransitionTimingFunction", "'cubic-bezier(1, 0.1, 3, 1)'");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(1, 0.1, 3, 1)'");

style.transitionTimingFunction = "cubic-bezier(0.1, 0, 4, 0.4)";
shouldBe("style.transitionTimingFunction", "'cubic-bezier(0.1, 0, 4, 0.4)'");
shouldBe("computedStyle.transitionTimingFunction", "'cubic-bezier(0.1, 0, 4, 0.4)'");
shouldBe("style.webkitTransitionTimingFunction", "'cubic-bezier(0.1, 0, 4, 0.4)'");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(0.1, 0, 4, 0.4)'");

style.transitionTimingFunction = "cubic-bezier(3, 0, 4, 0.4)";
shouldBe("style.transitionTimingFunction", "'cubic-bezier(3, 0, 4, 0.4)'");
shouldBe("computedStyle.transitionTimingFunction", "'cubic-bezier(3, 0, 4, 0.4)'");
shouldBe("style.webkitTransitionTimingFunction", "'cubic-bezier(3, 0, 4, 0.4)'");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(3, 0, 4, 0.4)'");

style.transitionTimingFunction = "cubic-bezier(3, 0, 0.2, 0.4)";
shouldBe("style.transitionTimingFunction", "'cubic-bezier(3, 0, 0.2, 0.4)'");
shouldBe("computedStyle.transitionTimingFunction", "'cubic-bezier(3, 0, 0.2, 0.4)'");
shouldBe("style.webkitTransitionTimingFunction", "'cubic-bezier(3, 0, 0.2, 0.4)'");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(3, 0, 0.2, 0.4)'");

style.transitionTimingFunction = "cubic-bezier(-0.2, 0, 0.2, 0.4)";
shouldBe("style.transitionTimingFunction", "'cubic-bezier(-0.2, 0, 0.2, 0.4)'");
shouldBe("computedStyle.transitionTimingFunction", "'cubic-bezier(-0.2, 0, 0.2, 0.4)'");
shouldBe("style.webkitTransitionTimingFunction", "'cubic-bezier(-0.2, 0, 0.2, 0.4)'");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(-0.2, 0, 0.2, 0.4)'");

style.transitionTimingFunction = "cubic-bezier(0.2, 2, -0.2, 0.4)";
shouldBe("style.transitionTimingFunction", "'cubic-bezier(0.2, 2, -0.2, 0.4)'");
shouldBe("computedStyle.transitionTimingFunction", "'cubic-bezier(0.2, 2, -0.2, 0.4)'");
shouldBe("style.webkitTransitionTimingFunction", "'cubic-bezier(0.2, 2, -0.2, 0.4)'");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(0.2, 2, -0.2, 0.4)'");

style.transitionTimingFunction = "step-start";
shouldBe("style.transitionTimingFunction", "'step-start'");
shouldBe("computedStyle.transitionTimingFunction", "'steps(1, start)'");
@@ -369,6 +327,48 @@
style.transitionProperty = "";
style.transitionTimingFunction = "";

style.transitionTimingFunction = "cubic-bezier(3, 0.1, 4, 1)";
shouldBe("style.transitionTimingFunction", "''");
shouldBe("computedStyle.transitionTimingFunction", "'ease'");
shouldBe("style.webkitTransitionTimingFunction", "''");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'");

style.transitionTimingFunction = "cubic-bezier(1, 0.1, 3, 1)";
shouldBe("style.transitionTimingFunction", "''");
shouldBe("computedStyle.transitionTimingFunction", "'ease'");
shouldBe("style.webkitTransitionTimingFunction", "''");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'");

style.transitionTimingFunction = "cubic-bezier(0.1, 0, 4, 0.4)";
shouldBe("style.transitionTimingFunction", "''");
shouldBe("computedStyle.transitionTimingFunction", "'ease'");
shouldBe("style.webkitTransitionTimingFunction", "''");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'");

style.transitionTimingFunction = "cubic-bezier(3, 0, 4, 0.4)";
shouldBe("style.transitionTimingFunction", "''");
shouldBe("computedStyle.transitionTimingFunction", "'ease'");
shouldBe("style.webkitTransitionTimingFunction", "''");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'");

style.transitionTimingFunction = "cubic-bezier(3, 0, 0.2, 0.4)";
shouldBe("style.transitionTimingFunction", "''");
shouldBe("computedStyle.transitionTimingFunction", "'ease'");
shouldBe("style.webkitTransitionTimingFunction", "''");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'");

style.transitionTimingFunction = "cubic-bezier(-0.2, 0, 0.2, 0.4)";
shouldBe("style.transitionTimingFunction", "''");
shouldBe("computedStyle.transitionTimingFunction", "'ease'");
shouldBe("style.webkitTransitionTimingFunction", "''");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'");

style.transitionTimingFunction = "cubic-bezier(0.2, 2, -0.2, 0.4)";
shouldBe("style.transitionTimingFunction", "''");
shouldBe("computedStyle.transitionTimingFunction", "'ease'");
shouldBe("style.webkitTransitionTimingFunction", "''");
shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'");

style.transitionTimingFunction = "steps(5, 3)";
shouldBe("style.transitionTimingFunction", "''");
shouldBe("computedStyle.transitionTimingFunction", "'ease'");
@@ -1,3 +1,23 @@
2013-01-08 Alexis Menard <alexis@webkit.org>

WebKit does not reject some cubic-bezier form values for transition-timing-function.
https://bugs.webkit.org/show_bug.cgi?id=106369

Reviewed by Dean Jackson.

http://www.w3.org/TR/css3-transitions/#transition-timing-function-property
describes restricitions on cubic-bezier values where the x values of
the curve should be between [0, 1] and y values can exceed this range.
WebKit was not following the specification by allowing x values
exceeding the range.
The spec also says that we should reject the defintion if the condition
is not respected which is what the new code does.

Test: transitions/transitions-parsing.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseAnimationTimingFunction):

2013-01-08 Andreas Kling <akling@apple.com>

Heap-use-after-free in bool WebCore::SelectorChecker::checkOneSelector.
@@ -4406,15 +4406,19 @@ PassRefPtr<CSSValue> CSSParser::parseAnimationTimingFunction()
if (!args || args->size() != 7)
return 0;

// There are two points specified. The values must be between 0 and 1.
// There are two points specified. The x values must be between 0 and 1 but the y values can exceed this range.
double x1, y1, x2, y2;

if (!parseCubicBezierTimingFunctionValue(args, x1))
return 0;
if (x1 < 0 || x1 > 1)
return 0;
if (!parseCubicBezierTimingFunctionValue(args, y1))
return 0;
if (!parseCubicBezierTimingFunctionValue(args, x2))
return 0;
if (x2 < 0 || x2 > 1)
return 0;
if (!parseCubicBezierTimingFunctionValue(args, y2))
return 0;

0 comments on commit 3db848c

Please sign in to comment.