Skip to content

Commit

Permalink
Removed INVALID_XML_SPACE error.
Browse files Browse the repository at this point in the history
The implementation of DOMParser on Internet Explorer and Edge actually
implement xml:space, which means that if you passed in an invalid value
the parser would error immediately.
Thus, on IE and Edge, an invalid xml:space value would return an
INVALID_XML error instead of an INVALID_XML_SPACE error.
Though clear errors are useful, such browser-dependent behavior would
just be confusing in the long run.

Change-Id: I46c24452a216fa8bc242148e23d275230f277037
  • Loading branch information
theodab authored and joeyparrish committed Feb 10, 2017
1 parent c39e405 commit 56f6ef4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/media/ttml_text_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ shaka.media.TtmlTextParser =
if (spaceStyle != 'default' && spaceStyle != 'preserve') {
throw new shaka.util.Error(
shaka.util.Error.Category.TEXT,
shaka.util.Error.Code.INVALID_XML_SPACE);
shaka.util.Error.Code.INVALID_XML);
}
var whitespaceTrim = spaceStyle == 'default';

Expand Down
5 changes: 0 additions & 5 deletions lib/util/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,6 @@ shaka.util.Error.Code = {
*/
'INVALID_MP4_VTT': 2008,

/** The text parser failed to parse a text stream due to an invalid
* xml:space value.
*/
'INVALID_XML_SPACE': 2009,


/**
* Some component tried to read past the end of a buffer. The segment index,
Expand Down
2 changes: 1 addition & 1 deletion test/media/ttml_text_parser_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('TtmlTextParser', function() {
],
'<tt>' + ttBody + '</tt>');
// Any other value is rejected as an error.
errorHelper(shaka.util.Error.Code.INVALID_XML_SPACE,
errorHelper(shaka.util.Error.Code.INVALID_XML,
'<tt xml:space="invalid">' + ttBody + '</tt>');
});

Expand Down

0 comments on commit 56f6ef4

Please sign in to comment.