Skip to content

Commit

Permalink
Revert of XMLHttpRequest::overrideMimeType should throw InvalidStateE…
Browse files Browse the repository at this point in the history
…rror (patchset #4 of https://codereview.chromium.org/478223002/)

Reason for revert:
It looks like this broke a number of Chromium-side browser tests: See http://build.chromium.org/p/chromium.webkit/builders/Linux%20Tests%20%28dbg%29/builds/3608 for example. http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Blink&testType=browser_tests&tests=ExtensionBrowserTest.RSSParseFeedInvalidFeed1,ExtensionBrowserTest.RSSParseFeedInvalidFeed2,ExtensionBrowserTest.RSSParseFeedInvalidFeed3,ExtensionBrowserTest.RSSParseFeedInvalidFeed4,ExtensionBrowserTest.RSSParseFeedValidFeed0,ExtensionBrowserTest.RSSParseFeedValidFeed2,ExtensionBrowserTest.RSSParseFeedValidFeed3,ExtensionBrowserTest.RSSParseFeedValidFeed4,ExtensionBrowserTest.RSSParseFeedValidFeed5,ExtensionBrowserTest.RSSParseFeedValidFeed6,ExtensionBrowserTest.RSSParseFeedValidFeedNoLinks for all the broken tests.

Original issue's description:
> XMLHttpRequest::overrideMimeType should throw InvalidStateError
> 
> Before this CL, XMLHttpRequest accepted |overrideMimeType| regardless
> of its state. This is not conformant to the current spec:
> http://www.w3.org/TR/XMLHttpRequest2/#the-overridemimetype-method
> 
> This CL changes it to throw InvalidStateError when the state
> is LOADING or DONE, which aligns to the spec.
> 
> BUG=402375
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180440

[email protected],[email protected],[email protected],[email protected]
NOTREECHECKS=true
NOTRY=true
BUG=402375

Review URL: https://codereview.chromium.org/486703002

git-svn-id: svn://svn.chromium.org/blink/trunk@180455 bbb929c8-8fbe-4397-9dbb-9b2b20218538
  • Loading branch information
[email protected] committed Aug 18, 2014
1 parent 8e40025 commit d0ad8db
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 56 deletions.

This file was deleted.

This file was deleted.

10 changes: 4 additions & 6 deletions Source/core/xml/XMLHttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,14 +1089,12 @@ void XMLHttpRequest::handleRequestError(ExceptionCode exceptionCode, const Atomi
dispatchProgressEvent(EventTypeNames::loadend, receivedLength, expectedLength);
}

void XMLHttpRequest::overrideMimeType(const AtomicString& mimeType, ExceptionState& exceptionState)
void XMLHttpRequest::overrideMimeType(const AtomicString& override)
{
if (m_state == LOADING || m_state == DONE) {
exceptionState.throwDOMException(InvalidStateError, "MimeType cannot be overridden when the state is LOADING or DONE.");
return;
}
// FIXME: This method must throw an InvalidStateError exception when the
// XHR is in the LOADING or DONE state. http://crbug.com/402375

m_mimeTypeOverride = mimeType;
m_mimeTypeOverride = override;
}

void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicString& value, ExceptionState& exceptionState)
Expand Down
2 changes: 1 addition & 1 deletion Source/core/xml/XMLHttpRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class XMLHttpRequest FINAL
void send(ArrayBufferView*, ExceptionState&);
void abort();
void setRequestHeader(const AtomicString& name, const AtomicString& value, ExceptionState&);
void overrideMimeType(const AtomicString& override, ExceptionState&);
void overrideMimeType(const AtomicString& override);
String getAllResponseHeaders() const;
const AtomicString& getResponseHeader(const AtomicString&) const;
ScriptString responseText(ExceptionState&);
Expand Down
2 changes: 1 addition & 1 deletion Source/core/xml/XMLHttpRequest.idl
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ enum XMLHttpRequestResponseType {
readonly attribute DOMString statusText;

// Extension
[RaisesException] void overrideMimeType(DOMString override);
void overrideMimeType(DOMString override);
};

0 comments on commit d0ad8db

Please sign in to comment.