Comparing version 1.0.0-alpha18 to 1.0.0-alpha19
{ | ||
"absolute-size": "xx-small | x-small | small | medium | large | x-large | xx-large", | ||
"alpha-value": "<number>, | <percentage>", | ||
"alpha-value": "<number> | <percentage>", | ||
"angle-percentage": "<angle> | <percentage>", | ||
@@ -123,3 +123,3 @@ "animateable-feature": "scroll-position | contents | <custom-ident>", | ||
"mf-value": "<number> | <dimension> | <ident> | <ratio>", | ||
"minmax()": "minmax( min, max )", | ||
"minmax()": "minmax( [ <length> | <percentage> | <flex> | min-content | max-content | auto ] , [ <length> | <percentage> | <flex> | min-content | max-content | auto ] )", | ||
"named-color": "transparent | aliceblue | antiquewhite | aqua | aquamarine | azure | beige | bisque | black | blanchedalmond | blue | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | cyan | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | fuchsia | gainsboro | ghostwhite | gold | goldenrod | gray | green | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | lime | limegreen | linen | magenta | maroon | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | navy | oldlace | olive | olivedrab | orange | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | purple | rebeccapurple | red | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | silver | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | teal | thistle | tomato | turquoise | violet | wheat | white | whitesmoke | yellow | yellowgreen", | ||
@@ -126,0 +126,0 @@ "namespace-prefix": "<ident>", |
@@ -589,6 +589,2 @@ { | ||
}, | ||
"alpha-value": { | ||
"comment": "wrong comma after <number>", | ||
"syntax": "<number> | <percentage>" | ||
}, | ||
"attr()": { | ||
@@ -595,0 +591,0 @@ "comment": "drop it since it's a generic", |
@@ -0,1 +1,10 @@ | ||
## 1.0.0-alpha19 (April 24, 2017) | ||
- Extended `List` class with new methods: | ||
- `List#prepend(item)` | ||
- `List#prependData(data)` | ||
- `List#insertData(data)` | ||
- `List#insertList(list)` | ||
- `List#replace(item, itemOrList)` | ||
## 1.0.0-alpha18 (April 3, 2017) | ||
@@ -2,0 +11,0 @@ |
@@ -292,12 +292,39 @@ 'use strict'; | ||
List.prototype.prepend = function(item) { | ||
// head | ||
// ^ | ||
// item | ||
this.updateCursors(null, item, this.head, item); | ||
// insert to the beginning of the list | ||
if (this.head !== null) { | ||
// new item <- first item | ||
this.head.prev = item; | ||
// new item -> first item | ||
item.next = this.head; | ||
} else { | ||
// if list has no head, then it also has no tail | ||
// in this case tail points to the new item | ||
this.tail = item; | ||
} | ||
// head always points to new item | ||
this.head = item; | ||
return this; | ||
}; | ||
List.prototype.prependData = function(data) { | ||
return this.prepend(createItem(data)); | ||
}; | ||
List.prototype.append = function(item) { | ||
// tail | ||
// ^ | ||
// item | ||
// item | ||
this.updateCursors(this.tail, item, null, item); | ||
// insert to end of the list | ||
// insert to the ending of the list | ||
if (this.tail !== null) { | ||
// if list has a tail, then it also has a head, but head doesn't change | ||
// last item -> new item | ||
@@ -309,8 +336,8 @@ this.tail.next = item; | ||
} else { | ||
// if list has no a tail, then it also has no a head | ||
// in this case points head to new item | ||
// if list has no tail, then it also has no head | ||
// in this case head points to new item | ||
this.head = item; | ||
} | ||
// tail always start point to new item | ||
// tail always points to new item | ||
this.tail = item; | ||
@@ -359,2 +386,6 @@ | ||
List.prototype.insertData = function(data, before) { | ||
this.insert(createItem(data), before); | ||
}; | ||
List.prototype.remove = function(item) { | ||
@@ -423,2 +454,39 @@ // item | ||
List.prototype.insertList = function(list, before) { | ||
if (before !== undefined && before !== null) { | ||
// ignore empty lists | ||
if (list.head === null) { | ||
return; | ||
} | ||
this.updateCursors(before.prev, list.tail, before, list.head); | ||
// insert in the middle of dist list | ||
if (before.prev !== null) { | ||
// before.prev <-> list.head | ||
before.prev.next = list.head; | ||
list.head.prev = before.prev; | ||
} else { | ||
this.head = list.head; | ||
} | ||
before.prev = list.tail; | ||
list.tail.next = before; | ||
list.head = null; | ||
list.tail = null; | ||
} else { | ||
this.appendList(list); | ||
} | ||
}; | ||
List.prototype.replace = function(oldItem, newItemOrList) { | ||
if ('head' in newItemOrList) { | ||
this.insertList(newItemOrList, oldItem); | ||
} else { | ||
this.insert(newItemOrList, oldItem); | ||
} | ||
this.remove(oldItem); | ||
}; | ||
module.exports = List; |
{ | ||
"name": "css-tree", | ||
"version": "1.0.0-alpha18", | ||
"version": "1.0.0-alpha19", | ||
"description": "Fast detailed CSS parser", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
660790
13529