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 27543 - Request's constructor's step to initialize "mode" needs clarification about conversion from string
Summary: Request's constructor's step to initialize "mode" needs clarification about c...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: Fetch (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+fetchspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-09 07:34 UTC by Takeshi Yoshino
Modified: 2014-12-10 17:52 UTC (History)
1 user (show)

See Also:


Attachments

Description Takeshi Yoshino 2014-12-09 07:34:27 UTC

    
Comment 1 Takeshi Yoshino 2014-12-09 07:37:49 UTC
Allowed values for "init's mode" are strings of "same-origin", "no-cors", "cors". Allowed values for a request's associated mode are constants defined in the spec of same-origin, no CORS, CORS, and CORS-with-forced-preflight.

Like the definition of the mode attribute's getter (https://fetch.spec.whatwg.org/#dom-request-mode), the constructor's algorithm should also define the conversion clearly.
Comment 2 Takeshi Yoshino 2014-12-09 07:40:50 UTC
BTW, is there any reason why there's no hyphen in the identifier of spec constants "no CORS" and "force cache"? Just historical?
Comment 3 Anne 2014-12-10 17:49:37 UTC
https://github.com/whatwg/fetch/commit/174a674d250d9a07d61209d06bec87bc729e4c7a

The reason there's no hyphen there is because no hyphen is required there in the English language, to my knowledge.

Perhaps I should give up on naming internal states slightly differently from enumerations though. Or perhaps IDL should provide this mapping automatically for us (i.e. define what language to use in prose that makes it clear they are the same).
Comment 4 Anne 2014-12-10 17:52:56 UTC
I filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=27557 to sort out whether IDL can do something here that makes this easier for us.