Skip to content

Commit

Permalink
Update the createEvent() events table
Browse files Browse the repository at this point in the history
The latest spec has included a lot more events to the table. This adds all of them that we support.
  • Loading branch information
domenic committed May 6, 2016
1 parent 9384cd0 commit bb23c8f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
35 changes: 22 additions & 13 deletions lib/jsdom/living/nodes/Document-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ const HTMLElement = require("../generated/HTMLElement");
const HTMLUnknownElement = require("../generated/HTMLUnknownElement");
const TreeWalker = require("../generated/TreeWalker");

const CustomEvent = require("../generated/CustomEvent");
const ErrorEvent = require("../generated/ErrorEvent");
const Event = require("../generated/Event");
const HashChangeEvent = require("../generated/HashChangeEvent");
const KeyboardEvent = require("../generated/KeyboardEvent");
const MessageEvent = require("../generated/MessageEvent");
const MouseEvent = require("../generated/MouseEvent");
const PopStateEvent = require("../generated/PopStateEvent");
const ProgressEvent = require("../generated/ProgressEvent");
const TouchEvent = require("../generated/TouchEvent");
const UIEvent = require("../generated/UIEvent");
const MutationEvent = require("../generated/MutationEvent");

function clearChildNodes(node) {
for (let child = domSymbolTree.firstChild(node); child; child = domSymbolTree.firstChild(node)) {
node.removeChild(child);
Expand Down Expand Up @@ -170,27 +183,23 @@ const nonInheritedTags = new Set([
"ruby", "rt", "rp", "code", "var", "samp", "kbd", "i", "b", "u", "mark", "bdi", "bdo", "wbr"
]);

const Event = require("../generated/Event");
const CustomEvent = require("../generated/CustomEvent");
const MessageEvent = require("../generated/MessageEvent");
const UIEvent = require("../generated/UIEvent");
const MouseEvent = require("../generated/MouseEvent");
const KeyboardEvent = require("../generated/KeyboardEvent");
const TouchEvent = require("../generated/TouchEvent");
const MutationEvent = require("../generated/MutationEvent");
const eventInterfaceTable = {
customevent: CustomEvent,
errorevent: ErrorEvent,
event: Event,
events: Event,
hashchangeevent: HashChangeEvent,
htmlevents: Event,
keyboardevent: KeyboardEvent,
messageevent: MessageEvent,
mouseevent: MouseEvent,
mouseevents: MouseEvent,
popstateevent: PopStateEvent,
progressevent: ProgressEvent,
svgevents: Event,
touchevent: TouchEvent,
uievent: UIEvent,
uievents: UIEvent,
messageevent: MessageEvent,

customevent: CustomEvent,
keyboardevent: KeyboardEvent,
touchevent: TouchEvent,

// old, not part of spec anymore
mutationevents: MutationEvent
Expand Down
2 changes: 1 addition & 1 deletion test/web-platform-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("Web Platform Tests", () => {
"dom/traversal/TreeWalker-walking-outside-a-tree.html",
"dom/traversal/TreeWalker.html",
"domparsing/insert-adjacent.html",
"html/browsers/browsing-the-web/history-traversal/PopStateEvent.html",
// "html/browsers/browsing-the-web/history-traversal/PopStateEvent.html", // https://github.com/w3c/web-platform-tests/pull/2964
"html/browsers/browsing-the-web/history-traversal/hashchange_event.html",
"html/browsers/browsing-the-web/history-traversal/popstate_event.html",
// "html/browsers/history/the-history-interface/001.html", // complicated navigation stuff and structured cloning
Expand Down

0 comments on commit bb23c8f

Please sign in to comment.