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

editorial: make Blob.slice a separate algorithm #183

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

dlrobertson
Copy link
Member

@dlrobertson dlrobertson commented Nov 10, 2022

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

@dlrobertson
Copy link
Member Author

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).

@dlrobertson
Copy link
Member Author

I don't think this is substantive, but if this is considered to be substantive, I can create a w3c account.

Copy link
Collaborator

@mkruisselbrink mkruisselbrink left a 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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<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>,
Copy link
Collaborator

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.

Suggested change
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>,

Copy link
Member

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.
Copy link
Member Author

@dlrobertson dlrobertson left a 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.

@w3cbot
Copy link

w3cbot commented Nov 14, 2022

mkruisselbrink marked as non substantive for IPR from ash-nazg.

@mkruisselbrink mkruisselbrink merged commit 3ee8d23 into w3c:main Nov 14, 2022
github-actions bot added a commit that referenced this pull request Nov 14, 2022
SHA: 3ee8d23
Reason: push, by mkruisselbrink

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@dlrobertson dlrobertson deleted the slice-blob branch November 14, 2022 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants