迷渡
迷渡
@scutHuqiang 如果浏览器支持,那么 `supportsPassive = true;` 就会执行;如果浏览器不支持,则这段代码就不执行。
@erguotou520 当 Promise 发生异常后,会从 `.then` 链进入到 `.catch` 链, 不过 Promise 链结束后依然存在异常,既Promise 依然是 reject 状态,Promise 坐在函数会 throw 一个 `uncaughtException` 异常,此异常一层一层向外传播,如果所有函数都没有捕获,则在 devtools 的 console 输出此错误。  ### 相关阅读 - tc39/ecmascript-asyncawait#72 - nodejs/node#830...
https://drafts.csswg.org/css-writing-modes-4/#inline-base-direction
这个也在计划之中: > 如果跨域的请求不是**简单请求**,就会发送 options 请求。 - [HTTP access control (CORS) - MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) - [HTTP访问控制(CORS)- MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS)
> 若请求满足所有下述条件,则该请求可视为“简单请求”: > > 1. 使用下列方法之一: > - GET > - HEAD > - POST > 2. Fetch 规范定义了对 CORS 安全的首部字段集合,不得人为设置该集合之外的其他首部字段。该集合为: > - Accept > - Accept-Language > - Content-Language...
https://csstriggers.com
@kuangyazhou 这个网站是 Paul 和 Surma 开发的,我一直关注他俩。
有 polyfill
`IntersectionObservers` 的回调是异步执行的,但是也提供了同步调用的方法 [`IntersectionObserver.takeRecords()`](https://developer.mozilla.org/zh-CN/docs/Web/API/IntersectionObserver/takeRecords)。 每一个 [`IntersectionObserverEntry`](https://wicg.github.io/IntersectionObserver/#intersection-observer-entry) 都是 [[[QueuedEntries]]](https://wicg.github.io/IntersectionObserver/#dom-intersectionobserver-queuedentries-slot)。当观察到交互动作发生时,回调函数并不会立即执行,而是在空闲时期使用 `requestIdleCallback` 来异步执行回调函数,而且还规定了最大的延迟时间是 100 毫秒(???),相当于我么你的代码 1-100 毫秒内执行。 我们可以看一下 [polyfill](https://github.com/WICG/IntersectionObserver/blob/gh-pages/polyfill/intersection-observer.js#L116-L121) 的实现: > To enable polling for all instance, set a value for `POLL_INTERVAL` on the...