Skip to content

Guard caniuse table rendering against missing .head dl element - #5374

Open
brian-soltani wants to merge 1 commit into
speced:mainfrom
brian-soltani:patch-1
Open

Guard caniuse table rendering against missing .head dl element#5374
brian-soltani wants to merge 1 commit into
speced:mainfrom
brian-soltani:patch-1

Conversation

@brian-soltani

Copy link
Copy Markdown

run() assumed document.querySelector(".head dl") always finds an element and used optional chaining on headDlElem to avoid crashing when it doesn't. That silently no-ops instead of surfacing the problem, and it still throws later since headDlElem is read unguarded elsewhere in the function.

This adds an early return with a showWarning() call when the .head dl element isn't found, matching the existing pattern used in implementation-status.js, and removes the now-redundant optional chaining on the two remaining headDlElem accesses.

Closes #5370

run() assumed document.querySelector(".head dl") always finds an element and used optional chaining on headDlElem to avoid crashing when it doesn't. That silently no-ops instead of surfacing the problem, and it still throws later since headDlElem is read unguarded elsewhere in the function.

This adds an early return with a showWarning() call when the .head dl element isn't found, matching the existing pattern used in implementation-status.js, and removes the now-redundant optional chaining on the two remaining headDlElem accesses.

Closes speced#5370
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.

core/caniuse silently drops the browser-support table when .head dl is missing

1 participant