mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 66b4fab488695f98d15ad75b549e302a8d29f865
This commit is contained in:
parent
b6cdf93198
commit
b09e82fc9f
161 changed files with 3705 additions and 671 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue