| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
| 3 <svg> | 3 <svg> |
| 4 <circle></circle> | 4 <circle></circle> |
| 5 <text></text> | 5 <text></text> |
| 6 </svg> | 6 </svg> |
| 7 <script> | 7 <script> |
| 8 description( | 8 description( |
| 9 'Check that |undefined| and |null| arguments do not cause crashes, ' + | 9 'Check that |undefined| and |null| arguments do not cause crashes, ' + |
| 10 'but do throw exceptions.'); | 10 'but do throw exceptions.'); |
| 11 | 11 |
| 12 var svg = document.querySelector('svg'); | 12 var svg = document.querySelector('svg'); |
| 13 var circle = document.querySelector('circle'); | 13 var circle = document.querySelector('circle'); |
| 14 var text = document.querySelector('text'); | 14 var text = document.querySelector('text'); |
| 15 | 15 |
| 16 var matrix = svg.createSVGMatrix(); | 16 var matrix = svg.createSVGMatrix(); |
| 17 var point = svg.createSVGPoint(); | 17 var point = svg.createSVGPoint(); |
| 18 var rect = svg.createSVGRect(); | 18 var rect = svg.createSVGRect(); |
| 19 | 19 |
| 20 | 20 |
| 21 debug('SVGGeometryElement'); | 21 debug('SVGGeometryElement'); |
| 22 // SVGGeometryElement is an abstract class: instantiate object of derived class | 22 // SVGGeometryElement is an abstract class: instantiate object of derived class |
| 23 | 23 |
| 24 debug(''); | 24 debug(''); |
| 25 debug('isPointInFill(SVGPoint point)'); | 25 debug('isPointInFill(SVGPoint point)'); |
| 26 shouldNotThrow('circle.isPointInFill(point)'); | 26 shouldNotThrow('circle.isPointInFill(point)'); |
| 27 // shouldThrow('circle.isPointInFill(undefined)'); // CRASH | 27 shouldThrow('circle.isPointInFill(undefined)'); |
| 28 // shouldThrow('circle.isPointInFill(null)'); // CRASH | 28 shouldThrow('circle.isPointInFill(null)'); |
| 29 | 29 |
| 30 debug(''); | 30 debug(''); |
| 31 debug('isPointInStroke(SVGPoint point)'); | 31 debug('isPointInStroke(SVGPoint point)'); |
| 32 shouldNotThrow('circle.isPointInStroke(point)'); | 32 shouldNotThrow('circle.isPointInStroke(point)'); |
| 33 // shouldThrow('circle.isPointInStroke(undefined)'); // CRASH | 33 shouldThrow('circle.isPointInStroke(undefined)'); |
| 34 // shouldThrow('circle.isPointInStroke(null)'); // CRASH | 34 shouldThrow('circle.isPointInStroke(null)'); |
| 35 | 35 |
| 36 | 36 |
| 37 debug(''); | 37 debug(''); |
| 38 debug(''); | 38 debug(''); |
| 39 debug('SVGSVGElement'); | 39 debug('SVGSVGElement'); |
| 40 | 40 |
| 41 debug(''); | 41 debug(''); |
| 42 debug('getIntersectionList(SVGRect rect, SVGElement? referenceElement)'); | 42 debug('getIntersectionList(SVGRect rect, SVGElement? referenceElement)'); |
| 43 shouldNotThrow('svg.getIntersectionList(rect, svg)'); | 43 shouldNotThrow('svg.getIntersectionList(rect, svg)'); |
| 44 // shouldThrow('svg.getIntersectionList(undefined, svg)'); // CRASH | 44 shouldThrow('svg.getIntersectionList(undefined, svg)'); |
| 45 shouldThrow('svg.getIntersectionList(null, svg)'); | 45 shouldThrow('svg.getIntersectionList(null, svg)'); |
| 46 shouldNotThrow('svg.getIntersectionList(rect, undefined)'); | 46 shouldNotThrow('svg.getIntersectionList(rect, undefined)'); |
| 47 shouldNotThrow('svg.getIntersectionList(rect, null)'); | 47 shouldNotThrow('svg.getIntersectionList(rect, null)'); |
| 48 | 48 |
| 49 debug(''); | 49 debug(''); |
| 50 debug('getEnclosureList(SVGRect rect, SVGElement? referenceElement)'); | 50 debug('getEnclosureList(SVGRect rect, SVGElement? referenceElement)'); |
| 51 shouldNotThrow('svg.getEnclosureList(rect, svg)'); | 51 shouldNotThrow('svg.getEnclosureList(rect, svg)'); |
| 52 // shouldThrow('svg.getEnclosureList(undefined, svg)'); // CRASH | 52 shouldThrow('svg.getEnclosureList(undefined, svg)'); |
| 53 shouldThrow('svg.getEnclosureList(null, svg)'); | 53 shouldThrow('svg.getEnclosureList(null, svg)'); |
| 54 shouldNotThrow('svg.getEnclosureList(rect, undefined)'); | 54 shouldNotThrow('svg.getEnclosureList(rect, undefined)'); |
| 55 shouldNotThrow('svg.getEnclosureList(rect, null)'); | 55 shouldNotThrow('svg.getEnclosureList(rect, null)'); |
| 56 | 56 |
| 57 debug(''); | 57 debug(''); |
| 58 debug('checkIntersection(SVGElement element, SVGRect rect)'); | 58 debug('checkIntersection(SVGElement element, SVGRect rect)'); |
| 59 shouldNotThrow('svg.checkIntersection(svg, rect)'); | 59 shouldNotThrow('svg.checkIntersection(svg, rect)'); |
| 60 // shouldThrow('svg.checkIntersection(undefined, rect)'); // FAIL | 60 shouldThrow('svg.checkIntersection(undefined, rect)'); |
| 61 shouldThrow('svg.checkIntersection(null, rect)'); | 61 shouldThrow('svg.checkIntersection(null, rect)'); |
| 62 // shouldThrow('svg.checkIntersection(svg, undefined)'); // CRASH | 62 shouldThrow('svg.checkIntersection(svg, undefined)'); |
| 63 shouldThrow('svg.checkIntersection(svg, null)'); | 63 shouldThrow('svg.checkIntersection(svg, null)'); |
| 64 | 64 |
| 65 debug(''); | 65 debug(''); |
| 66 debug('checkEnclosure(SVGElement element, SVGRect rect)'); | 66 debug('checkEnclosure(SVGElement element, SVGRect rect)'); |
| 67 shouldNotThrow('svg.checkEnclosure(svg, rect)'); | 67 shouldNotThrow('svg.checkEnclosure(svg, rect)'); |
| 68 // shouldThrow('svg.checkEnclosure(undefined, rect)'); // FAIL | 68 shouldThrow('svg.checkEnclosure(undefined, rect)'); |
| 69 shouldThrow('svg.checkEnclosure(null, rect)'); | 69 shouldThrow('svg.checkEnclosure(null, rect)'); |
| 70 // shouldThrow('svg.checkEnclosure(svg, undefined)'); // CRASH | 70 shouldThrow('svg.checkEnclosure(svg, undefined)'); |
| 71 shouldThrow('svg.checkEnclosure(svg, null)'); | 71 shouldThrow('svg.checkEnclosure(svg, null)'); |
| 72 | 72 |
| 73 debug(''); | 73 debug(''); |
| 74 debug('SVGTransform createSVGTransformFromMatrix([Default=Undefined] optional SV
GMatrix matrix)'); | 74 debug('SVGTransform createSVGTransformFromMatrix([Default=Undefined] optional SV
GMatrix matrix)'); |
| 75 // shouldNotThrow('svg.createSVGTransformFromMatrix()'); // FAIL | 75 // shouldNotThrow('svg.createSVGTransformFromMatrix()'); // FAIL |
| 76 shouldNotThrow('svg.createSVGTransformFromMatrix(matrix)'); | 76 shouldNotThrow('svg.createSVGTransformFromMatrix(matrix)'); |
| 77 shouldThrow('svg.createSVGTransformFromMatrix(undefined)'); | 77 shouldThrow('svg.createSVGTransformFromMatrix(undefined)'); |
| 78 shouldThrow('svg.createSVGTransformFromMatrix(null)'); | 78 shouldThrow('svg.createSVGTransformFromMatrix(null)'); |
| 79 | 79 |
| 80 | 80 |
| 81 debug(''); | 81 debug(''); |
| 82 debug(''); | 82 debug(''); |
| 83 debug('SVGTextContentElement'); | 83 debug('SVGTextContentElement'); |
| 84 | 84 |
| 85 debug(''); | 85 debug(''); |
| 86 debug('getCharNumAtPosition(SVGPoint point)'); | 86 debug('getCharNumAtPosition(SVGPoint point)'); |
| 87 shouldNotThrow('text.getCharNumAtPosition(point)'); | 87 shouldNotThrow('text.getCharNumAtPosition(point)'); |
| 88 // shouldThrow('text.getCharNumAtPosition(undefined)'); // CRASH | 88 shouldThrow('text.getCharNumAtPosition(undefined)'); |
| 89 shouldThrow('text.getCharNumAtPosition(null)'); | 89 shouldThrow('text.getCharNumAtPosition(null)'); |
| 90 | 90 |
| 91 </script> | 91 </script> |
| OLD | NEW |