source: frontend/node_modules/css-tree/CHANGELOG.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 34.4 KB
RevLine 
[9af201e]1## 1.0.0-alpha.37 (October 22, 2019)
2
3- Bumped `source-map` version to `^0.6.1` to fix source map generation inconsistency across node.js versions due to mappings sorting bug and v8 moving to [a stable Array#sort](https://v8.dev/blog/array-sort) ([fix commit](https://github.com/mozilla/source-map/commit/f35a2e4212dd025cb5e1fc219e7ac8a4b96c2cc9) in `source-map`)
4
5## 1.0.0-alpha.36 (October 13, 2019)
6
7- Dropped support for Node < 8
8- Updated dev deps (fixed `npm audit` issues)
9- Reworked build pipeline
10 - Package provides `dist/csstree.js` and `dist/csstree.min.js` now (instead of single `dist/csstree.js` that was a min version)
11 - Bundle size (min version) reduced from 191Kb to 158Kb due to some optimisations
12- Definition syntax
13 - Renamed `grammar` into `definitionSyntax` (named per spec)
14 - Added `compact` option to `generate()` method to avoid formatting (spaces) when possible
15- Lexer
16 - Changed `dump()` method to produce syntaxes in compact form by default
17
18## 1.0.0-alpha.35 (October 7, 2019)
19
20- Walker
21 - Changed implementation to avoid runtime compilation due to CSP issues (see #91, #109)
22 - Added `find()`, `findLast()` and `findAll()` methods (e.g. `csstree.find(ast, node => node.type === 'ClassSelector')`)
23
24## 1.0.0-alpha.34 (July 27, 2019)
25
26- Tokenizer
27 - Added `isBOM()` function
28 - Added `charCodeCategory()` function
29 - Removed `firstCharOffset()` function (use `isBOM()` instead)
30 - Removed `CHARCODE` dictionary
31 - Removed `INPUT_STREAM_CODE*` dictionaries
32- Lexer
33 - Allowed comments in matching value (just ignore them like whitespaces)
34 - Increased iteration count in value matching from 10k up to 15k
35 - Fixed missed `debugger` (#104)
36
37## 1.0.0-alpha.33 (July 11, 2019)
38
39- Lexer
40 - Fixed low priority productions matching by changing an approach for robust one (#103)
41
42## 1.0.0-alpha.32 (July 11, 2019)
43
44- Lexer
45 - Fixed low priority productions matching in long `||-` and `&&-` groups (#103)
46
47## 1.0.0-alpha.31 (July 11, 2019)
48
49- Bumped `mdn/data` to `2.0.4` (#99)
50- Lexer
51 - Added [bracketed range notation](https://drafts.csswg.org/css-values-4/#numeric-ranges) support and related refactoring
52 - Removed `<number-zero-one>`, `<number-one-or-greater>` and `<positive-integer>` from generic types. In fact, types moved to patch, because those types can be expressed in a regular grammar due to bracketed range notation implemented
53 - Added support for multiple token string matching
54 - Improved `<custom-ident>` production matching to claim the keyword only if no other unfulfilled production can claim it (#101)
55 - Improved `<length>` production matching to claim "unitless zero" only if no other unfulfilled production can claim it
56 - Changed lexer's constructor to prevent generic types override when used
57 - Fixed large `||`- and `&&`-group matching, matching continues from the beginning on term match (#85)
58 - Fixed checking that value has `var()` occurrences when value is a string (such values can't be matched on syntax currently and fail with specific error that can be used for ignorance in validation tools)
59 - Fixed `<declaration-value>` and `<any-value>` matching when a value contains a function, parentheses or braces
60
61## 1.0.0-alpha.30 (July 3, 2019)
62
63- Bumped `mdn/data` to `~2.0.3`
64 - Removed type removals from `mdn/data` due to lack of some generic types and specific lexer restictions (since lexer was reworked, see below)
65 - Reduced and updated patches
66- Tokenizer
67 - Reworked tokenizer itself to compliment [CSS Syntax Module Level 3](https://drafts.csswg.org/css-syntax/#tokenization)
68 - `Tokenizer` class splitted into several abstractions:
69 - Added `TokenStream` class
70 - Added `OffsetToLocation` class
71 - Added `tokenize()` function that creates `TokenStream` instance for given string or updates a `TokenStream` instance passed as second parameter
72 - Removed `Tokenizer` class
73 - Removed `Raw` token type
74 - Renamed `Identifier` token type to `Ident`
75 - Added token types: `Hash`, `BadString`, `BadUrl`, `Delim`, `Percentage`, `Dimension`, `Colon`, `Semicolon`, `Comma`, `LeftSquareBracket`, `RightSquareBracket`, `LeftParenthesis`, `RightParenthesis`, `LeftCurlyBracket`, `RightCurlyBracket`
76 - Replaced `Punctuator` with `Delim` token type, that excludes specific characters with its own token type like `Colon`, `Semicolon` etc
77 - Removed `findCommentEnd`, `findStringEnd`, `findDecimalNumberEnd`, `findNumberEnd`, `findEscapeEnd`, `findIdentifierEnd` and `findUrlRawEnd` helper function
78 - Removed `SYMBOL_TYPE`, `PUNCTUATION` and `STOP_URL_RAW` dictionaries
79 - Added `isDigit`, `isHexDigit`, `isUppercaseLetter`, `isLowercaseLetter`, `isLetter`, `isNonAscii`, `isNameStart`, `isName`, `isNonPrintable`, `isNewline`, `isWhiteSpace`, `isValidEscape`, `isIdentifierStart`, `isNumberStart`, `consumeEscaped`, `consumeName`, `consumeNumber` and `consumeBadUrlRemnants` helper functions
80- Parser
81 - Changed parsing algorithms to work with new token type set
82 - Changed `HexColor` consumption in way to relax checking a value, i.e. now `value` is a sequence of one or more name chars
83 - Added `&` as a property hack
84 - Relaxed `var()` parsing to only check that a first arguments is an identifier (not a custom property name as before)
85- Lexer
86 - Reworked syntax matching to relay on token set only (having AST is optional now)
87 - Extended `Lexer#match()`, `Lexer#matchType()` and `Lexer#matchProperty()` methods to take a string as value, beside AST as a value
88 - Extended `Lexer#match()` method to take a string as a syntax, beside of syntax descriptor
89 - Reworked generic types:
90 - Removed `<attr()>`, `<url>` (moved to patch) and `<progid>` types
91 - Added types:
92 - Related to token types: `<ident-token>`, `<function-token>`, `<at-keyword-token>`, `<hash-token>`, `<string-token>`, `<bad-string-token>`, `<url-token>`, `<bad-url-token>`, `<delim-token>`, `<number-token>`, `<percentage-token>`, `<dimension-token>`, `<whitespace-token>`, `<CDO-token>`, `<CDC-token>`, `<colon-token>`, `<semicolon-token>`, `<comma-token>`, `<[-token>`, `<]-token>`, `<(-token>`, `<)-token>`, `<{-token>` and `<}-token>`
93 - Complex types: `<an-plus-b>`, `<urange>`, `<custom-property-name>`, `<declaration-value>`, `<any-value>` and `<zero>`
94 - Renamed `<unicode-range>` to `<urange>` as per spec
95 - Renamed `<expression>` (IE legacy extension) to `<-ms-legacy-expression>` and may to be removed in next releases
96
97## 1.0.0-alpha.29 (May 30, 2018)
98
99- Lexer
100 - Syntax matching was completely reworked. Now it's token-based and uses state machine. Public API has not changed. However, some internal data structures have changed. Most significal change in syntax match result tree structure, it's became token-based instead of node-based.
101 - Grammar
102 - Changed grammar tree format:
103 - Added `Token` node type to represent a single code point (`<delim-token>`)
104 - Added `Multiplier` that wraps a single node (`term` property)
105 - Added `AtKeyword` to represent `<at-keyword-token>`
106 - Removed `Slash` and `Percent` node types, they are replaced for a node with `Token` type
107 - Changed `Function` to represent `<function-token>` with no children
108 - Removed `multiplier` property from `Group`
109 - Changed `generate()` method:
110 - Method takes an `options` as second argument now (`generate(node, forceBraces, decorator)` -> `generate(node, options)`). Two options are supported: `forceBraces` and `decorator`
111 - When a second parameter is a function it treats as `decorate` option value, i.e. `generate(node, fn)` -> `generate(node, { decorate: fn })`
112 - Decorate function invokes with additional parameter – a reference to a node
113- Tokenizer
114 - Renamed `Atrule` const to `AtKeyword`
115
116## 1.0.0-alpha.28 (February 19, 2018)
117
118- Renamed `lexer.grammar.translate()` method into `generate()`
119- Fixed `<'-webkit-font-smoothing'>` and `<'-moz-osx-font-smoothing'>` syntaxes (#75)
120- Added vendor keywords for `<'overflow'>` property syntax (#76)
121- Pinned `mdn-data` to `~1.1.0` and fixed issues with some updated property syntaxes
122
123## 1.0.0-alpha.27 (January 14, 2018)
124
125- Generator
126 - Changed node's `generate()` methods invocation, methods now take a node as a single argument and context (i.e. `this`) that have methods: `chunk()`, `node()` and `children()`
127 - Renamed `translate()` to `generate()` and changed to take `options` argument
128 - Removed `translateMarkup(ast, enter, leave)` method, use `generate(ast, { decorator: (handlers) => { ... }})` instead
129 - Removed `translateWithSourceMap(ast)`, use `generate(ast, { sourceMap: true })` instead
130 - Changed to support for children as an array
131- Walker
132 - Changed `walk()` to take an `options` argument instead of handler, with `enter`, `leave`, `visit` and `reverse` options (`walk(ast, fn)` is still works and equivalent to `walk(ast, { enter: fn })`)
133 - Removed `walkUp(ast, fn)`, use `walk(ast, { leave: fn })`
134 - Removed `walkRules(ast, fn)`, use `walk(ast, { visit: 'Rule', enter: fn })` instead
135 - Removed `walkRulesRight(ast, fn)`, use `walk(ast, { visit: 'Rule', reverse: true, enter: fn })` instead
136 - Removed `walkDeclarations(ast, fn)`, use `walk(ast, { visit: 'Declaration', enter: fn })` instead
137 - Changed to support for children as array in most cases (`reverse: true` will fail on arrays since they have no `forEachRight()` method)
138- Misc
139 - List
140 - Added `List#forEach()` method
141 - Added `List#forEachRight()` method
142 - Added `List#filter()` method
143 - Changed `List#map()` method to return a `List` instance instead of `Array`
144 - Added `List#push()` method, similar to `List#appendData()` but returns nothing
145 - Added `List#pop()` method
146 - Added `List#unshift()` method, similar to `List#prependData()` but returns nothing
147 - Added `List#shift()` method
148 - Added `List#prependList()` method
149 - Changed `List#insert()`, `List#insertData()`, `List#appendList()` and `List#insertList()` methods to return a list that performed an operation
150 - Changed `keyword()` method
151 - Changed `name` field to include a vendor prefix
152 - Added `basename` field to contain a name without a vendor prefix
153 - Added `custom` field that contain a `true` when keyword is a custom property reference
154 - Changed `property()` method
155 - Changed `name` field to include a vendor prefix
156 - Added `basename` field to contain a name without any prefixes, i.e. a hack and a vendor prefix
157 - Added `vendorPrefix()` method
158 - Added `isCustomProperty()` method
159
160## 1.0.0-alpha.26 (November 9, 2017)
161
162- Tokenizer
163 - Added `Tokenizer#isBalanceEdge()` method
164 - Removed `Tokenizer.endsWith()` method
165- Parser
166 - Made the parser tolerant to errors by default
167 - Removed `tolerant` parser option (no parsing modes anymore)
168 - Removed `property` parser option (a value parsing does not depend on property name anymore)
169 - Canceled error for a handing semicolon in a block
170 - Canceled error for unclosed `Brackets`, `Function` and `Parentheses` when EOF is reached
171 - Fixed error when prelude ends with a comment for at-rules with custom prelude consumer
172 - Relaxed at-rule parsing:
173 - Canceled error when EOF is reached after a prelude
174 - Canceled error for an at-rule with custom block consumer when at-rule has no block (just don't apply consumer in that case)
175 - Canceled error on at-rule parsing when it occurs outside prelude or block (at-rule is converting to `Raw` node)
176 - Allowed for any at-rule to have a prelude and a block, even if it's invalid per at-rule syntax (the responsibility for this check is moved to lexer, since it's possible to construct a AST with such errors)
177 - Made a declaration value a safe parsing point (i.e. error on value parsing lead to a value is turning into `Raw` node, not a declaration as before)
178 - Excluded surrounding white spaces and comments from a `Raw` node that represents a declaration value
179 - Changed `Value` parse handler to return a node only with type `Value` (previously it returned a `Raw` node in some cases)
180 - Fixed issue with `onParseError()` is not invoked for errors occured on selector or declaration value parsing in some cases
181 - Changed using of `onParseError()` to stop parsing if handler throws an exception
182- Lexer
183 - Changed `grammar.walk()` to invoke passed handler on entering to node rather than on leaving the node
184 - Improved `grammar.walk()` to take a walk handler pair as an object, i.e. `walk(node, { enter: fn, leave: fn })`
185 - Changed `Lexer#match*()` methods to take a node of any type, but with a `children` field
186 - Added `Lexer#match(syntax, node)` method
187 - Fixed `Lexer#matchType()` method to stop return a positive result for the CSS wide keywords
188
189## 1.0.0-alpha25 (October 9, 2017)
190
191- Parser
192 - Added fallback node as argument to `onParseError()` handler
193 - Fixed raw consuming in tolerant mode when selector is invalid (greedy consuming and redundant warnings)
194 - Fixed exception in tolerant mode caused by unknown at-rule with unclosed block
195 - Changed handling of semicolons:
196 - Hanging semicolon inside declaration blocks raise an error or turns into a `Raw` node in tolerant mode instead of being ignored
197 - Semicolon outside of declaration blocks opens a `Rule` node as part of selector instead of being ignored
198 - Aligned `parseAtrulePrelude` behaviour to `parseRulePrelude`
199 - Removed `Raw` node wraping into `AtrulePrelude` when `parseAtrulePrelude` is disabled
200 - Removed error emitting when at-rule has a custom prelude customer but no prelude is found (it should be validated by a lexer later)
201- Generator
202 - Fixed performance issue with `translateWithSourceMap()`, flattening the string (because of mixing building string and indexing into it) turned it into a quadratic algorithm (approximate numbers can be found in [the quiz created by this case](https://gist.github.com/lahmatiy/ea25d0e623d88ca9848384b5707d52d9))
203- Added support for a single solidus hack for `property()`
204- Minor fixes for custom errors
205
206## 1.0.0-alpha24 (September 14, 2017)
207
208- Improved CSSTree to be stable for standart build-in objects extension (#58)
209- Parser
210 - Renamed rule's `selector` to `prelude`. The reasons: [spec names this part so](https://www.w3.org/TR/css-syntax-3/#qualified-rule), and this branch can contain not only a selector (`SelectorList`) but also a raw payload (`Raw`). What's changed:
211 - Renamed `Rule.selector` to `Rule.prelude`
212 - Renamed `parseSelector` parser option to `parseRulePrelude`
213 - Removed option for selector parse in `SelectorList`
214- Lexer
215 - Fixed undefined positions in a error when match a syntax to empty or white space only value
216 - Improved `Lexer#checkStructure()`
217 - Return a warning as an object with node reference and message
218 - No exception on unknown node type, return a warning instead
219
220## 1.0.0-alpha23 (September 10, 2017)
221
222- Fixed `Tokenizer#getRawLength()`'s false positive balance match to the end of input in some cases (#56)
223- Rename walker's entry point methods to be the same as CSSTree exposed methods (i.e. `walk()`, `walkUp()` etc)
224- Rename at-rule's `expression` to `prelude` (since [spec names it so](https://www.w3.org/TR/css-syntax-3/#at-rule))
225 - `AtruleExpression` node type → `AtrulePrelude`
226 - `Atrule.expression` field → `Atrule.prelude`
227 - `parseAtruleExpression` parser's option → `parseAtrulePrelude`
228 - `atruleExpression` parse context → `atrulePrelude`
229 - `atruleExpression` walk context reference → `atrulePrelude`
230
231## 1.0.0-alpha22 (September 8, 2017)
232
233- Parser
234 - Fixed exception on parsing of unclosed `{}-block` in tolerant mode
235 - Added tolerant mode support for `DeclarationList`
236 - Added standalone entry point, i.e. default parser can be used via `require('css-tree/lib/parser')` (#47)
237- Generator
238 - Changed generator to produce `+n` when `AnPlusB.a` is `+1` to be "round-trip" with parser
239 - Added standalone entry point, i.e. default generators can be used via `require('css-tree/lib/generator')`
240- Walker
241 - Added standalone entry point, i.e. default walkers can be used via `require('css-tree/lib/walker')` (#47)
242- Lexer
243 - Added `default` keyword to the list of invalid values for `<custom-ident>` (since it reversed per [spec](https://www.w3.org/TR/css-values/#custom-idents))
244- Convertors (`toPlainObject()` and `fromPlainObject()`) moved to `lib/convertor` (entry point is `require('css-tree/lib/convertor')`)
245
246## 1.0.0-alpha21 (September 5, 2017)
247
248- Tokenizer
249 - Added `Raw` token type
250 - Improved tokenization of `url()` with raw as url to be more spec complient
251 - Added `Tokenizer#balance` array computation on token layout
252 - Added `Tokenizer#getRawLength()` to compute a raw length with respect of block balance
253 - Added `Tokenizer#getTokenStart(offset)` method to get token start offset by token index
254 - Added `idx` and `balance` fields to each token of `Tokenizer#dump()` method result
255- Parser
256 - Added `onParseError` option
257 - Reworked node parsers that consume a `Raw` node to use a new approach. Since now a `Raw` node builds in `parser#Raw()` function only
258 - Changed semantic of `parser#Raw()`, it takes 5 parameters now (it might to be changed in future)
259 - Changed `parser#tolerantParse()` to pass a start token index to fallback function instead of source offset
260 - Fixed `AtruleExpression` consuming in tolerant mode
261 - Atrule handler to convert an empty `AtruleExpression` node into `null`
262 - Changed `AtruleExpression` handler to always return a node (before it could return a `null` in some cases)
263- Lexer
264 - Fixed comma match node for `#` multiplier
265 - Added reference name to `SyntaxReferenceError`
266- Additional fixes on custom errors
267- Reduced possible corruption of base config by `syntax.fork()`
268
269## 1.0.0-alpha20 (August 28, 2017)
270
271- Tokenizer
272 - Added `Atrule` token type (`<at-rule-token>` per spec)
273 - Added `Function` token type (`<function-token>` per spec)
274 - Added `Url` token type
275 - Replaced `Tokenizer#getTypes()` method with `Tokenizer#dump()` to get all tokens as an array
276 - Renamed `Tokenizer.TYPE.Whitespace` to `Tokenizer.TYPE.WhiteSpace`
277 - Renamed `Tokenizer.findWhitespaceEnd()` to `Tokenizer.findWhiteSpaceEnd()`
278- Parser
279 - Added initial implementation of tollerant mode (turn on by passing `tolerant: true` option). In this mode parse errors are never occour and any invalid part of CSS turns into a `Raw` node. Current safe points: `Atrule`, `AtruleExpression`, `Rule`, `Selector` and `Declaration`. Feature is experimental and further improvements are planned.
280 - Changed `Atrule.expression` to contain a `AtruleExpression` node or `null` only (other node types is wrapping into a `AtruleExpression` node)
281 - Renamed `AttributeSelector.operator` to `AttributeSelector.matcher`
282- Generator
283 - `translate()` method is now can take a function as second argument, that recieves every generated chunk. When no function is passed, default handler is used, it concats all the chunks and method returns a string.
284- Lexer
285 - Used [mdn/data](https://github.com/mdn/data) package as source of lexer's grammar instead of local dictionaries
286 - Added `x` unit to `<resolution>` generic type
287 - Improved match tree:
288 - Omited Group (sequences) match nodes
289 - Omited empty match nodes (for terms with `zero or more` multipliers)
290 - Added `ASTNode` node type to contain a reference to AST node
291 - Fixed node duplication (uncompleted match were added to tree)
292 - Added AST node reference in match nodes
293 - Added comma match node by `#` multiplier
294 - Grammar
295 - Changed `translate()` function to get a handler as third argument (optional). That handler recieves result of node traslation and can be used for decoration purposes. See [example](https://github.com/csstree/docs/blob/04c65af44477b5ea05feb373482898122b2a4528/docs/syntax.html#L619-L627)
296 - Added `SyntaxParseError` to grammar export
297 - Reworked group and multipliers representation in syntax tree:
298 - Replaced `Sequence` for `Group` node type (`Sequence` node type removed)
299 - Added `explicit` boolean property for `Group`
300 - Only groups can have a multiplier now (other node types is wrapping into a single term implicit group when multiplier is applied)
301 - Renamed `nonEmpty` Group's property to `disallowEmpty`
302 - Added optimisation for syntax tree by dropping redundant root `Group` when it contains a single `Group` term (return this `Group` as a result)
303 - Changed lexer's match functionality
304 - Changed `Lexer#matchProperty()` and `Lexer#matchType()` to return an object instead of match tree. A match tree stores in `matched` field when AST is matched to grammar successfully, otherwise an error in `error` field. The result object also has some methods to test AST node against a match tree: `getTrace()`, `isType()`, `isProperty()` and `isKeyword()`
305 - Added `Lexer#matchDeclaration()` method
306 - Removed `Lexer#lastMatchError` (error stores in match result object in `error` field)
307 - Added initial implementation of search for AST segments (new lexer methods: `Lexer#findValueSegments()`, `Lexer#findDeclarationValueSegments()` and `Lexer#findAllSegments`)
308 - Implemented `SyntaxReferenceError` for unknown property and type references
309- Renamed field in resulting object of `property()` function: `variable` → `custom`
310- Fixed issue with readonly properties (e.g. `line` and `column`) of `Error` and exception on attempt to write in iOS Safari
311
312## 1.0.0-alpha19 (April 24, 2017)
313
314- Extended `List` class with new methods:
315 - `List#prepend(item)`
316 - `List#prependData(data)`
317 - `List#insertData(data)`
318 - `List#insertList(list)`
319 - `List#replace(item, itemOrList)`
320
321## 1.0.0-alpha18 (April 3, 2017)
322
323- Added `atrule` walk context (#39)
324- Changed a result of generate method for `AnPlusB`, `AttributeSelector`, `Function`, `MediaFeature` and `Ratio` ([1e95877](https://github.com/csstree/csstree/commit/1e9587710efa8e9338bcf0bc794b4b45f286231d))
325- Fixed typo in `List` exception messages (@strarsis, #42)
326- Improved tokenizer to convert an input to a string
327
328## 1.0.0-alpha17 (March 13, 2017)
329
330- Implemented new concept of `syntax`
331 - Changed main `exports` to expose a default syntax
332 - Defined initial [CSS syntax](lib/syntax/default.js)
333 - Implemented `createSyntax()` method to create a new syntax from scratch
334 - Implemented `fork()` method to create a new syntax based on given via extension
335- Parser
336 - Implemented `mediaQueryList` and `mediaQuery` parsing contexts
337 - Implemented `CDO` and `CDC` node types
338 - Implemented additional declaration property prefix hacks (`#` and `+`)
339 - Added support for UTF-16LE BOM
340 - Added support for `@font-face` at-rule
341 - Added `chroma()` to legacy IE filter functions
342 - Improved `HexColor` to consume hex only
343 - Improved support for `\0` and `\9` hacks (#2)
344 - Relaxed number check for `Ratio` terms
345 - Allowed fractal values as a `Ratio` term
346 - Disallowed zero number as a `Ratio` term
347 - Changed important clause parsing
348 - Allowed any identifier for important (to support hacks like `!ie`)
349 - Store `true` for `important` field in case identifier equals to `important` and string otherwise
350 - Fixed parse error formatted message rendering to take into account tabs
351 - Removed exposing of `Parser` class
352 - Removed `readSelectorSequence()`, `readSequenceFallback()` and `readSelectorSequenceFallback` methods
353 - Used single universal sequence consumer for `AtruleExpression`, `Selector` and `Value`
354- Generator
355 - Reworked generator to use auto-generated functions based on syntax definition (additional work to be done in next releases)
356 - Implemented `translateMarkup(ast, before, after)` method for complex cases
357 - Reworked `translateWithSourceMap` to be more flexible (based on `translateMarkup`, additional work to be done in next releases)
358- Walker
359 - Reworked walker to use auto-generated function based on syntax definition (additional work to be done in next releases)
360- Lexer
361 - Prepared for better extensibility (additional work to be done in next releases)
362 - Implemented `checkStructure(ast)` method to check AST structure based on syntax definition
363 - Update syntax dictionaries to latest `mdn/data`
364 - Add missing `<'offset-position'>` syntax
365 - Extended `<position>` property with `-webkit-sticky` (@sergejmueller, #37)
366 - Improved mismatch error position
367- Implemented script (`gen:syntax`) to generate AST format reference page (`docs/ast.md`) using syntax definition
368
369## 1.0.0-alpha16 (February 12, 2017)
370
371- Exposed `Parser` class
372- Added `startOffset` option to `Tokenizer` (constructor and `setSource()` method)
373- Added fallback functions for default (`readSequenceFallback`) and selector (`readSelectorSequenceFallback`) sequence readers
374- Fixed edge cases for `AnPlusB`
375- Fixed wrong whitespace ignoring in `Selector` consumer
376
377## 1.0.0-alpha15 (February 8, 2017)
378
379- Fixed broken `atruleExpression` context
380- Fixed vendor prefix detection in `keyword()` and `property()`
381- Fixed `property()` to not lowercase custom property names
382- Added `variable` boolean flag in `property()` result
383- Renamed `scanner` into `tokenizer`
384- Ranamed `syntax` into `lexer`
385- Moved `docs/*.html` files to [csstree/docs](https://github.com/csstree/docs) repo
386- Added `element()` function for `Value` context (`-moz-element()` supported as well)
387- Merged `Universal` node type into `Type`
388- Renamed node types:
389 - `Id` -> `IdSelector`
390 - `Class` -> `ClassSelector`
391 - `Type` -> `TypeSelector`
392 - `Attribute` -> `AttributeSelector`
393 - `PseudoClass` -> `PseudoClassSelector`
394 - `PseudoElement` -> `PseudoElementSelector`
395 - `Hash` -> `HexColor`
396 - `Space` -> `WhiteSpace`
397 - `An+B` -> `AnPlusB`
398- Removed `Progid` node type
399- Relaxed `MediaQuery` consumer to not validate syntax on parse and to include whitespaces in children sequence as is
400- Added `WhiteSpace.value` property to store whitespace sequence
401- Implemented parser options to specify what should be parsed in details (when option is `false` some part of CSS represents as balanced `Raw`):
402 - `parseAtruleExpression` – to parse at-rule expressions (`true` by default)
403 - `parseSelector` – to parse rule's selector (`true` by default)
404 - `parseValue` - to parse declaration's value (`true` by default)
405 - `parseCustomProperty` – to parse value and fallback of custom property (`false` by default)
406- Changed tokenization to stick leading hyphen minus to identifier token
407- Changed selector parsing:
408 - Don't convert spaces into descendant combinator
409 - Don't validate selector structure on parsing (selectors may be checked by lexer later)
410- Initial refactoring of [docs](https://github.com/csstree/csstree/blob/master/docs)
411- Various improvements and fixes
412
413## 1.0.0-alpha14 (February 3, 2017)
414
415- Implemented `DeclarationList`, `MediaQueryList`, `MediaQuery`, `MediaFeature` and `Ratio` node types
416- Implemented `declarationList` context (useful to parse HTML `style` attribute content)
417- Implemented custom consumers for `@import`, `@media`, `@page` and `@supports` at-rules
418- Implemented `atrule` option for `parse()` config, is used for `atruleExpession` context to specify custom consumer for at-rule if any
419- Added `Scanner#skipWS()`, `Scanner#eatNonWS()`, `Scanner#consume()` and `Scanner#consumeNonWS()` helper methods
420- Added custom consumers for known functional-pseudos, consume unknown functional-pseudo content as balanced `Raw`
421- Allowed any `PseudoElement` to be a functional-pseudo (#33)
422- Improved walker implementations to reduce GC thrashing by reusing cursors
423- Changed `Atrule.block` to contain a `Block` node type only if any
424- Changed `Block.loc` positions to include curly brackets
425- Changed `Atrule.expression` to store a `null` if no expression
426- Changed parser to use `StyleSheet` node type only for top level node (when context is `stylesheet`, that's by default)
427- Changed `Parentheses`, `Brackets` and `Function` consumers to use passed sequence reader instead of its own
428- Changed `Value` and `AtruleExpression` consumers to use common sequence reader (that reader was used by `Value` consumer before)
429- Changed default sequence reader to exclude storage of spaces around `Comma`
430- Changed processing of custom properties:
431 - Consume declaration value as balanced `Raw`
432 - Consume `var()` fallback value as balanced `Raw`
433 - Validate first argument of `var()` starts with double dash
434 - Custom property's value and fallback includes spaces around
435- Fixed `Nth` to have a `loc` property
436- Fixed `SelectorList.loc` and `Selector.loc` positions to exclude spaces
437- Fixed issue Browserify build fail with `default-syntax.json` is not found error (#32, @philschatz)
438- Disallowed `Type` selector starting with dash (parser throws an error in this case now)
439- Disallowed empty selectors for `Rule` (not sure if it's correct but looks reasonable)
440- Removed `>>` combinator support until any browser support (no signals about that yet)
441- Removed `PseudoElement.legacy` property
442- Removed special case for `:before`, `:after`, `:first-letter` and `:first-line` to represent them as `PseudoElement`, now those pseudos are represented as `PseudoClass` nodes
443- Removed deprecated `Syntax#match()` method
444- Parser was splitted into modules and related changes, one step closer to an extensible parser
445- Various fixes and improvements, all changes have negligible impact on performance
446
447## 1.0.0-alpha13 (January 19, 2017)
448
449- Changed location storing in `SyntaxMatchError`
450 - Changed property to store mismatch offset to `mismatchOffset`
451 - Changed `offset` property to store bad node offset in source CSS if any
452 - Added `loc` property that stores bad node `loc` if any
453
454## 1.0.0-alpha12 (January 19, 2017)
455
456- Fixed `Syntax#matchProperty()` method to always return a positive result for custom properties since syntax is never defined for them (#31)
457- Implemented `fromPlainObject()` and `toPlainObject()` to convert plain object to AST or AST to plain object (currently converts `List` <-> `Array`)
458
459## 1.0.0-alpha11 (January 18, 2017)
460
461- Added support for `:matches(<selector-list>)` (#28)
462- Added support for `:has(<relative-selector-list>)`
463- Added support for `::slotted(<compound-selector>)`
464- Implemented `Brackets` node type
465- Implemented basic support for at-rule inside rule block (#24)
466- Renamed `Selector` node type to `SelectorList`
467- Renamed `SimpleSelector` node type to `Selector`
468- Renamed `UnicodeRange.name` property to `UnicodeRange.value`
469- Replaced `Negation` node type for regular `PseudoClass`
470- Unified name of node property to store nested nodes, it always `children` now:
471 - `StyleSheet.rules` -> `StyleSheet.children`
472 - `SelectorList.selectors` -> `SelectorList.children`
473 - `Block.declarations` -> `Block.children`
474 - `*.sequence` -> `*.children`
475- Fixed edge cases in parsing `Hex` and `UnicodeRange` when number not an integer
476- Changed `nth-` pseudos parsing
477 - Implemented `An+B` node type to represent expressions like `2n + 1` or `-3n`
478 - Fixed edge cases when `a` or `b` is not an integer
479 - Changed `odd` and `even` keywords processing, keywords are storing as `Identifier` node type now
480 - Changed `Nth` node type format to store a `nth`-query and an optional `selector`
481 - Implemented `of` clause for `nth-` pseudos (a.e. `:nth-child(2n + 1 of li, img)`)
482 - Limited `Nth` parsing rules to `:nth-child()`, `:nth-last-child()`, `:nth-of-type()` and `:nth-last-of-type()` pseudos
483- Changed the way to store locations
484 - Renamed `info` node property to `loc`
485 - Changed format of `loc` to store `start` and `end` positions
486
487## 1.0.0-alpha10 (January 11, 2017)
488
489- Reworked `Scanner` to be a single point to its functionality
490- Exposed `Scanner` class to be useful for external projects
491- Changed `walk()` function behaviour to traverse AST nodes in natural order
492- Implemented `walkUp()` function to traverse AST nodes from deepest to parent (behaves as `walk()` before)
493
494## 1.0.0-alpha9 (December 21, 2016)
495
496- Fixed `<angle>` generic according to specs that allow a `<number>` equals to zero to be used as valid value (#30)
497
498## 1.0.0-alpha8 (November 11, 2016)
499
500- Fixed `Scanner#skip()` issue method when cursor is moving to the end of source
501- Simplified `Progid` node
502- Changed behaviour for bad selector processing, now parsing fails instead of selector ignoring
503- Fixed `<id-selector>` generic syntax
504- Added `q` unit for `<length>` generic syntax
505- Refactored syntax parser (performance)
506- Reduced startup time by implementing lazy syntax parsing (default syntax doesn't parse on module load)
507- Updated syntax dictionaries and used [`mdn/data`](https://github.com/mdn/data) instead of `Template:CSSData`
508- Renamed `syntax.stringify()` method to `syntax.translate()`
509- Simplified generic syntax functions, those functions receive a single AST node for checking and should return `true` or `false`
510- Added exception for values that contains `var()`, those values are always valid for now
511- Added more tests and increase code coverage to `98.5%`
512
513## 1.0.0-alpha7 (October 7, 2016)
514
515- Added support for explicit descendant combinator (`>>`)
516- Implemented `Type` and `Universal` type nodes
517- Improved `Number` parsing by including sign and exponent (#26)
518- Parse `before`, `after`, `first-letter` and `first-line` pseudos with single colon as `PseudoElement`
519- Changed `FunctionalPseudo` node type to `PseudoClass`
520- Fixed attribute selector name parsing (namespace edge cases)
521- Fixed location calculation for specified offset when `eof` is reached
522- Added more non-standard colors (#25)
523- Removed obsolete `Syntax#getAll()` method
524- Fixed various edge cases, code clean up and performance improvements
525
526## 1.0.0-alpha6 (September 23, 2016)
527
528- More accurate positions for syntax mismatch errors
529- Added [`apple`](https://webkit.org/blog/3709/using-the-system-font-in-web-content/) specific font keywords (#20)
530- Changed `Property` node stucture from object to string
531- Renamed `Ruleset` node type to `Rule`
532- Removed `Argument` node type
533- Fixed `Dimension` and `Percentage` position computation
534- Fixed bad selector parsing (temporary solution)
535- Fixed location computation for CSS with very long lines that may lead to really long parsing with `positions:true` (even freeze)
536- Fixed `line` and `column` computation for `SyntaxMatch` error
537- Improved performance of parsing and translation. Now CSSTree is under 10ms in [PostCSS benchmark](https://github.com/postcss/benchmark).
Note: See TracBrowser for help on using the repository browser.