forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes for SVGPathElement IDLs and a bad assert.
The SVGPathElement IDLs were allowing undefined arguments, optional arguments, and were not type checking. This patch removes the optional portion, adds StrictTypeChecking (although that is not implemented in the IDL compiler yet) and adds testing. We also remove an assert that is simply wrong. It is OK to try to commit a change to an SVGPathSegList chunk before it is added to a list. The role is set from Undefined to Unaltered when it is added to the list, which is the correct behavior. R=pdr,fmalita BUG=311246 Review URL: https://codereview.chromium.org/54893002 git-svn-id: svn://svn.chromium.org/blink/trunk@161130 bbb929c8-8fbe-4397-9dbb-9b2b20218538
- Loading branch information
schenney@chromium.org
committed
Nov 1, 2013
1 parent
e6ab25e
commit 72808e1
Showing
5 changed files
with
116 additions
and
62 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
third_party/WebKit/LayoutTests/svg/custom/path-segment-initial-role.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script src="../../fast/js/resources/js-test-pre.js"></script> | ||
<script> | ||
var pathElement = document.createElementNS("http://www.w3.org/2000/svg","path"); | ||
|
||
var pathSegment = pathElement.createSVGPathSegCurvetoCubicAbs(0.0, 1.0, 2.0, 3.0, 4.0, 5.0); | ||
pathSegment.x1 = -1.0; | ||
|
||
shouldBe('pathSegment.x1', '-1.0'); | ||
</script> | ||
<p id="description">Test that there is no assertion when setting values on a new path segment not in any segment list.</p> | ||
<div id="console"></div> | ||
<script src="../../fast/js/resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGPathElement-valid-arguments.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script src="../../fast/js/resources/js-test-pre.js"></script> | ||
<script> | ||
var pathElement = document.createElementNS("http://www.w3.org/2000/svg","path"); | ||
|
||
shouldThrow('pathElement.getPointAtLength()', | ||
'"TypeError: Failed to execute \'getPointAtLength\' on \'SVGPathElement\': 1 argument required, but only 0 present."'); | ||
|
||
shouldThrow('pathElement.getPathSegAtLength()', | ||
'"TypeError: Failed to execute \'getPathSegAtLength\' on \'SVGPathElement\': 1 argument required, but only 0 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegMovetoAbs(0.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegMovetoAbs\' on \'SVGPathElement\': 2 arguments required, but only 1 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegMovetoRel(0.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegMovetoRel\' on \'SVGPathElement\': 2 arguments required, but only 1 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegLinetoAbs(0.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegLinetoAbs\' on \'SVGPathElement\': 2 arguments required, but only 1 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegLinetoRel(0.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegLinetoRel\' on \'SVGPathElement\': 2 arguments required, but only 1 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegCurvetoCubicAbs(0.0, 1.0, 2.0, 3.0, 4.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegCurvetoCubicAbs\' on \'SVGPathElement\': 6 arguments required, but only 5 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegCurvetoCubicRel(0.0, 1.0, 2.0, 3.0, 4.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegCurvetoCubicRel\' on \'SVGPathElement\': 6 arguments required, but only 5 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegCurvetoQuadraticAbs(0.0, 1.0, 2.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegCurvetoQuadraticAbs\' on \'SVGPathElement\': 4 arguments required, but only 3 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegCurvetoQuadraticRel(0.0, 1.0, 2.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegCurvetoQuadraticRel\' on \'SVGPathElement\': 4 arguments required, but only 3 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegArcAbs(0.0, 1.0, 2.0, 3.0, 4.0, true)', | ||
'"TypeError: Failed to execute \'createSVGPathSegArcAbs\' on \'SVGPathElement\': 7 arguments required, but only 6 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegArcRel(0.0, 1.0, 2.0, 3.0, 4.0, true)', | ||
'"TypeError: Failed to execute \'createSVGPathSegArcRel\' on \'SVGPathElement\': 7 arguments required, but only 6 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegLinetoHorizontalAbs()', | ||
'"TypeError: Failed to execute \'createSVGPathSegLinetoHorizontalAbs\' on \'SVGPathElement\': 1 argument required, but only 0 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegLinetoHorizontalRel()', | ||
'"TypeError: Failed to execute \'createSVGPathSegLinetoHorizontalRel\' on \'SVGPathElement\': 1 argument required, but only 0 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegLinetoVerticalAbs()', | ||
'"TypeError: Failed to execute \'createSVGPathSegLinetoVerticalAbs\' on \'SVGPathElement\': 1 argument required, but only 0 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegLinetoVerticalRel()', | ||
'"TypeError: Failed to execute \'createSVGPathSegLinetoVerticalRel\' on \'SVGPathElement\': 1 argument required, but only 0 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegCurvetoCubicSmoothAbs(0.0, 1.0, 2.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegCurvetoCubicSmoothAbs\' on \'SVGPathElement\': 4 arguments required, but only 3 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegCurvetoCubicSmoothRel(0.0, 1.0, 2.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegCurvetoCubicSmoothRel\' on \'SVGPathElement\': 4 arguments required, but only 3 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegCurvetoQuadraticSmoothAbs(0.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegCurvetoQuadraticSmoothAbs\' on \'SVGPathElement\': 2 arguments required, but only 1 present."'); | ||
|
||
shouldThrow('pathElement.createSVGPathSegCurvetoQuadraticSmoothRel(0.0)', | ||
'"TypeError: Failed to execute \'createSVGPathSegCurvetoQuadraticSmoothRel\' on \'SVGPathElement\': 2 arguments required, but only 1 present."'); | ||
</script> | ||
<p id="description">Test that correct exceptions are thrown from SVGPathElement methods.</p> | ||
<div id="console"></div> | ||
<script src="../../fast/js/resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters