From 44bfb3b37d788a83b399a88e178484f4913df71b Mon Sep 17 00:00:00 2001 From: Ross-cz Date: Tue, 29 Nov 2016 22:39:15 +0100 Subject: [PATCH] Fix playback when IE11 modifies the XML DOM (#611) When there is a hypen contained inside manifest Location/BaseUri element and the application uses MutationObserver, IE11 can change the XML DOM of the manifest and break playback. This changes the way the document is parsed so that it is resilient to these unintended changes. Related IE bug: https://connect.microsoft.com/IE/feedback/details/1398926/ie11-does-not-parse-cdata-containing-hyphens-correctly Closes #608 --- AUTHORS | 1 + CONTRIBUTORS | 1 + lib/util/xml_utils.js | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 84b2ad8158..91a6392283 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,6 +29,7 @@ Oskar Arvidsson Philo Inc. <*@philo.com> Robert Colantuoni Roi Lipman +Rostislav Hejduk SameGoal Inc. <*@samegoal.com> Sanborn Hilland TalkTalk Plc <*@talktalkplc.com> diff --git a/CONTRIBUTORS b/CONTRIBUTORS index caef002fd0..bd3b9c551c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -43,6 +43,7 @@ Oskar Arvidsson Robert Colantuoni Rohit Makasana Roi Lipman +Rostislav Hejduk Sam Dutton Sanborn Hilland Seth Madison diff --git a/lib/util/xml_utils.js b/lib/util/xml_utils.js index 4dbf8ee267..337360ecef 100644 --- a/lib/util/xml_utils.js +++ b/lib/util/xml_utils.js @@ -66,10 +66,13 @@ shaka.util.XmlUtils.findChildren = function(elem, name) { */ shaka.util.XmlUtils.getContents = function(elem) { var contents = elem.firstChild; + + // check content if (!contents || contents.nodeType != Node.TEXT_NODE) return null; - return contents.nodeValue.trim(); + // read merged text content from all text nodes (fixes MSIE 11 bug) + return elem.textContent.trim(); };