Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
First parameter to SVGDocument.createEvent() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=160296 Reviewed by Alex Christensen. Source/WebCore: First parameter to SVGDocument.createEvent() should be mandatory: - https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions - https://dom.spec.whatwg.org/#document This patch drops createEvent() from SVGDocument so that the spec-compliant Document.createEvent() is used instead. In the specification, SVGDocument no longer exists and is a simple Document. Firefox and Chrome agree with the specification. Test: svg/dom/SVGDocument-createEvent.html * svg/SVGDocument.idl: LayoutTests: Add test coverage. * svg/dom/SVGDocument-createEvent-expected.txt: Added. * svg/dom/SVGDocument-createEvent.html: Added. Canonical link: https://commits.webkit.org/178449@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Test SVGDocument.createEvent() operation. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS svgDocument.createEvent() threw exception TypeError: Not enough arguments. | ||
PASS event = svgDocument.createEvent('mouseevent') did not throw exception. | ||
PASS event.__proto__ is MouseEvent.prototype | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
<script> | ||
description("Test SVGDocument.createEvent() operation."); | ||
|
||
var svgDocument = document.implementation.createDocument("http://www.w3.org/2000/svg", "svg"); | ||
shouldThrow("svgDocument.createEvent()", "'TypeError: Not enough arguments'"); | ||
shouldNotThrow("event = svgDocument.createEvent('mouseevent')"); | ||
shouldBe("event.__proto__", "MouseEvent.prototype"); | ||
|
||
</script> | ||
<script src="../../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