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

Document what defaults are ok for dictionary values. #1215

Merged
merged 2 commits into from Oct 13, 2022

Conversation

jyasskin
Copy link
Member

@jyasskin jyasskin commented Oct 11, 2022

@domenic
Copy link
Member

domenic commented Oct 12, 2022

This is kind of messy since the section you're modifying is defining the concept of default value, whereas the thing you're referencing is the grammar production for how default values manifest in the syntax. The syntax is discussed below already:

If the identifier is followed by a U+003D EQUALS SIGN ("=") and a value (matching DefaultValue), then that gives the dictionary member its default value.

I assume you're doing this because the existing text was not clear to someone, so that probably means we should try to make default values clearer in some way, but I'm hesitant to do so by duplicating the "what is a default value's syntax" parts of the spec into the semantics parts.

@jyasskin
Copy link
Member Author

Yep, I couldn't find the place that said what defaults were possible without reading the whole dictionaries section. Thanks for pointing it out. This isn't a problem for optional arguments, which don't try to separate their syntax from their semantics. Dictionaries don't really have a separation between syntax and semantics either, so I'd be inclined to move the whole definition of default values down to the place that says what their values can be. Here's that patch in case you agree.

@domenic
Copy link
Member

domenic commented Oct 12, 2022

I suspect I am happy with this, but PR preview is broken because Bikeshed. And that is also breaking the build. So, we'll revisit this at some point...

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

Nice, now that I can see the preview, this looks like a nice improvement.

@domenic domenic merged commit bc7cb7a into whatwg:main Oct 13, 2022
@jyasskin jyasskin deleted the define-default-values branch October 14, 2022 20:33
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.

None yet

2 participants