{"id":13527639,"url":"https://github.com/WICG/EventListenerOptions","last_synced_at":"2025-04-01T09:31:50.989Z","repository":{"id":34524126,"uuid":"38466530","full_name":"WICG/EventListenerOptions","owner":"WICG","description":"An extension to the DOM event pattern to allow authors to disable support for preventDefault","archived":true,"fork":false,"pushed_at":"2018-03-12T16:11:51.000Z","size":90,"stargazers_count":1168,"open_issues_count":8,"forks_count":139,"subscribers_count":60,"default_branch":"gh-pages","last_synced_at":"2025-01-17T18:44:41.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WICG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-03T02:01:42.000Z","updated_at":"2025-01-13T18:42:14.000Z","dependencies_parsed_at":"2022-08-08T01:15:10.793Z","dependency_job_id":null,"html_url":"https://github.com/WICG/EventListenerOptions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WICG%2FEventListenerOptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WICG%2FEventListenerOptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WICG%2FEventListenerOptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WICG%2FEventListenerOptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WICG","download_url":"https://codeload.github.com/WICG/EventListenerOptions/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246616249,"owners_count":20806092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:55.101Z","updated_at":"2025-04-01T09:31:50.663Z","avatar_url":"https://github.com/WICG.png","language":"JavaScript","readme":"# Passive Event Listeners (EventListenerOptions)\n\nThis work is now part of the [official WHATWG DOM spec](https://github.com/whatwg/dom). Please file any issues/pull requests there. This repository (and its resources / discussions) are only preserved here as an archive.\n\n---\n\nAn [extension](https://dom.spec.whatwg.org/#dictdef-eventlisteneroptions) to the DOM event pattern to allow listeners to disable support for `preventDefault`, primarily to enable scroll performance optimizations.  See the [**explainer document**](https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md) for an overview.\n\n#### Spec changes\n * See the main [commit in the DOM specification](https://github.com/whatwg/dom/commit/253a21b8e78e37447c47983916a7cf39c4f6a3c5) or [pull request](https://github.com/whatwg/dom/pull/82) for full details.\n * The key parts of the spec affected by this are [EventTarget](https://dom.spec.whatwg.org/#eventtarget), [Observing event listeners](https://dom.spec.whatwg.org/#observing-event-listeners), and [preventDefault](https://dom.spec.whatwg.org/#dom-event-preventdefault)\n * Touch Events has [been updated](http://w3c.github.io/touch-events/#cancelability) to describe the performance optimization.\n * [Interventions issue 18](https://github.com/WICG/interventions/issues/18) tracks the plan to \"[intervene](bit.ly/user-agent-intervention)\" and force touch listeners to be passive in scenarios where the compat risk is low but the perf benefit large.\n \n#### Status of implementations:\n * See [CanIUse entry for passive event listeners](http://caniuse.com/#feat=passive-event-listener)\n * Chromium: [shipping](https://www.chromestatus.com/features/5745543795965952) in Chrome 51 ([launch bug](https://bugs.chromium.org/p/chromium/issues/detail?id=489802))\n   * [Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=599609) tracking the [next step](https://github.com/WICG/interventions/issues/18) of automatically opting some listeners into passive behavior.\n * WebKit: [EventListenerOptions support](https://bugs.webkit.org/show_bug.cgi?id=149466) and [performance optimization for touch listeners](https://bugs.webkit.org/show_bug.cgi?id=158601) landed.\n   * [Performance optimization of wheel listeners](https://bugs.webkit.org/show_bug.cgi?id=158439) not yet implemented. \n * Firefox: [Landed](https://bugzilla.mozilla.org/show_bug.cgi?id=1266066) - planned to [ship in Firefox 49](https://platform-status.mozilla.org/#passive-event-listeners)\n * [DOM4 Polyfill](https://github.com/WebReflection/dom4), or sample [polyfill here](EventListenerOptions.polyfill.js)\n\n#### Additional background on the problem:\n * [Summary from Google I/O 2016 Mobile Web talk](https://youtu.be/0SSI8liELJU?t=6m20s)\n * [Ilya Grigorik's talk at Chrome Dev Summit](https://www.youtube.com/watch?v=NrEjkflqPxQ\u0026feature=youtu.be\u0026t=557) [[slides](https://docs.google.com/presentation/d/1WdMyLpuI93TR_w0fvKqFlUGPcLk3A4UJ2sBuUkeFcwU/present?slide=id.g7299ef155_0_7)]\n * [Discussion on twitter](https://twitter.com/RickByers/status/719736672523407360) with [demo video](https://www.youtube.com/watch?v=NPM6172J22g)\n * [Demo page with latency measurement](https://rbyers.github.io/scroll-latency.html)\n * Older [G+ post by Rick Byers](https://plus.google.com/+RickByers/posts/cmzrtyBYPQc)\n\n#### Additional resources for understaning and using passive listeners\n  * [Tips for debugging scroll jank screencast](https://www.youtube.com/watch?v=6-D_3yx_KVI)\n\n#### Issues with and adoption by key libraries:\n  * [Feature detect in Modernizr](https://github.com/Modernizr/Modernizr/blob/master/feature-detects/dom/passiveeventlisteners.js) ([issue](https://github.com/Modernizr/Modernizr/issues/1894)) \n  * [Parse.ly](https://github.com/Parsely/time-engaged/issues/3)\n  * [jQuery](https://github.com/jquery/jquery/issues/2871)\n  * [Ember.js](https://github.com/emberjs/ember.js/issues/12783)\n\n#### History:\n * [Outstanding issues](https://github.com/WICG/EventListenerOptions/issues?q=is%3Aissue)\n * [WICG discussion](https://discourse.wicg.io/t/eventlisteneroptions-and-passive-event-listeners-move-to-wicg/1386/13)\n * [Discussion on WhatWG](https://lists.w3.org/Archives/Public/public-whatwg-archive/2015Jul/0018.html)\n * One [discussion on public-pointer-events](https://lists.w3.org/Archives/Public/public-pointer-events/2015AprJun/0042.html)\n * Earlier [scroll-blocks-on proposal](https://docs.google.com/document/d/1aOQRw76C0enLBd0mCG_-IM6bso7DxXwvqTiRWgNdTn8/edit#heading=h.wi06xpj70hhd) and discussion\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWICG%2FEventListenerOptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWICG%2FEventListenerOptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWICG%2FEventListenerOptions/lists"}