4 ms·
DOM events do form an inheritance hierarchy. For example, TouchEvent and MouseEvent both inherit from UIEvent. But for compatibility reasons, we can't make ar
by mbrubeck 12y ago
DOM events do form an inheritance hierarchy. For example, TouchEvent and MouseEvent both inherit from UIEvent.
But for compatibility reasons, we can't make arbitrary changes to legacy APIs. So rather than, say, change MouseEvent to be a subtype of PointerEvent, we have to do the reverse and have PointerEvent extend MouseEvent.
- nevir 12y agoOr introduce a whole new hierarchy.