Update dependency css-tree to v1.0.0 #405
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.0.0-alpha.39->1.0.0Release Notes
csstree/csstree
v1.0.0Compare Source
onCommentoption to parser configbreakandskipvalues inwalk()to control traversalList#reduce()andList#reduceRight()methodsmdn-datato 2.0.12import { version } from 'css-tree')Lexer#dump()to dump atrules syntaxes as well<urange>list (#135)HexColornode type intoHashelement()specific parsing rulesdist/default-syntax.jsonfrom packagev1.0.0-alpha9Compare Source
<angle>generic according to specs that allow a<number>equals to zero to be used as valid value (#30)v1.0.0-alpha8Compare Source
Scanner#skip()issue method when cursor is moving to the end of sourceProgidnode<id-selector>generic syntaxqunit for<length>generic syntaxmdn/datainstead ofTemplate:CSSDatasyntax.stringify()method tosyntax.translate()trueorfalsevar(), those values are always valid for now98.5%v1.0.0-alpha7Compare Source
>>)TypeandUniversaltype nodesNumberparsing by including sign and exponent (#26)before,after,first-letterandfirst-linepseudos with single colon asPseudoElementFunctionalPseudonode type toPseudoClasseofis reachedSyntax#getAll()methodv1.0.0-alpha6Compare Source
applespecific font keywords (#20)Propertynode stucture from object to stringRulesetnode type toRuleArgumentnode typeDimensionandPercentageposition computationpositions:true(even freeze)lineandcolumncomputation forSyntaxMatcherrorv1.0.0-alpha5Compare Source
v1.0.0-alpha4Compare Source
v1.0.0-alpha3Compare Source
v1.0.0-alpha25Compare Source
onParseError()handlerRawnode in tolerant mode instead of being ignoredRulenode as part of selector instead of being ignoredparseAtrulePreludebehaviour toparseRulePreludeRawnode wraping intoAtrulePreludewhenparseAtrulePreludeis disabledtranslateWithSourceMap(), 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)property()v1.0.0-alpha24Compare Source
selectortoprelude. The reasons: spec names this part so, and this branch can contain not only a selector (SelectorList) but also a raw payload (Raw). What's changed:Rule.selectortoRule.preludeparseSelectorparser option toparseRulePreludeSelectorListLexer#checkStructure()v1.0.0-alpha23Compare Source
Tokenizer#getRawLength()'s false positive balance match to the end of input in some cases (#56)walk(),walkUp()etc)expressiontoprelude(since spec names it so)AtruleExpressionnode type →AtrulePreludeAtrule.expressionfield →Atrule.preludeparseAtruleExpressionparser's option →parseAtrulePreludeatruleExpressionparse context →atrulePreludeatruleExpressionwalk context reference →atrulePreludev1.0.0-alpha22Compare Source
{}-blockin tolerant modeDeclarationListrequire('css-tree/lib/parser')(#47)+nwhenAnPlusB.ais+1to be "round-trip" with parserrequire('css-tree/lib/generator')require('css-tree/lib/walker')(#47)defaultkeyword to the list of invalid values for<custom-ident>(since it reversed per spec)toPlainObject()andfromPlainObject()) moved tolib/convertor(entry point isrequire('css-tree/lib/convertor'))v1.0.0-alpha21Compare Source
Rawtoken typeurl()with raw as url to be more spec complientTokenizer#balancearray computation on token layoutTokenizer#getRawLength()to compute a raw length with respect of block balanceTokenizer#getTokenStart(offset)method to get token start offset by token indexidxandbalancefields to each token ofTokenizer#dump()method resultonParseErroroptionRawnode to use a new approach. Since now aRawnode builds inparser#Raw()function onlyparser#Raw(), it takes 5 parameters now (it might to be changed in future)parser#tolerantParse()to pass a start token index to fallback function instead of source offsetAtruleExpressionconsuming in tolerant modeAtruleExpressionnode intonullAtruleExpressionhandler to always return a node (before it could return anullin some cases)#multiplierSyntaxReferenceErrorsyntax.fork()v1.0.0-alpha20Compare Source
Atruletoken type (<at-rule-token>per spec)Functiontoken type (<function-token>per spec)Urltoken typeTokenizer#getTypes()method withTokenizer#dump()to get all tokens as an arrayTokenizer.TYPE.WhitespacetoTokenizer.TYPE.WhiteSpaceTokenizer.findWhitespaceEnd()toTokenizer.findWhiteSpaceEnd()tolerant: trueoption). In this mode parse errors are never occour and any invalid part of CSS turns into aRawnode. Current safe points:Atrule,AtruleExpression,Rule,SelectorandDeclaration. Feature is experimental and further improvements are planned.Atrule.expressionto contain aAtruleExpressionnode ornullonly (other node types is wrapping into aAtruleExpressionnode)AttributeSelector.operatortoAttributeSelector.matchertranslate()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.xunit to<resolution>generic typezero or moremultipliers)ASTNodenode type to contain a reference to AST node#multipliertranslate()function to get a handler as third argument (optional). That handler recieves result of node traslation and can be used for decoration purposes. See exampleSyntaxParseErrorto grammar exportSequenceforGroupnode type (Sequencenode type removed)explicitboolean property forGroupnonEmptyGroup's property todisallowEmptyGroupwhen it contains a singleGroupterm (return thisGroupas a result)Lexer#matchProperty()andLexer#matchType()to return an object instead of match tree. A match tree stores inmatchedfield when AST is matched to grammar successfully, otherwise an error inerrorfield. The result object also has some methods to test AST node against a match tree:getTrace(),isType(),isProperty()andisKeyword()Lexer#matchDeclaration()methodLexer#lastMatchError(error stores in match result object inerrorfield)Lexer#findValueSegments(),Lexer#findDeclarationValueSegments()andLexer#findAllSegments)SyntaxReferenceErrorfor unknown property and type referencesproperty()function:variable→customlineandcolumn) ofErrorand exception on attempt to write in iOS Safariv1.0.0-alpha2Compare Source
onParseError()handlerRawnode in tolerant mode instead of being ignoredRulenode as part of selector instead of being ignoredparseAtrulePreludebehaviour toparseRulePreludeRawnode wraping intoAtrulePreludewhenparseAtrulePreludeis disabledtranslateWithSourceMap(), 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)property()v1.0.0-alpha19Compare Source
Listclass with new methods:List#prepend(item)List#prependData(data)List#insertData(data)List#insertList(list)List#replace(item, itemOrList)v1.0.0-alpha18Compare Source
atrulewalk context (#39)AnPlusB,AttributeSelector,Function,MediaFeatureandRatio(1e95877)Listexception messages (@strarsis, #42)v1.0.0-alpha17Compare Source
syntaxexportsto expose a default syntaxcreateSyntax()method to create a new syntax from scratchfork()method to create a new syntax based on given via extensionmediaQueryListandmediaQueryparsing contextsCDOandCDCnode types#and+)@font-faceat-rulechroma()to legacy IE filter functionsHexColorto consume hex only\0and\9hacks (#2)RatiotermsRatiotermRatioterm!ie)trueforimportantfield in case identifier equals toimportantand string otherwiseParserclassreadSelectorSequence(),readSequenceFallback()andreadSelectorSequenceFallbackmethodsAtruleExpression,SelectorandValuetranslateMarkup(ast, before, after)method for complex casestranslateWithSourceMapto be more flexible (based ontranslateMarkup, additional work to be done in next releases)checkStructure(ast)method to check AST structure based on syntax definitionmdn/data<'offset-position'>syntax<position>property with-webkit-sticky(@sergejmueller, #37)gen:syntax) to generate AST format reference page (docs/ast.md) using syntax definitionv1.0.0-alpha16Compare Source
ParserclassstartOffsetoption toTokenizer(constructor andsetSource()method)readSequenceFallback) and selector (readSelectorSequenceFallback) sequence readersAnPlusBSelectorconsumerv1.0.0-alpha15Compare Source
atruleExpressioncontextkeyword()andproperty()property()to not lowercase custom property namesvariableboolean flag inproperty()resultscannerintotokenizersyntaxintolexerdocs/*.htmlfiles to csstree/docs repoelement()function forValuecontext (-moz-element()supported as well)Universalnode type intoTypeId->IdSelectorClass->ClassSelectorType->TypeSelectorAttribute->AttributeSelectorPseudoClass->PseudoClassSelectorPseudoElement->PseudoElementSelectorHash->HexColorSpace->WhiteSpaceAn+B->AnPlusBProgidnode typeMediaQueryconsumer to not validate syntax on parse and to include whitespaces in children sequence as isWhiteSpace.valueproperty to store whitespace sequencefalsesome part of CSS represents as balancedRaw):parseAtruleExpression– to parse at-rule expressions (trueby default)parseSelector– to parse rule's selector (trueby default)parseValue- to parse declaration's value (trueby default)parseCustomProperty– to parse value and fallback of custom property (falseby default)v1.0.0-alpha14Compare Source
DeclarationList,MediaQueryList,MediaQuery,MediaFeatureandRationode typesdeclarationListcontext (useful to parse HTMLstyleattribute content)@import,@media,@pageand@supportsat-rulesatruleoption forparse()config, is used foratruleExpessioncontext to specify custom consumer for at-rule if anyScanner#skipWS(),Scanner#eatNonWS(),Scanner#consume()andScanner#consumeNonWS()helper methodsRawPseudoElementto be a functional-pseudo (#33)Atrule.blockto contain aBlocknode type only if anyBlock.locpositions to include curly bracketsAtrule.expressionto store anullif no expressionStyleSheetnode type only for top level node (when context isstylesheet, that's by default)Parentheses,BracketsandFunctionconsumers to use passed sequence reader instead of its ownValueandAtruleExpressionconsumers to use common sequence reader (that reader was used byValueconsumer before)CommaRawvar()fallback value as balancedRawvar()starts with double dashNthto have alocpropertySelectorList.locandSelector.locpositions to exclude spacesdefault-syntax.jsonis not found error (#32, @philschatz)Typeselector starting with dash (parser throws an error in this case now)Rule(not sure if it's correct but looks reasonable)>>combinator support until any browser support (no signals about that yet)PseudoElement.legacyproperty:before,:after,:first-letterand:first-lineto represent them asPseudoElement, now those pseudos are represented asPseudoClassnodesSyntax#match()methodv1.0.0-alpha13Compare Source
SyntaxMatchErrormismatchOffsetoffsetproperty to store bad node offset in source CSS if anylocproperty that stores bad nodelocif anyv1.0.0-alpha12Compare Source
Syntax#matchProperty()method to always return a positive result for custom properties since syntax is never defined for them (#31)fromPlainObject()andtoPlainObject()to convert plain object to AST or AST to plain object (currently convertsList<->Array)v1.0.0-alpha11Compare Source
:matches(<selector-list>)(#28):has(<relative-selector-list>)::slotted(<compound-selector>)Bracketsnode typeSelectornode type toSelectorListSimpleSelectornode type toSelectorUnicodeRange.nameproperty toUnicodeRange.valueNegationnode type for regularPseudoClasschildrennow:StyleSheet.rules->StyleSheet.childrenSelectorList.selectors->SelectorList.childrenBlock.declarations->Block.children*.sequence->*.childrenHexandUnicodeRangewhen number not an integernth-pseudos parsingAn+Bnode type to represent expressions like2n + 1or-3naorbis not an integeroddandevenkeywords processing, keywords are storing asIdentifiernode type nowNthnode type format to store anth-query and an optionalselectorofclause fornth-pseudos (a.e.:nth-child(2n + 1 of li, img))Nthparsing rules to:nth-child(),:nth-last-child(),:nth-of-type()and:nth-last-of-type()pseudosinfonode property toloclocto storestartandendpositionsv1.0.0-alpha10Compare Source
Scannerto be a single point to its functionalityScannerclass to be useful for external projectswalk()function behaviour to traverse AST nodes in natural orderwalkUp()function to traverse AST nodes from deepest to parent (behaves aswalk()before)Renovate configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.