Commit db15310e authored by fs@opera.com's avatar fs@opera.com

Use StrictTypeChecking for methods on CRC2D that accepts Path2D

This moves the null-check out into generated bindings code. Since there's
no longer a need to throw (explicitly) the ExceptionState argument can be
dropped from the signatures.

Review URL: https://codereview.chromium.org/232913004

git-svn-id: svn://svn.chromium.org/blink/trunk@171471 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent dc0dd224
......@@ -30,12 +30,12 @@ PASS ctx.isPointInPath(path, 50, 50, 'gazonk') threw exception TypeError: Failed
PASS ctx.isPointInPath(50, 50, 'gazonk') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('gazonk') is not a valid enum value..
Testing null isPointInPath with Path object
PASS ctx.isPointInPath(null, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.isPointInPath(null, 50, 50, 'nonzero') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.isPointInPath(null, 50, 50, 'evenodd') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.isPointInPath(path, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.isPointInPath(path, 50, 50, 'nonzero') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.isPointInPath(path, 50, 50, 'evenodd') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.isPointInPath(null, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('50') is not a valid enum value..
PASS ctx.isPointInPath(null, 50, 50, 'nonzero') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.isPointInPath(null, 50, 50, 'evenodd') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.isPointInPath(path, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('50') is not a valid enum value..
PASS ctx.isPointInPath(path, 50, 50, 'nonzero') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.isPointInPath(path, 50, 50, 'evenodd') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
Testing invalid type isPointInPath with Path object
PASS ctx.isPointInPath([], 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('50') is not a valid enum value..
......
......@@ -24,7 +24,7 @@ PASS ctx.isPointInStroke(path,NaN,122) is false
PASS ctx.isPointInStroke(path,18,NaN) is false
Check null and invalid type
PASS ctx.isPointInStroke(null,70,20) threw exception TypeError: Failed to execute 'isPointInStroke' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.isPointInStroke(null,70,20) threw exception TypeError: Failed to execute 'isPointInStroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.isPointInStroke([],20,70) threw exception TypeError: Failed to execute 'isPointInStroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.isPointInStroke({},120,70) threw exception TypeError: Failed to execute 'isPointInStroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
......
......@@ -22,6 +22,8 @@ PASS imgdata[6] is 0
PASS imgdata[7] is not 255
Test addPath() with transform as null or invalid type.
PASS p7.addPath(p8, []) threw exception TypeError: Failed to execute 'addPath' on 'Path2D': parameter 2 is not of type 'SVGMatrix'..
PASS p7.addPath(p8, {}) threw exception TypeError: Failed to execute 'addPath' on 'Path2D': parameter 2 is not of type 'SVGMatrix'..
PASS imgdata[4] is 255
PASS imgdata[5] is 0
PASS imgdata[6] is 0
......@@ -34,9 +36,9 @@ PASS imgdata[2] is 0
PASS imgdata[3] is 255
Test addPath() with path as null and invalid type
PASS p7.addPath(null, m) threw exception TypeError: Failed to execute 'addPath' on 'Path2D': The 1st argument provided is either null, or an invalid Path object..
PASS p7.addPath([], m) threw exception TypeError: Failed to execute 'addPath' on 'Path2D': The 1st argument provided is either null, or an invalid Path object..
PASS p7.addPath({}, m) threw exception TypeError: Failed to execute 'addPath' on 'Path2D': The 1st argument provided is either null, or an invalid Path object..
PASS p7.addPath(null, m) threw exception TypeError: Failed to execute 'addPath' on 'Path2D': parameter 1 is not of type 'Path2D'..
PASS p7.addPath([], m) threw exception TypeError: Failed to execute 'addPath' on 'Path2D': parameter 1 is not of type 'Path2D'..
PASS p7.addPath({}, m) threw exception TypeError: Failed to execute 'addPath' on 'Path2D': parameter 1 is not of type 'Path2D'..
PASS successfullyParsed is true
......
......@@ -39,12 +39,12 @@ PASS pixelDataAtPoint()[1] is within 5 of 0
PASS pixelDataAtPoint()[2] is within 5 of 0
PASS pixelDataAtPoint()[3] is within 5 of 255
PASS ctx.clip(null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.clip(null, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 2 ('null') is not a valid enum value..
PASS ctx.clip(null, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.clip(null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('null') is not a valid enum value..
PASS ctx.clip(null, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip(null, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip([], 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip({}, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip(null, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.clip(null, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip([], 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip({}, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip('gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('gazonk') is not a valid enum value..
......
......@@ -39,12 +39,12 @@ PASS pixelDataAtPoint()[1] is within 5 of 0
PASS pixelDataAtPoint()[2] is within 5 of 0
PASS pixelDataAtPoint()[3] is within 5 of 255
PASS ctx.fill(null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.fill(null, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 2 ('null') is not a valid enum value..
PASS ctx.fill(null, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.fill(null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('null') is not a valid enum value..
PASS ctx.fill(null, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill(null, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill([], 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill({}, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill(null, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.fill(null, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill([], 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill({}, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill('gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('gazonk') is not a valid enum value..
......
......@@ -15,7 +15,7 @@ PASS pixelDataAtPoint()[0] is within 5 of 0
PASS pixelDataAtPoint()[1] is within 5 of 255
PASS pixelDataAtPoint()[2] is within 5 of 0
PASS pixelDataAtPoint()[3] is within 5 of 255
PASS ctx.stroke(null) threw exception TypeError: Failed to execute 'stroke' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.stroke(null) threw exception TypeError: Failed to execute 'stroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.stroke([]) threw exception TypeError: Failed to execute 'stroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.stroke({}) threw exception TypeError: Failed to execute 'stroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS successfullyParsed is true
......
......@@ -92,7 +92,7 @@ PASS testValue is 1160
PASS testValue is 660
Test case 5: exceptions
PASS context.scrollPathIntoView(null); threw exception TypeError: Failed to execute 'scrollPathIntoView' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path2D object..
PASS context.scrollPathIntoView(null); threw exception TypeError: Failed to execute 'scrollPathIntoView' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS context.scrollPathIntoView([]); threw exception TypeError: Failed to execute 'scrollPathIntoView' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS context.scrollPathIntoView({}); threw exception TypeError: Failed to execute 'scrollPathIntoView' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
......
......@@ -74,8 +74,8 @@ p7.rect(0,0,100,100);
var p8 = new Path2D();
p8.rect(100,100,100,100);
p7.addPath(p8, null);
p7.addPath(p8, []);
p7.addPath(p8, {});
shouldThrow("p7.addPath(p8, [])");
shouldThrow("p7.addPath(p8, {})");
ctx.fillStyle = 'red';
ctx.currentPath = p7;
ctx.fill();
......
......@@ -39,12 +39,12 @@ PASS pixelDataAtPoint()[1] is within 5 of 0
PASS pixelDataAtPoint()[2] is within 5 of 0
PASS pixelDataAtPoint()[3] is within 5 of 255
PASS ctx.clip(null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.clip(null, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 2 ('null') is not a valid enum value..
PASS ctx.clip(null, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.clip(null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('null') is not a valid enum value..
PASS ctx.clip(null, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip(null, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip([], 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip({}, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip(null, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.clip(null, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip([], 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip({}, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.clip('gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('gazonk') is not a valid enum value..
......
......@@ -39,12 +39,12 @@ PASS pixelDataAtPoint()[1] is within 5 of 0
PASS pixelDataAtPoint()[2] is within 5 of 0
PASS pixelDataAtPoint()[3] is within 5 of 255
PASS ctx.fill(null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.fill(null, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 2 ('null') is not a valid enum value..
PASS ctx.fill(null, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.fill(null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('null') is not a valid enum value..
PASS ctx.fill(null, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill(null, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill([], 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill({}, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill(null, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.fill(null, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill([], 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill({}, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.fill('gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('gazonk') is not a valid enum value..
......
......@@ -15,7 +15,7 @@ PASS pixelDataAtPoint()[0] is within 5 of 0
PASS pixelDataAtPoint()[1] is within 5 of 255
PASS pixelDataAtPoint()[2] is within 5 of 0
PASS pixelDataAtPoint()[3] is within 5 of 255
PASS ctx.stroke(null) threw exception TypeError: Failed to execute 'stroke' on 'CanvasRenderingContext2D': The 1st argument provided is either null, or an invalid Path object..
PASS ctx.stroke(null) threw exception TypeError: Failed to execute 'stroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.stroke([]) threw exception TypeError: Failed to execute 'stroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS ctx.stroke({}) threw exception TypeError: Failed to execute 'stroke' on 'CanvasRenderingContext2D': No function was found that matched the signature provided..
PASS successfullyParsed is true
......
......@@ -1024,18 +1024,13 @@ void CanvasRenderingContext2D::fill(const String& windingRuleString)
fillInternal(m_path, windingRuleString);
}
void CanvasRenderingContext2D::fill(Path2D* domPath, ExceptionState& exceptionState)
void CanvasRenderingContext2D::fill(Path2D* domPath)
{
fill(domPath, "nonzero", exceptionState);
fill(domPath, "nonzero");
}
void CanvasRenderingContext2D::fill(Path2D* domPath, const String& windingRuleString, ExceptionState& exceptionState)
void CanvasRenderingContext2D::fill(Path2D* domPath, const String& windingRuleString)
{
if (!domPath) {
exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(1, "Path"));
return;
}
fillInternal(domPath->path(), windingRuleString);
}
......@@ -1084,13 +1079,8 @@ void CanvasRenderingContext2D::stroke()
strokeInternal(m_path);
}
void CanvasRenderingContext2D::stroke(Path2D* domPath, ExceptionState& exceptionState)
void CanvasRenderingContext2D::stroke(Path2D* domPath)
{
if (!domPath) {
exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(1, "Path"));
return;
}
strokeInternal(domPath->path());
}
......@@ -1113,18 +1103,13 @@ void CanvasRenderingContext2D::clip(const String& windingRuleString)
clipInternal(m_path, windingRuleString);
}
void CanvasRenderingContext2D::clip(Path2D* domPath, ExceptionState& exceptionState)
void CanvasRenderingContext2D::clip(Path2D* domPath)
{
clip(domPath, "nonzero", exceptionState);
clip(domPath, "nonzero");
}
void CanvasRenderingContext2D::clip(Path2D* domPath, const String& windingRuleString, ExceptionState& exceptionState)
void CanvasRenderingContext2D::clip(Path2D* domPath, const String& windingRuleString)
{
if (!domPath) {
exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(1, "Path"));
return;
}
clipInternal(domPath->path(), windingRuleString);
}
......@@ -1133,18 +1118,13 @@ bool CanvasRenderingContext2D::isPointInPath(const float x, const float y, const
return isPointInPathInternal(m_path, x, y, windingRuleString);
}
bool CanvasRenderingContext2D::isPointInPath(Path2D* domPath, const float x, const float y, ExceptionState& exceptionState)
bool CanvasRenderingContext2D::isPointInPath(Path2D* domPath, const float x, const float y)
{
return isPointInPath(domPath, x, y, "nonzero", exceptionState);
return isPointInPath(domPath, x, y, "nonzero");
}
bool CanvasRenderingContext2D::isPointInPath(Path2D* domPath, const float x, const float y, const String& windingRuleString, ExceptionState& exceptionState)
bool CanvasRenderingContext2D::isPointInPath(Path2D* domPath, const float x, const float y, const String& windingRuleString)
{
if (!domPath) {
exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(1, "Path"));
return false;
}
return isPointInPathInternal(domPath->path(), x, y, windingRuleString);
}
......@@ -1170,13 +1150,8 @@ bool CanvasRenderingContext2D::isPointInStroke(const float x, const float y)
return isPointInStrokeInternal(m_path, x, y);
}
bool CanvasRenderingContext2D::isPointInStroke(Path2D* domPath, const float x, const float y, ExceptionState& exceptionState)
bool CanvasRenderingContext2D::isPointInStroke(Path2D* domPath, const float x, const float y)
{
if (!domPath) {
exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(1, "Path"));
return false;
}
return isPointInStrokeInternal(domPath->path(), x, y);
}
......@@ -1208,13 +1183,8 @@ void CanvasRenderingContext2D::scrollPathIntoView()
scrollPathIntoViewInternal(m_path);
}
void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d, ExceptionState& exceptionState)
void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d)
{
if (!path2d) {
exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(1, "Path2D"));
return;
}
scrollPathIntoViewInternal(path2d->path());
}
......
......@@ -152,22 +152,22 @@ public:
PassRefPtr<Path2D> currentPath();
void setCurrentPath(Path2D*);
void fill(const String& winding = "nonzero");
void fill(Path2D*, ExceptionState&);
void fill(Path2D*, const String& winding, ExceptionState&);
void fill(Path2D*);
void fill(Path2D*, const String& winding);
void stroke();
void stroke(Path2D*, ExceptionState&);
void stroke(Path2D*);
void clip(const String& winding = "nonzero");
void clip(Path2D*, ExceptionState&);
void clip(Path2D*, const String& winding, ExceptionState&);
void clip(Path2D*);
void clip(Path2D*, const String& winding);
bool isPointInPath(const float x, const float y, const String& winding = "nonzero");
bool isPointInPath(Path2D*, const float x, const float y, ExceptionState&);
bool isPointInPath(Path2D*, const float x, const float y, const String& winding, ExceptionState&);
bool isPointInPath(Path2D*, const float x, const float y);
bool isPointInPath(Path2D*, const float x, const float y, const String& winding);
bool isPointInStroke(const float x, const float y);
bool isPointInStroke(Path2D*, const float x, const float y, ExceptionState&);
bool isPointInStroke(Path2D*, const float x, const float y);
void scrollPathIntoView();
void scrollPathIntoView(Path2D*, ExceptionState&);
void scrollPathIntoView(Path2D*);
void clearRect(float x, float y, float width, float height);
void fillRect(float x, float y, float width, float height);
......
......@@ -69,27 +69,27 @@ interface CanvasRenderingContext2D {
// FIXME: Simplify these using optional CanvasWindingRule once crbug.com/339000 gets fixed.
void fill();
[RuntimeEnabled=Path2D, RaisesException] void fill(Path2D? path);
void fill(CanvasWindingRule winding);
[RuntimeEnabled=Path2D, RaisesException] void fill(Path2D? path, CanvasWindingRule winding);
[RuntimeEnabled=Path2D, StrictTypeChecking] void fill(Path2D path);
[StrictTypeChecking] void fill(CanvasWindingRule winding);
[RuntimeEnabled=Path2D, StrictTypeChecking] void fill(Path2D path, CanvasWindingRule winding);
void stroke();
[RuntimeEnabled=Path2D, RaisesException] void stroke(Path2D? path);
[RuntimeEnabled=Path2D, StrictTypeChecking] void stroke(Path2D path);
// FIXME: Simplify these using optional CanvasWindingRule once crbug.com/339000 gets fixed.
void clip();
[RuntimeEnabled=Path2D, RaisesException] void clip(Path2D? path);
void clip(CanvasWindingRule winding);
[RuntimeEnabled=Path2D, RaisesException] void clip(Path2D? path, CanvasWindingRule winding);
[RuntimeEnabled=Path2D, StrictTypeChecking] void clip(Path2D path);
[StrictTypeChecking] void clip(CanvasWindingRule winding);
[RuntimeEnabled=Path2D, StrictTypeChecking] void clip(Path2D path, CanvasWindingRule winding);
// FIXME: Simplify these using optional CanvasWindingRule once crbug.com/339000 gets fixed.
boolean isPointInPath(float x, float y);
[RuntimeEnabled=Path2D, RaisesException] boolean isPointInPath(Path2D? path, float x, float y);
boolean isPointInPath(float x, float y, CanvasWindingRule winding);
[RuntimeEnabled=Path2D, RaisesException] boolean isPointInPath(Path2D? path, float x, float y, CanvasWindingRule winding);
[RuntimeEnabled=Path2D, StrictTypeChecking] boolean isPointInPath(Path2D path, float x, float y);
[StrictTypeChecking] boolean isPointInPath(float x, float y, CanvasWindingRule winding);
[RuntimeEnabled=Path2D, StrictTypeChecking] boolean isPointInPath(Path2D path, float x, float y, CanvasWindingRule winding);
boolean isPointInStroke(float x, float y);
[RuntimeEnabled=Path2D, RaisesException] boolean isPointInStroke(Path2D? path, float x, float y);
[RuntimeEnabled=Path2D, StrictTypeChecking] boolean isPointInStroke(Path2D path, float x, float y);
[RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView();
[RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void scrollPathIntoView(Path2D? path);
[RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] void scrollPathIntoView(Path2D path);
// text
attribute DOMString font;
......
......@@ -49,17 +49,13 @@ public:
const Path& path() const { return m_path; }
void addPath(Path2D* path, ExceptionState& exceptionState)
void addPath(Path2D* path)
{
addPath(path, 0, exceptionState);
addPath(path, 0);
}
void addPath(Path2D* path, SVGMatrixTearOff* transform, ExceptionState& exceptionState)
void addPath(Path2D* path, SVGMatrixTearOff* transform)
{
if (!path) {
exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(1, "Path"));
return;
}
Path src = path->path();
m_path.addPath(src, transform ? transform->value() : AffineTransform(1, 0, 0, 1, 0, 0));
}
......
......@@ -33,7 +33,7 @@
Constructor(DOMString text)
] interface Path2D {
[RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void addPath(Path2D? path, optional SVGMatrix? transform);
[RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] void addPath(Path2D path, optional SVGMatrix? transform);
};
Path2D implements CanvasPathMethods;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment