()
| 68 | } |
| 69 | |
| 70 | createElement() { |
| 71 | let element, key, value |
| 72 | const styles = {} |
| 73 | |
| 74 | for (key in this.attributes) { |
| 75 | value = this.attributes[key] |
| 76 | const config = getTextConfig(key) |
| 77 | if (config) { |
| 78 | if (config.tagName) { |
| 79 | var innerElement |
| 80 | const pendingElement = makeElement(config.tagName) |
| 81 | |
| 82 | if (innerElement) { |
| 83 | innerElement.appendChild(pendingElement) |
| 84 | innerElement = pendingElement |
| 85 | } else { |
| 86 | element = innerElement = pendingElement |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | if (config.styleProperty) { |
| 91 | styles[config.styleProperty] = value |
| 92 | } |
| 93 | |
| 94 | if (config.style) { |
| 95 | for (key in config.style) { |
| 96 | value = config.style[key] |
| 97 | styles[key] = value |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | if (Object.keys(styles).length) { |
| 104 | if (!element) { element = makeElement("span") } |
| 105 | for (key in styles) { |
| 106 | value = styles[key] |
| 107 | element.style[key] = value |
| 108 | } |
| 109 | } |
| 110 | return element |
| 111 | } |
| 112 | |
| 113 | createContainerElement() { |
| 114 | for (const key in this.attributes) { |
no test coverage detected