* Create a Space node with width given in CSS ems.
(width)
| 6791 | * Create a Space node with width given in CSS ems. |
| 6792 | */ |
| 6793 | function SpaceNode(width) { |
| 6794 | this.width = void 0; |
| 6795 | this.character = void 0; |
| 6796 | this.width = width; // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html |
| 6797 | // for a table of space-like characters. We use Unicode |
| 6798 | // representations instead of &LongNames; as it's not clear how to |
| 6799 | // make the latter via document.createTextNode. |
| 6800 | |
| 6801 | if (width >= 0.05555 && width <= 0.05556) { |
| 6802 | this.character = "\u200A"; //   |
| 6803 | } else if (width >= 0.1666 && width <= 0.1667) { |
| 6804 | this.character = "\u2009"; //   |
| 6805 | } else if (width >= 0.2222 && width <= 0.2223) { |
| 6806 | this.character = "\u2005"; //   |
| 6807 | } else if (width >= 0.2777 && width <= 0.2778) { |
| 6808 | this.character = "\u2005\u200A"; //    |
| 6809 | } else if (width >= -0.05556 && width <= -0.05555) { |
| 6810 | this.character = "\u200A\u2063"; // ​ |
| 6811 | } else if (width >= -0.1667 && width <= -0.1666) { |
| 6812 | this.character = "\u2009\u2063"; // ​ |
| 6813 | } else if (width >= -0.2223 && width <= -0.2222) { |
| 6814 | this.character = "\u205F\u2063"; // ​ |
| 6815 | } else if (width >= -0.2778 && width <= -0.2777) { |
| 6816 | this.character = "\u2005\u2063"; // ​ |
| 6817 | } else { |
| 6818 | this.character = null; |
| 6819 | } |
| 6820 | } |
| 6821 | /** |
| 6822 | * Converts the math node into a MathML-namespaced DOM element. |
| 6823 | */ |
nothing calls this directly
no outgoing calls
no test coverage detected