-
Notifications
You must be signed in to change notification settings - Fork 44
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
editorial: make Blob.slice a separate algorithm #183
Conversation
Just a first pass at the moment. Still likely have a good bit of cleanup to do. Originally I wanted a normalize range and a slice bytes algorithm, but after further reading I think its probably easier to just bundle all of it in one algorithm (especially since slice bytes is really only one line in the algorithm). |
I don't think this is substantive, but if this is considered to be substantive, I can create a w3c account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, just two minor points. I agree that just moving stuff around like this is probably not substantive. I really need to get around to rewriting splice more formally at some point, but that is unrelated to this.
index.bs
Outdated
1. Return a new {{Blob}} object <var>S</var> with the following characteristics: | ||
|
||
<ol type="a"> | ||
<li><var>S</var> refers to <var>span</var> consecutive <a>byte</a>s from <var>blob</var>'s, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<li><var>S</var> refers to <var>span</var> consecutive <a>byte</a>s from <var>blob</var>'s, | |
<li><var>S</var> refers to <var>span</var> consecutive <a>byte</a>s from <var>blob</var>'s |
index.bs
Outdated
@@ -193,6 +193,75 @@ The term <dfn id="UnixEpoch">Unix Epoch</dfn> is used in this specification to r | |||
(or 1970-01-01T00:00:00Z ISO 8601); | |||
this is the same time that is conceptually "<code>0</code>" in ECMA-262 [[ECMA-262]]. | |||
|
|||
<div algorithm> | |||
The <dfn id="slice-blob">slice blob</dfn> algorithm given a {{Blob}} <var>blob</var>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want this to be exported so you can reference it from fetch? And this should probably be an abstract-op, and I don't think it needs an explicit ID.
The <dfn id="slice-blob">slice blob</dfn> algorithm given a {{Blob}} <var>blob</var>, | |
The <dfn abstract-op export>slice blob</dfn> algorithm given a {{Blob}} <var>blob</var>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be an abstract-op (that's mainly JS stuff, all our algorithms are the default dfn most of the time), but you're right that relying on the generated ID is fine.
Split out Blob.slice into its own algorithm that other implementations may use and call this algorithm from Blob.slice.
eadf782
to
4b840e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comments! Fixed the remaining build errors and made the suggested changes.
mkruisselbrink marked as non substantive for IPR from ash-nazg. |
SHA: 3ee8d23 Reason: push, by mkruisselbrink Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Split out Blob.slice into its own algorithm that other implementations may use and call this algorithm from Blob.slice.
Related to: whatwg/fetch#1070
Preview | Diff