这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@maranomynet
Copy link

It may come up that multiple scripts import or load the polyfill into the same document.

In such cases we want to ensure the polyfill only runs once.

It may come up that multiple scripts import or load the polyfill into the same document.

In such cases we want to ensure the polyfill only runs once.
Comment on lines -298 to -300
}

if (typeof document !== 'undefined') {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming these conditional blocks can be safely joined, for simplicity+brevity

// these checks to support server-side rendering use cases
// @see https://github.com/WICG/focus-visible/issues/199
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
if (typeof window !== 'undefined' && typeof document !== 'undefined' && !window.applyFocusVisiblePolyfill) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking for applyFocusVisiblePolyfill is sufficiently safe as the function is always run right after it's assignment into the global Window scope

@yoavweiss
Copy link
Contributor

@maranomynet - can you join the WICG to appease the IPR bots?

@maranomynet
Copy link
Author

maranomynet commented Nov 5, 2020

I've ventured down that rabbit hole of bad onboarding UX, and emerged mostly unscathed.

  • IPR bots appeased

@yoavweiss yoavweiss changed the base branch from master to main March 5, 2021 21:37
@maranomynet
Copy link
Author

Any chance of seeing this merged?

@maranomynet
Copy link
Author

I can't believe it's been three years already. Time flies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants