/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; /** * * @param {String} groupID * @param {String} eventType * @param {Function} condition: Optional function that takes a Window as parameter. When * passed, the event will only be included if the result of the function * call is `true` (See `getAvailableEventBreakpoints`). * @returns {Object} */ function generalEvent(groupID, eventType, condition) { return { id: `event.${groupID}.${eventType}`, type: "event", name: eventType, message: `DOM '${eventType}' event`, eventType, // DOM Events which may fire on the global object, or on DOM Elements targetTypes: ["global", "node"], condition, }; } function nodeEvent(groupID, eventType) { return { ...generalEvent(groupID, eventType), targetTypes: ["node"], }; } function mediaNodeEvent(groupID, eventType) { return { ...generalEvent(groupID, eventType), targetTypes: ["node"], // Media events need some specific handling in `eventBreakpointForNotification()` // to ensure that the event is fired on either