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

Fix overrideMimeType() again #174

Merged
merged 3 commits into from
Apr 17, 2018
Merged

Fix overrideMimeType() again #174

merged 3 commits into from
Apr 17, 2018

Conversation

annevk
Copy link
Member

@annevk annevk commented Dec 4, 2017

Reset override MIME type when open() is invoked.

Actually make overriding the charset parameter work (setting override MIME type to the "MIME type portion" (now essence) as done previously would always erase it.

Tests: web-platform-tests/wpt#8449.


Preview | Diff

@annevk
Copy link
Member Author

annevk commented Apr 10, 2018

Need to address the comment in #157 about "get an encoding".

@annevk annevk force-pushed the annevk/overridemimetype-again branch from 35177d8 to 4be5ae5 Compare April 10, 2018 14:39
xhr.bs Outdated
<p>The <dfn id=override-mime-type>override MIME type</dfn> is initially null and can get a value if
{{overrideMimeType()}} is invoked. <dfn id=final-mime-type>Final MIME type</dfn> is the
<p>The <dfn id=override-mime-type>override MIME type</dfn> is initially null and can get a value
when {{overrideMimeType()}} is invoked. <dfn id=final-mime-type>Final MIME type</dfn> is the
Copy link
Member

Choose a reason for hiding this comment

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

Nit: You used "the" for override MIME type but left it out for "final MIME type" and "final charset". (I prefer including it.)

xhr.bs Outdated
<p><dfn id=final-charset>Final charset</dfn> is the return value of these steps:

<ol>
<li><p>Let <var>label<var> be null.
Copy link
Member

Choose a reason for hiding this comment

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

Missing / in </var>

xhr.bs Outdated
<a>override charset</a> to its value.
<li><p>If <a>override MIME type</a> is failure, then set <a>override MIME type</a> to a new
<a>MIME type</a> whose <a for="MIME type">type</a> is "<code>application</code>" and
<a for="MIME type">subtype</a> is "<code>octet-stream</code>".
Copy link
Member

Choose a reason for hiding this comment

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

You could probably also use the literal syntax here (even though it doesn't really exist).

<a>MIME type portion</a>.
<!-- XXX Ignore string to byte sequence conversion issues until some point in the future -->
<li><p>Set <a>override MIME type</a> to the result of <a lt="parse a MIME type">parsing</a>
<var>mime</var>.
Copy link
Member

Choose a reason for hiding this comment

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

This no longer throws out all the parameters. I think that is observable using e.g. a Blob response's type.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's intentional (and tested).

annevk added 3 commits April 16, 2018 11:55
Reset override MIME type when open() is invoked.

Actually make overriding the charset parameter work (setting override MIME type to the "MIME type portion" (now essence) as done previously would always erase it.

Tests: web-platform-tests/wpt#8449.
@annevk annevk force-pushed the annevk/overridemimetype-again branch from 6a88bef to 80dcbba Compare April 16, 2018 09:55
@annevk
Copy link
Member Author

annevk commented Apr 17, 2018

annevk added a commit to web-platform-tests/wpt that referenced this pull request Apr 17, 2018
@annevk annevk merged commit 121cee5 into master Apr 17, 2018
@annevk annevk deleted the annevk/overridemimetype-again branch April 17, 2018 08:54
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 26, 2018
…) tests, a=testonly

Automatic update from web-platform-testsAdd more XMLHttpRequest overrideMimeType() tests

For whatwg/xhr#157, whatwg/xhr#174, and whatwg/mimesniff#42.
--

wpt-commits: ae41496630ba35cff974877498383f1280ca07c2
wpt-pr: 8449
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 2, 2019
…) tests, a=testonly

Automatic update from web-platform-testsAdd more XMLHttpRequest overrideMimeType() tests

For whatwg/xhr#157, whatwg/xhr#174, and whatwg/mimesniff#42.
--

wpt-commits: ae41496630ba35cff974877498383f1280ca07c2
wpt-pr: 8449

UltraBlame original commit: a743786f569a9e77f8c86a2882abee702f58f981
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…) tests, a=testonly

Automatic update from web-platform-testsAdd more XMLHttpRequest overrideMimeType() tests

For whatwg/xhr#157, whatwg/xhr#174, and whatwg/mimesniff#42.
--

wpt-commits: ae41496630ba35cff974877498383f1280ca07c2
wpt-pr: 8449

UltraBlame original commit: a743786f569a9e77f8c86a2882abee702f58f981
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…) tests, a=testonly

Automatic update from web-platform-testsAdd more XMLHttpRequest overrideMimeType() tests

For whatwg/xhr#157, whatwg/xhr#174, and whatwg/mimesniff#42.
--

wpt-commits: ae41496630ba35cff974877498383f1280ca07c2
wpt-pr: 8449

UltraBlame original commit: a743786f569a9e77f8c86a2882abee702f58f981
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.

2 participants