Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not initialize members to null in "process a URLPatternInit" #212

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

jeremyroman
Copy link
Collaborator

@jeremyroman jeremyroman commented Jan 26, 2024

It is not valid for these dictionary members to be null, since they are defined to, if present, hold a USVString value. Instead, these should be omitted from the result dictionary altogether if no string was provided to this algorithm.

This addresses the concern raised in #202 (comment).

  • At least two implementers are interested (and none opposed):
    • Google Chrome
    • n/a (change is simply fixing a bug in a non-controversial way, per this comment)
  • Tests are written and can be reviewed and commented upon at:
    • n/a (this is a fix to how the spec expresses this, but does not represent a behavior change, and existing tests cover this behavior)
  • Implementation bugs are filed:
    • Chromium: n/a (believed to work correctly in Chromium)
    • Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1731418 (vendor does not yet implement the spec)
    • WebKit: [no known URLPattern bug] (vendor does not yet implement the spec)
    • Deno: n/a (no reason to believe a change is required)
    • kenchris/urlpattern-polyfill: n/a (no reason to believe a change is required)
  • MDN issue is filed: n/a (change is on a spec detail not expressly documented)
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


💥 Error: 400 Bad Request 💥

PR Preview failed to build. (Last tried on Jan 26, 2024, 5:02 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 CSS Spec Preprocessor - CSS Spec Preprocessor is the web service used to build Bikeshed specs.

🔗 Related URL

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

It is not valid for these dictionary members to be null, since they are
defined to, if present, hold a USVString value. Instead, these should be
omitted from the result dictionary altogether if no string was provided
to this algorithm.
@sisidovski
Copy link
Collaborator

Thanks! It looks the PR preview failed to build. Could you try the build again?

@jeremyroman
Copy link
Collaborator Author

Copy link
Collaborator

@sisidovski sisidovski left a comment

Choose a reason for hiding this comment

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

After this change, the result of process a URLPatternInit may not have corresponding keys. We don't set null to map entires.

Basically LGTM but let me ask a beginner question. Accessing to the absent key to the map is considered as null? In initialize, there're some steps calling complie a compoennt with map entries. In the step 1 in "compile a component", the input is expected to be null.

Copy link
Collaborator

@sisidovski sisidovski left a comment

Choose a reason for hiding this comment

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

#214 clarified my previous comment. LGTM

@jeremyroman
Copy link
Collaborator Author

It is an assertion failure to get an entry from a map that it does not contain. https://infra.spec.whatwg.org/#map-get

@jeremyroman jeremyroman merged commit 5ce2f70 into whatwg:main Jan 30, 2024
2 checks passed
@jeremyroman jeremyroman deleted the process-urlpatterninit-null branch January 30, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants