Update web-platform-tests to revision 66b4fab488695f98d15ad75b549e302a8d29f865

This commit is contained in:
WPT Sync Bot 2019-08-07 10:23:18 +00:00
parent b6cdf93198
commit b09e82fc9f
161 changed files with 3705 additions and 671 deletions

View file

@ -138,17 +138,25 @@ var FragmentHelper = {
return fragment.getElementsByClassName('element')[0];
},
forceNonEmptyElement: function(fragment) {
appendChild: function(fragment, allowInvalid) {
var element = this.element(fragment) || fragment;
if (element.firstElementChild)
return element.firstElementChild;
if (element.classList.contains("mathml-container"))
return element.appendChild(this.createElement("mrow"));
if (element.classList.contains("foreign-container")) {
var el = document.createElement("span");
el.textContent = "a";
return element.appendChild(el);
}
throw "Cannot make the element nonempty";
if (element.classList.contains("mathml-container") || allowInvalid) {
var el = this.createElement("mi");
el.textContent = "a";
return element.appendChild(el);
}
throw "Cannot append child to the element";
},
forceNonEmptyElement: function(fragment) {
var element = this.element(fragment) || fragment;
if (element.firstElementChild)
return element.firstElementChild;
return this.appendChild(fragment);
}
}