mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Update web-platform-tests to revision e079873c1f30f13e23388a86b2b5beeddd349c78
This commit is contained in:
parent
b52bfbe68a
commit
a61792a8c1
32 changed files with 585 additions and 130 deletions
|
@ -110,8 +110,42 @@ var MathMLFragments = {
|
|||
<mrow class='mathml-container'></mrow>\
|
||||
</mmultiscripts>",
|
||||
"semantics": "\
|
||||
<semantics class='element>\
|
||||
<semantics class='element'>\
|
||||
<mrow class='mathml-container'></mrow>\
|
||||
<annotation class='text-container'></annotation>\
|
||||
</semantics>"
|
||||
};
|
||||
|
||||
var FragmentHelper = {
|
||||
createElement: function(tag) {
|
||||
return document.createElementNS("http://www.w3.org/1998/Math/MathML", tag);
|
||||
},
|
||||
|
||||
isValidChildOfMrow: function(tag) {
|
||||
return !(tag == "annotation" ||
|
||||
tag == "annotation-xml" ||
|
||||
tag == "mprescripts" ||
|
||||
tag == "none" ||
|
||||
tag == "mtr" ||
|
||||
tag == "mtd");
|
||||
},
|
||||
|
||||
isEmpty: function(tag) {
|
||||
return tag === "mspace" || tag == "mprescripts" || tag == "none";
|
||||
},
|
||||
|
||||
element: function(fragment) {
|
||||
return fragment.getElementsByClassName('element')[0];
|
||||
},
|
||||
|
||||
forceNonEmptyElement: function(fragment) {
|
||||
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"))
|
||||
return element.appendChild(document.createElement("span"));
|
||||
throw "Cannot make the element nonempty";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue