This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19796 - Clarify language related to algorithm parameters
Summary: Clarify language related to algorithm parameters
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: MIME (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Gordon P. Hemsley
QA Contact: sideshowbarker+mimespec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-31 18:47 UTC by Ian 'Hixie' Hickson
Modified: 2012-11-08 19:47 UTC (History)
3 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2012-10-31 18:47:49 UTC
"The following flags are used in the media type sniffing algorithm and must be unset by default [...] User agents may explicitly set one or more of these flags when calling the media type sniffing algorithm" is meaningless. The must is completely overridden by the may, and the result is that there are no conformance criteria: browsers can do what they like.

That doesn't make any sense.
Comment 1 Gordon P. Hemsley 2012-10-31 19:37:32 UTC
So, the algorithm has a set of flags (parameters) that can be mentioned (or not) when the algorithm is called. If they are mentioned, they can be set or unset. However, if they are not mentioned, they are unset by default.

How should I rephrase to get that meaning across?
Comment 2 Ian 'Hixie' Hickson 2012-10-31 22:18:49 UTC
Well first of all I don't recommend that approach in this case since as far as I can tell, none of the callers need that much flexibility.

But.

If you'd want to do it that way, just say something like:

"When a user agent is to run the foo algorithm, it must run the following steps. These steps can be invoked with a bar flag, a baz flag, and/or a quux flag." Or some such.

In your current text, "User agents may" is a conformance criteria that isn't (presumably) what you mean (user agents aren't allowed to do that unless the specs say they are required to do that), and "must be unset by default" doesn't really mean anything (how would you test if they are unset by default or explicitly or anything else?).

Check out some of the algorithms in the HTML spec for more inspiration (though note that they're not all well done; feel free to file bugs on ambiguous ones).
Comment 3 Gordon P. Hemsley 2012-11-08 19:47:00 UTC
Fixed:

https://github.com/whatwg/mimesniff/commit/082f1ee67d1952d63334f4b855fb420c454ec205

Note: As a part of this change, I introduced the concept of a "configurable flag". I didn't check to see if this concept is defined elsewhere, but I do think it would be an appropriate inclusion in the future spec that defines common terminology.