fix(webapi): correct binding nullability and exception contracts [Codex] - #349
fix(webapi): correct binding nullability and exception contracts [Codex]#349jderochervlk wants to merge 4 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a11e7cfb79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbe9c53735
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Problem
Several Web API bindings did not accurately represent browser behavior. Nullable and optional values were modeled inconsistently, synchronous operations that can throw were missing exception annotations, and
HTMLElement.hiddenexposed a mutable field without representing theuntil-foundstate or the native setter's coercion behavior.These mismatches made some valid browser states difficult to express and allowed callers to assume values were present when the platform can return
nullorundefined.Solution
Align the affected bindings with their Web IDL contracts. The updated types distinguish null-only values from values that may be either
nullorundefined, expose synchronous exceptions through@throws(JsExn), and modelHTMLElement.hiddenwith semantic states plus an explicit raw setter for native coercion cases.Changes
@throws(JsExn)to synchronous bindings that can raise JavaScript or DOM exceptions.HTMLElement.hiddenState, typedhiddenandsetHiddenbindings, andsetHiddenRawfor the complete native setter contract. The typed accessors are also available through the concrete HTML element modules.HTMLElement.hiddencontract.Migration
Use
HTMLElement.hiddenfor typed reads.HTMLElement.setHiddenRawremains available when the full native setter behavior is required.Stack created with GitHub Stacks CLI • Give Feedback