(decl, prefix, prefixes)
| 2 | |
| 3 | class WritingMode extends Declaration { |
| 4 | insert(decl, prefix, prefixes) { |
| 5 | if (prefix === '-ms-') { |
| 6 | let cloned = this.set(this.clone(decl), prefix) |
| 7 | |
| 8 | if (this.needCascade(decl)) { |
| 9 | cloned.raws.before = this.calcBefore(prefixes, decl, prefix) |
| 10 | } |
| 11 | let direction = 'ltr' |
| 12 | |
| 13 | decl.parent.nodes.forEach(i => { |
| 14 | if (i.prop === 'direction') { |
| 15 | if (i.value === 'rtl' || i.value === 'ltr') direction = i.value |
| 16 | } |
| 17 | }) |
| 18 | |
| 19 | cloned.value = WritingMode.msValues[direction][decl.value] || decl.value |
| 20 | return decl.parent.insertBefore(decl, cloned) |
| 21 | } |
| 22 | |
| 23 | return super.insert(decl, prefix, prefixes) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | WritingMode.names = ['writing-mode'] |
nothing calls this directly
no test coverage detected