|
Last change
on this file since 2058e5c was 2058e5c, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Working / before login
|
-
Property mode
set to
100644
|
|
File size:
913 bytes
|
| Line | |
|---|
| 1 | let Declaration = require('../declaration')
|
|---|
| 2 |
|
|---|
| 3 | class ImageRendering extends Declaration {
|
|---|
| 4 | /**
|
|---|
| 5 | * Add hack only for crisp-edges
|
|---|
| 6 | */
|
|---|
| 7 | check(decl) {
|
|---|
| 8 | return decl.value === 'pixelated'
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | /**
|
|---|
| 12 | * Return property name by spec
|
|---|
| 13 | */
|
|---|
| 14 | normalize() {
|
|---|
| 15 | return 'image-rendering'
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | /**
|
|---|
| 19 | * Change property name for IE
|
|---|
| 20 | */
|
|---|
| 21 | prefixed(prop, prefix) {
|
|---|
| 22 | if (prefix === '-ms-') {
|
|---|
| 23 | return '-ms-interpolation-mode'
|
|---|
| 24 | }
|
|---|
| 25 | return super.prefixed(prop, prefix)
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | /**
|
|---|
| 29 | * Warn on old value
|
|---|
| 30 | */
|
|---|
| 31 | process(node, result) {
|
|---|
| 32 | return super.process(node, result)
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | /**
|
|---|
| 36 | * Change property and value for IE
|
|---|
| 37 | */
|
|---|
| 38 | set(decl, prefix) {
|
|---|
| 39 | if (prefix !== '-ms-') return super.set(decl, prefix)
|
|---|
| 40 | decl.prop = '-ms-interpolation-mode'
|
|---|
| 41 | decl.value = 'nearest-neighbor'
|
|---|
| 42 | return decl
|
|---|
| 43 | }
|
|---|
| 44 | }
|
|---|
| 45 |
|
|---|
| 46 | ImageRendering.names = ['image-rendering', 'interpolation-mode']
|
|---|
| 47 |
|
|---|
| 48 | module.exports = ImageRendering
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.